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:
Andreas Tobler 2012-02-05 20:04:43 +00:00
parent 3da8dada52
commit 54558cdc0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=231044
5 changed files with 36 additions and 36 deletions

View File

@ -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)))

View File

@ -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 */

View File

@ -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; \

View File

@ -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)

View File

@ -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) \