diff options
author | jasone <jasone@FreeBSD.org> | 2000-01-29 12:50:47 +0000 |
---|---|---|
committer | jasone <jasone@FreeBSD.org> | 2000-01-29 12:50:47 +0000 |
commit | b7a1b427dece6984516b88a6b55d66047d55df7d (patch) | |
tree | 93fad1d2a6fa8e9993f859a5c2c07d9da55575dd /lib | |
parent | f27f68a3d1abca1334a2ec663f5732355d562620 (diff) | |
download | FreeBSD-src-b7a1b427dece6984516b88a6b55d66047d55df7d.zip FreeBSD-src-b7a1b427dece6984516b88a6b55d66047d55df7d.tar.gz |
Undo the ill-conceived breakage of the previous commit and really fix:
For libc_r renamed syscalls, correct symbol naming from
_thread_sys_foo() <-- _foo() to _thread_sys_foo() <-- _foo() <-- foo(). This
is necessary for system calls which libc_r doesn't define foo().
Some weak symbols such as poll() are defined twice. From what I understand,
depending on one weak symbol or the other to be used is a bad idea. All
such weak symbols defined in the libc_r-specific code should therefore be
made strong (non-weak?).
Simplify PSEUDO() to not define any weak symbols, since they aren't ever
needed.
alpha/SYS.h:
Correct reversed usage of WEAK_ALIAS(), which has reversed arguments from
__weak_reference(). Also, fix reversal of symbols, so that syscall foo()
is a weak alias for _foo().
Add WEAK_ALIAS() call to PRSYSCALL(), which unlike the i386 version of
PRSYSCALL(), is not defined in terms of PSYSCALL().
Make PSEUDO() equivalent to the i386 version.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/alpha/SYS.h | 18 | ||||
-rw-r--r-- | lib/libc/amd64/SYS.h | 18 | ||||
-rw-r--r-- | lib/libc/i386/SYS.h | 18 |
3 files changed, 28 insertions, 26 deletions
diff --git a/lib/libc/alpha/SYS.h b/lib/libc/alpha/SYS.h index a7d9b69..8e14e92 100644 --- a/lib/libc/alpha/SYS.h +++ b/lib/libc/alpha/SYS.h @@ -46,8 +46,8 @@ LLABEL(name,1): #define SYSCALL(name) \ -LEAF(name,0); /* XXX # of args? */ \ - WEAK_ALIAS(__CONCAT(_,name), name); \ +LEAF(__CONCAT(_,name),0); /* XXX # of args? */ \ + WEAK_ALIAS(name, __CONCAT(_,name)); \ CALLSYS_ERROR(name) #define SYSCALL_NOERROR(name) \ @@ -58,7 +58,7 @@ LEAF(name,0); /* XXX # of args? */ \ #define RSYSCALL(name) \ SYSCALL(name); \ RET; \ -END(name) +END(__CONCAT(_,name)) #define RSYSCALL_NOERROR(name) \ SYSCALL_NOERROR(name); \ @@ -67,11 +67,11 @@ END(name) #define PSEUDO(label,name) \ -LEAF(label,0); /* XXX # of args? */ \ - WEAK_ALIAS(__CONCAT(_,name), name); \ +LEAF(__CONCAT(_,label),0); /* XXX # of args? */ \ + WEAK_ALIAS(label, __CONCAT(_,label)); \ CALLSYS_ERROR(name); \ RET; \ -END(label); +END(__CONCAT(_,label)); #define PSEUDO_NOERROR(label,name) \ LEAF(label,0); /* XXX # of args? */ \ @@ -104,18 +104,20 @@ END(___CONCAT(_thread_sys_,name)) #define PSYSCALL(name) \ PLEAF(name,0); /* XXX # of args? */ \ - WEAK_ALIAS(__CONCAT(_,name), name); \ + WEAK_ALIAS(__CONCAT(_,name), __CONCAT(_thread_sys_,name)); \ + WEAK_ALIAS(name, __CONCAT(_,name)); \ CALLSYS_ERROR(name) #define PRSYSCALL(name) \ PLEAF(name,0); /* XXX # of args? */ \ + WEAK_ALIAS(__CONCAT(_,name), __CONCAT(_thread_sys_,name)); \ + WEAK_ALIAS(name, __CONCAT(_,name)); \ CALLSYS_ERROR(name) \ RET; \ PEND(name) #define PPSEUDO(label,name) \ PLEAF(label,0); /* XXX # of args? */ \ - WEAK_ALIAS(__CONCAT(_,name), name); \ CALLSYS_ERROR(name); \ RET; \ PEND(label) diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h index 9195f9b..155672f 100644 --- a/lib/libc/amd64/SYS.h +++ b/lib/libc/amd64/SYS.h @@ -41,17 +41,17 @@ #include <sys/syscall.h> #include "DEFS.h" -#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(_,x)); \ +#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ + ENTRY(__CONCAT(_,x)); \ + .weak CNAME(x); \ + .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b #define RSYSCALL(x) SYSCALL(x); ret -#define PSEUDO(x,y) ENTRY(__CONCAT(_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(_,x)); \ +#define PSEUDO(x,y) ENTRY(__CONCAT(_,x)); \ + .weak CNAME(x); \ + .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,y), %eax; KERNCALL; ret /* gas messes up offset -- although we don't currently need it, do for BCS */ @@ -73,13 +73,13 @@ */ #define PSYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ ENTRY(__CONCAT(_thread_sys_,x)); \ + .weak CNAME(__CONCAT(_,x)); \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(_thread_sys_,x));\ .weak CNAME(x); \ .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b #define PRSYSCALL(x) PSYSCALL(x); ret #define PPSEUDO(x,y) ENTRY(__CONCAT(_thread_sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,y), %eax; KERNCALL; ret #else /* diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h index 9195f9b..155672f 100644 --- a/lib/libc/i386/SYS.h +++ b/lib/libc/i386/SYS.h @@ -41,17 +41,17 @@ #include <sys/syscall.h> #include "DEFS.h" -#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ - ENTRY(__CONCAT(_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(_,x)); \ +#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ + ENTRY(__CONCAT(_,x)); \ + .weak CNAME(x); \ + .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b #define RSYSCALL(x) SYSCALL(x); ret -#define PSEUDO(x,y) ENTRY(__CONCAT(_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(_,x)); \ +#define PSEUDO(x,y) ENTRY(__CONCAT(_,x)); \ + .weak CNAME(x); \ + .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,y), %eax; KERNCALL; ret /* gas messes up offset -- although we don't currently need it, do for BCS */ @@ -73,13 +73,13 @@ */ #define PSYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ ENTRY(__CONCAT(_thread_sys_,x)); \ + .weak CNAME(__CONCAT(_,x)); \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(_thread_sys_,x));\ .weak CNAME(x); \ .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b #define PRSYSCALL(x) PSYSCALL(x); ret #define PPSEUDO(x,y) ENTRY(__CONCAT(_thread_sys_,x)); \ - .weak CNAME(x); \ - .set CNAME(x),CNAME(__CONCAT(_,x)); \ lea __CONCAT(SYS_,y), %eax; KERNCALL; ret #else /* |