Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which
has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful name. Tested on 32- and 64-bit PowerMac. Reviewed by: bde
This commit is contained in:
parent
3da8dada52
commit
54558cdc0e
@ -33,38 +33,38 @@
|
||||
#include <sys/syscall.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#define _SYSCALL(x) \
|
||||
#define _SYSCALL(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
li 0,(__CONCAT(SYS_,x)); \
|
||||
li 0,(__CONCAT(SYS_, name)); \
|
||||
sc
|
||||
|
||||
#define SYSCALL(x) \
|
||||
#define SYSCALL(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
2: b PIC_PLT(CNAME(HIDENAME(cerror))); \
|
||||
ENTRY(__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
|
||||
_SYSCALL(x); \
|
||||
ENTRY(__CONCAT(__sys_, name)); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
|
||||
_SYSCALL(name); \
|
||||
bso 2b
|
||||
|
||||
#define PSEUDO(x) \
|
||||
#define PSEUDO(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
ENTRY(__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
|
||||
_SYSCALL(x); \
|
||||
ENTRY(__CONCAT(__sys_, name)); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
|
||||
_SYSCALL(name); \
|
||||
bnslr; \
|
||||
b PIC_PLT(CNAME(HIDENAME(cerror)))
|
||||
|
||||
#define RSYSCALL(x) \
|
||||
#define RSYSCALL(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
2: b PIC_PLT(CNAME(HIDENAME(cerror))); \
|
||||
ENTRY(__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \
|
||||
_SYSCALL(x); \
|
||||
ENTRY(__CONCAT(__sys_, name)); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
|
||||
_SYSCALL(name); \
|
||||
bnslr; \
|
||||
b PIC_PLT(CNAME(HIDENAME(cerror)))
|
||||
|
@ -69,7 +69,7 @@ ENTRY(setjmp)
|
||||
li %r3,0 /* return (0) */
|
||||
blr
|
||||
|
||||
WEAK_ALIAS(longjmp, __longjmp)
|
||||
WEAK_REFERENCE(CNAME(__longjmp), longjmp)
|
||||
ENTRY(__longjmp)
|
||||
lmw %r9,20(%r3) /* restore regs */
|
||||
mr %r6,%r4 /* save val param */
|
||||
|
@ -33,13 +33,13 @@
|
||||
#include <sys/syscall.h>
|
||||
#include <machine/asm.h>
|
||||
|
||||
#define _SYSCALL(x) \
|
||||
#define _SYSCALL(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
li 0,(__CONCAT(SYS_,x)); \
|
||||
li 0,(__CONCAT(SYS_, name)); \
|
||||
sc
|
||||
|
||||
#define SYSCALL(x) \
|
||||
#define SYSCALL(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
2: mflr %r0; \
|
||||
@ -51,18 +51,18 @@
|
||||
ld %r0,16(%r1); \
|
||||
mtlr %r0; \
|
||||
blr; \
|
||||
ENTRY(__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
|
||||
_SYSCALL(x); \
|
||||
ENTRY(__CONCAT(__sys_, name)); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
|
||||
_SYSCALL(name); \
|
||||
bso 2b
|
||||
|
||||
#define PSEUDO(x) \
|
||||
#define PSEUDO(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
ENTRY(__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \
|
||||
_SYSCALL(x); \
|
||||
ENTRY(__CONCAT(__sys_, name)); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \
|
||||
_SYSCALL(name); \
|
||||
bnslr; \
|
||||
mflr %r0; \
|
||||
std %r0,16(%r1); \
|
||||
@ -74,13 +74,13 @@ ENTRY(__CONCAT(__sys_,x)); \
|
||||
mtlr %r0; \
|
||||
blr;
|
||||
|
||||
#define RSYSCALL(x) \
|
||||
#define RSYSCALL(name) \
|
||||
.text; \
|
||||
.align 2; \
|
||||
ENTRY(__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(x,__CONCAT(__sys_,x)); \
|
||||
WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \
|
||||
_SYSCALL(x); \
|
||||
ENTRY(__CONCAT(__sys_, name)); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), name); \
|
||||
WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\
|
||||
_SYSCALL(name); \
|
||||
bnslr; \
|
||||
\
|
||||
mflr %r0; \
|
||||
|
@ -93,7 +93,7 @@ ENTRY(setjmp)
|
||||
li %r3,0 /* return (0) */
|
||||
blr
|
||||
|
||||
WEAK_ALIAS(longjmp, __longjmp)
|
||||
WEAK_REFERENCE(__longjmp, longjmp)
|
||||
ENTRY(__longjmp)
|
||||
ld %r9,40 + 0*8(%r3)
|
||||
ld %r10,40 + 1*8(%r3)
|
||||
|
@ -116,9 +116,9 @@
|
||||
#define __FBSDID(s) /* nothing */
|
||||
#endif /* not lint and not STRIP_FBSDID */
|
||||
|
||||
#define WEAK_ALIAS(alias,sym) \
|
||||
#define WEAK_REFERENCE(sym, alias) \
|
||||
.weak alias; \
|
||||
alias = sym
|
||||
.equ alias,sym
|
||||
|
||||
#ifdef __STDC__
|
||||
#define WARN_REFERENCES(_sym,_msg) \
|
||||
|
Loading…
Reference in New Issue
Block a user