diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2007-07-04 23:18:38 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2007-07-04 23:18:38 +0000 |
| commit | eabc04d47247e9cd43fd5efe6a8061830fd3b06e (patch) | |
| tree | 974e0aa76f3ee9dad506c3e179d7fc5cb80d58e7 /lib/libc | |
| parent | 79d5bdcca56c2af5a283e608e763a540c4f9e57a (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/amd64/SYS.h | 11 | ||||
| -rw-r--r-- | lib/libc/arm/SYS.h | 21 | ||||
| -rw-r--r-- | lib/libc/i386/SYS.h | 5 | ||||
| -rw-r--r-- | lib/libc/ia64/SYS.h | 14 | ||||
| -rw-r--r-- | lib/libc/sparc64/SYS.h | 3 |
5 files changed, 20 insertions, 34 deletions
diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h index 20811a06aa05..ef75377de236 100644 --- a/lib/libc/amd64/SYS.h +++ b/lib/libc/amd64/SYS.h @@ -44,6 +44,12 @@ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx + +#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ + .weak CNAME(__CONCAT(_,x)); \ + .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret ; \ + 2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx #else #define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(x); \ @@ -52,11 +58,12 @@ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ 2: jmp HIDENAME(cerror) -#endif #define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%rax; KERNCALL; ret + mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \ + 2: jmp HIDENAME(cerror) +#endif #define KERNCALL movq %rcx, %r10; syscall diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h index 47108762efb0..223c26b5f740 100644 --- a/lib/libc/arm/SYS.h +++ b/lib/libc/arm/SYS.h @@ -56,26 +56,19 @@ _SYSCALL_NOERROR(x); \ bcs PIC_SYM(CERROR, PLT) -#define SYSCALL_NOERROR(x) \ - _SYSCALL_NOERROR(x) - #define SYSCALL(x) \ _SYSCALL(x) - -#define PSEUDO_NOERROR(x) \ - _SYSCALL_NOERROR(x); \ - RET - #define PSEUDO(x) \ - _SYSCALL(x); \ + ENTRY(__CONCAT(__sys_, x)); \ + .weak _C_LABEL(__CONCAT(_,x)); \ + .set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x)); \ + SYSTRAP(x) + bcs PIC_SYM(CERROR, PLT) RET - -#define RSYSCALL_NOERROR(x) \ - PSEUDO_NOERROR(x) - #define RSYSCALL(x) \ - PSEUDO(x) + _SYSCALL(x); \ + RET .globl CERROR diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h index 6b79e3c209a4..2f8a29340a2e 100644 --- a/lib/libc/i386/SYS.h +++ b/lib/libc/i386/SYS.h @@ -46,10 +46,11 @@ #define RSYSCALL(x) SYSCALL(x); ret -#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \ +#define PSEUDO(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \ + ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - mov __CONCAT($SYS_,x),%eax; KERNCALL; ret + mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b; ret /* gas messes up offset -- although we don't currently need it, do for BCS */ #define LCALL(x,y) .byte 0x9a ; .long y; .word x diff --git a/lib/libc/ia64/SYS.h b/lib/libc/ia64/SYS.h index 64d50d2a18a6..eb019a26bc3b 100644 --- a/lib/libc/ia64/SYS.h +++ b/lib/libc/ia64/SYS.h @@ -50,28 +50,14 @@ ENTRY(__sys_ ## name,0); /* XXX # of args? */ \ WEAK_ALIAS(_ ## name, __sys_ ## name); \ CALLSYS_NOERROR(name) - #define RSYSCALL(name) \ SYSCALL(name); \ br.ret.sptk.few rp; \ END(__sys_ ## name) -#define RSYSCALL_NOERROR(name) \ - SYSCALL_NOERROR(name); \ - br.ret.sptk.few rp; \ -END(__sys_ ## name) - - #define PSEUDO(name) \ ENTRY(__sys_ ## name,0); /* XXX # of args? */ \ WEAK_ALIAS(_ ## name, __sys_ ## name); \ CALLSYS_ERROR(name); \ br.ret.sptk.few rp; \ END(__sys_ ## name); - -#define PSEUDO_NOERROR(name) \ -ENTRY(__sys_ ## name,0); /* XXX # of args? */ \ - WEAK_ALIAS(_ ## name, __sys_ ## name); \ - CALLSYS_NOERROR(name); \ - br.ret.sptk.few rp; \ -END(__sys_ ## name); diff --git a/lib/libc/sparc64/SYS.h b/lib/libc/sparc64/SYS.h index f98a8d482258..0bc7840d9452 100644 --- a/lib/libc/sparc64/SYS.h +++ b/lib/libc/sparc64/SYS.h @@ -78,8 +78,7 @@ ENTRY(__CONCAT(__sys_,x)) ; \ .weak CNAME(__CONCAT(_,x)) ; \ .type CNAME(__CONCAT(_,x)),@function ; \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)) ; \ - mov __CONCAT(SYS_,x), %g1 ; \ - ta %xcc, ST_SYSCALL ; \ + _SYSCALL(x) ; \ retl ; \ nop ; \ .size CNAME(__CONCAT(__sys_,x)), . - CNAME(__CONCAT(__sys_,x)) ; \ |
