diff options
Diffstat (limited to 'lib/libc/arch')
-rw-r--r-- | lib/libc/arch/alpha/SYS.h | 10 | ||||
-rw-r--r-- | lib/libc/arch/hppa/SYS.h | 29 | ||||
-rw-r--r-- | lib/libc/arch/i386/SYS.h | 33 | ||||
-rw-r--r-- | lib/libc/arch/m68k/SYS.h | 47 | ||||
-rw-r--r-- | lib/libc/arch/m88k/SYS.h | 20 | ||||
-rw-r--r-- | lib/libc/arch/mips/SYS.h | 14 | ||||
-rw-r--r-- | lib/libc/arch/mvme88k/SYS.h | 20 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/SYS.h | 9 | ||||
-rw-r--r-- | lib/libc/arch/sparc/SYS.h | 27 | ||||
-rw-r--r-- | lib/libc/arch/vax/SYS.h | 29 |
10 files changed, 160 insertions, 78 deletions
diff --git a/lib/libc/arch/alpha/SYS.h b/lib/libc/arch/alpha/SYS.h index 05718176b17..98565c16963 100644 --- a/lib/libc/arch/alpha/SYS.h +++ b/lib/libc/arch/alpha/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.6 2001/06/13 11:44:25 art Exp $ */ +/* $OpenBSD: SYS.h,v 1.7 2001/09/20 20:52:09 millert Exp $ */ /* $NetBSD: SYS.h,v 1.4 1996/10/17 03:03:53 cgd Exp $ */ /* @@ -68,6 +68,12 @@ __END(p,name) #define __PSEUDO(p,label,name) \ __LEAF(p,label,0); /* XXX # of args? */ \ + CALLSYS_ERROR(name); \ + RET; \ +__END(p,label); + +#define __PSEUDO_NOERROR(p,label,name) \ +__LEAF(p,label,0); /* XXX # of args? */ \ CALLSYS_NOERROR(name); \ RET; \ __END(p,label); @@ -83,6 +89,7 @@ __END(p,label); # define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) # define RSYSCALL_NOERROR(x) __RSYSCALL_NOERROR(_thread_sys_,x) # define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) # define SYSLEAF(x,e) __LEAF(_thread_sys_,x,e) # define SYSEND(x) __END(_thread_sys_,x) #else /* _THREAD_SAFE */ @@ -95,6 +102,7 @@ __END(p,label); # define RSYSCALL(x) __RSYSCALL(,x) # define RSYSCALL_NOERROR(x) __RSYSCALL_NOERROR(,x) # define PSEUDO(x,y) __PSEUDO(,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) # define SYSLEAF(x,e) __LEAF(,x,e) # define SYSEND(x) __END(,x) #endif /* _THREAD_SAFE */ diff --git a/lib/libc/arch/hppa/SYS.h b/lib/libc/arch/hppa/SYS.h index a1fa5f561b6..6ae5d4cf977 100644 --- a/lib/libc/arch/hppa/SYS.h +++ b/lib/libc/arch/hppa/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.8 2001/08/12 12:03:01 heko Exp $ */ +/* $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $ */ /* * Copyright (c) 1998-1999 Michael Shalayeff @@ -70,6 +70,14 @@ __ENTRY(p,x) !\ nop !\ __EXIT(p,x) +/* XXX - actually sets errnor */ +#define __PSEUDO_NOERROR(p,x,y) !\ +__ENTRY(p,x) !\ + __SYSCALL(p,y) !\ + bv r0(rp) !\ + nop !\ +__EXIT(p,x) + /* * Design note: * @@ -83,18 +91,19 @@ __EXIT(p,x) * For the thread_safe versions, we prepend _thread_sys_ to the function * name so that the 'C' wrapper can go around the real name. */ -# define SYSCALL(x) __SYSCALL(_thread_sys_,x) -# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) -# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) -/*# define SYSENTRY(x) __ENTRY(_thread_sys_,x)*/ +# define SYSCALL(x) __SYSCALL(_thread_sys_,x) +# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) +# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) +/*# define SYSENTRY(x) __ENTRY(_thread_sys_,x)*/ #else /* _THREAD_SAFE */ /* * The non-threaded library defaults to traditional syscalls where * the function name matches the syscall name. */ -# define SYSCALL(x) __SYSCALL(,x) -# define RSYSCALL(x) __RSYSCALL(,x) -# define PSEUDO(x,y) __PSEUDO(,x,y) -/*# define SYSENTRY(x) __ENTRY(,x)*/ +# define SYSCALL(x) __SYSCALL(,x) +# define RSYSCALL(x) __RSYSCALL(,x) +# define PSEUDO(x,y) __PSEUDO(,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) +/*# define SYSENTRY(x) __ENTRY(,x)*/ #endif /* _THREAD_SAFE */ - diff --git a/lib/libc/arch/i386/SYS.h b/lib/libc/arch/i386/SYS.h index 02933b17645..a4d0fe9d6aa 100644 --- a/lib/libc/arch/i386/SYS.h +++ b/lib/libc/arch/i386/SYS.h @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.8 2000/01/06 10:49:20 d Exp $ + * $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $ */ #include <machine/asm.h> @@ -88,25 +88,38 @@ int $0x80 #endif /* ! __STDC__ */ +/* perform a syscall */ +#define _SYSCALL_NOERROR(x,y) \ + SYSENTRY(x); \ + __DO_SYSCALL(y); + +#define SYSCALL_NOERROR(x) \ + _SYSCALL_NOERROR(x,x) + /* perform a syscall, set errno */ -#define SYSCALL(x) \ +#define _SYSCALL(x,y) \ .text; \ .align 2; \ 2: \ jmp PIC_PLT(cerror); \ - SYSENTRY(x); \ - __DO_SYSCALL(x); \ + _SYSCALL_NOERROR(x,y) \ jc 2b -/* perform a syscall, set errno, return */ -#define RSYSCALL(x) \ - SYSCALL(x); \ - ret +#define SYSCALL(x) \ + _SYSCALL(x,x) /* perform a syscall, return */ +#define PSEUDO_NOERROR(x,y) \ + _SYSCALL_NOERROR(x,y); \ + ret + +/* perform a syscall, set errno, return */ #define PSEUDO(x,y) \ - SYSENTRY(x); \ - __DO_SYSCALL(y); \ + _SYSCALL(x,y); \ ret +/* perform a syscall with the same name, set errno, return */ +#define RSYSCALL(x) \ + PSEUDO(x,x); + .globl cerror diff --git a/lib/libc/arch/m68k/SYS.h b/lib/libc/arch/m68k/SYS.h index 948eded4197..18cdd31a33e 100644 --- a/lib/libc/arch/m68k/SYS.h +++ b/lib/libc/arch/m68k/SYS.h @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.5 2001/08/12 12:03:01 heko Exp $ + * $OpenBSD: SYS.h,v 1.6 2001/09/20 20:52:09 millert Exp $ */ #include <sys/syscall.h> @@ -56,44 +56,57 @@ # define __LABEL2(p,x) _C_LABEL(p/**/x) #endif +/* perform a syscall */ + +#define __SYSCALL_NOERROR(p,x,y) \ + __ENTRY(p,x); \ + __DO_SYSCALL(y) + /* perform a syscall, set errno */ -#define __SYSCALL(p,x) \ +#define __SYSCALL(p,x,y) \ .even; \ err: jra cerror; \ - __ENTRY(p,x); \ - __DO_SYSCALL(x); \ + __SYSCALL_NOERROR(p,x,y); \ jcs err -/* perform a syscall, set errno, return */ +/* perform a syscall, return */ -#define __RSYSCALL(p,x) __SYSCALL(p,x); rts +#define __PSEUDO_NOERROR(p,x,y) \ + __SYSCALL_NOERROR(p,x,y); \ + rts -/* perform a syscall, return */ +/* perform a syscall, set errno, return */ #define __PSEUDO(p,x,y) \ - __ENTRY(p,x); \ - __DO_SYSCALL(y); \ + __SYSCALL(p,x,y); \ rts +/* perform a syscall, set errno, return */ + +#define __RSYSCALL(p,x) __PSEUDO(p,x,x) + + #ifdef _THREAD_SAFE /* * For the thread_safe versions, we prepend _thread_sys_ to the function * name so that the 'C' wrapper can go around the real name. */ -# define SYSCALL(x) __SYSCALL(_thread_sys_,x) -# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) -# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) -# define SYSENTRY(x) __ENTRY(_thread_sys_,x) +# define SYSCALL(x) __SYSCALL(_thread_sys_,x) +# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) +# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) +# define SYSENTRY(x) __ENTRY(_thread_sys_,x) #else /* _THREAD_SAFE */ /* * The non-threaded library defaults to traditional syscalls where * the function name matches the syscall name. */ -# define SYSCALL(x) __SYSCALL(,x) -# define RSYSCALL(x) __RSYSCALL(,x) -# define PSEUDO(x,y) __PSEUDO(,x,y) -# define SYSENTRY(x) __ENTRY(,x) +# define SYSCALL(x) __SYSCALL(,x) +# define RSYSCALL(x) __RSYSCALL(,x) +# define PSEUDO(x,y) __PSEUDO(,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) +# define SYSENTRY(x) __ENTRY(,x) #endif /* _THREAD_SAFE */ #define ASMSTR .asciz diff --git a/lib/libc/arch/m88k/SYS.h b/lib/libc/arch/m88k/SYS.h index 1d98598dae4..7dbbe09d978 100644 --- a/lib/libc/arch/m88k/SYS.h +++ b/lib/libc/arch/m88k/SYS.h @@ -1,4 +1,4 @@ -/* * $OpenBSD: SYS.h,v 1.2 2000/03/01 17:31:20 todd Exp $*/ +/* * $OpenBSD: SYS.h,v 1.3 2001/09/20 20:52:09 millert Exp $*/ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -43,33 +43,39 @@ #ifdef __STDC__ -#define SYSCALL(x) align 8; \ +#define _SYSCALL(x,y) align 8; \ ENTRY(x); \ ld r10,r31,32; \ ld r11,r31,36; \ ld r12,r31,40; \ - or r13,r0, SYS_ ## x; \ + or r13,r0, SYS_ ## y; \ tb0 0, r0, 128; \ br cerror +#define SYSCALL(x) _SYSCALL(x,x) #define RSYSCALL(x) SYSCALL(x) ;\ jmp r1 -#define PSEUDO(x,y) ENTRY(x); ;\ +#define PSEUDO(x,y) _SYSCALL(x,y); \ + jmp r1 +#define PSEUDO_NOERROR(x,y) ENTRY(x); ;\ or r13,r0, SYS_ ## y; \ tb0 0,r0,128; or r0,r0,r0;jmp r1 #else /* !__STDC__ */ -#define SYSCALL(x) align 8; \ +#define _SYSCALL(x,y) align 8; \ ENTRY(x); \ ld r10,r31,32; \ ld r11,r31,36; \ ld r12,r31,40; \ - or r13,r0, SYS_/**/x; \ + or r13,r0, SYS_/**/y; \ tb0 0, r0, 128; \ br cerror +#define SYSCALL(x) _SYSCALL(x,x) #define RSYSCALL(x) SYSCALL(x); \ jmp r1 -#define PSEUDO(x,y) ENTRY(x); \ +#define PSEUDO(x,y) _SYSCALL(x,y); \ + jmp r1 +#define PSEUDO_NOERROR(x,y) ENTRY(x); \ or r13,r0, SYS_/**/y; \ tb0 0,r0,128; or r0,r0,r0; jmp r1 #endif /* !__STDC__ */ diff --git a/lib/libc/arch/mips/SYS.h b/lib/libc/arch/mips/SYS.h index f8a57c29cb8..89ff3f8e1b0 100644 --- a/lib/libc/arch/mips/SYS.h +++ b/lib/libc/arch/mips/SYS.h @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.6 2001/08/12 12:03:01 heko Exp $ + * $OpenBSD: SYS.h,v 1.7 2001/09/20 20:52:09 millert Exp $ */ #include <sys/syscall.h> @@ -57,13 +57,19 @@ # define __CLABEL2(p,x) _C_LABEL(p/**/x) #endif +#define __PSEUDO_NOERROR(p,x,y) \ + __LEAF2(p,x); \ + __DO_SYSCALL(y); \ + j ra; \ + __END2(p,x) + #define __PSEUDO(p,x,y) \ __LEAF2(p,x); \ __DO_SYSCALL(y); \ - bne a3,zero,err; \ - j ra; \ + bne a3,zero,err; \ + j ra; \ err: la t9,_C_LABEL(cerror); \ - jr t9; \ + jr t9; \ __END2(p,x) #define __RSYSCALL(p,x) __PSEUDO(p,x,x) diff --git a/lib/libc/arch/mvme88k/SYS.h b/lib/libc/arch/mvme88k/SYS.h index 6c69a17d911..29f81db8f31 100644 --- a/lib/libc/arch/mvme88k/SYS.h +++ b/lib/libc/arch/mvme88k/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.2 2000/03/01 17:31:22 todd Exp $ */ +/* $OpenBSD: SYS.h,v 1.3 2001/09/20 20:52:10 millert Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -43,33 +43,39 @@ #ifdef __STDC__ -#define SYSCALL(x) align 8; \ +#define _SYSCALL(x,y) align 8; \ ENTRY(x); \ ld r10,r31,32; \ ld r11,r31,36; \ ld r12,r31,40; \ - or r13,r0, SYS_ ## x; \ + or r13,r0, SYS_ ## y; \ tb0 0, r0, 128; \ br cerror +#define SYSCALL(x) _SYSCALL(x,x) #define RSYSCALL(x) SYSCALL(x) ;\ jmp r1 -#define PSEUDO(x,y) ENTRY(x); ;\ +#define PSEUDO(x,y) _SYSCALL(x,y); \ + jmp r1 +#define PSEUDO_NOERROR(x,y) ENTRY(x); ;\ or r13,r0, SYS_ ## y; \ tb0 0,r0,128; or r0,r0,r0;jmp r1 #else /* !__STDC__ */ -#define SYSCALL(x) align 8; \ +#define _SYSCALL(x,y) align 8; \ ENTRY(x); \ ld r10,r31,32; \ ld r11,r31,36; \ ld r12,r31,40; \ - or r13,r0, SYS_/**/x; \ + or r13,r0, SYS_/**/y; \ tb0 0, r0, 128; \ br cerror +#define SYSCALL(x) _SYSCALL(x,x) #define RSYSCALL(x) SYSCALL(x); \ jmp r1 -#define PSEUDO(x,y) ENTRY(x); \ +#define PSEUDO(x,y) _SYSCALL(x,y); \ + jmp r1 +#define PSEUDO_NOERROR(x,y) ENTRY(x); \ or r13,r0, SYS_/**/y; \ tb0 0,r0,128; or r0,r0,r0; jmp r1 #endif /* !__STDC__ */ diff --git a/lib/libc/arch/powerpc/SYS.h b/lib/libc/arch/powerpc/SYS.h index 80ee82483ee..82df53efe55 100644 --- a/lib/libc/arch/powerpc/SYS.h +++ b/lib/libc/arch/powerpc/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.8 2000/10/06 23:29:15 d Exp $ */ +/* $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:10 millert Exp $ */ /*- * Copyright (c) 1994 * Andrew Cagney. All rights reserved. @@ -70,10 +70,15 @@ PSEUDO_PREFIX(_thread_sys_,x,x) #define PREFIX2(x,y) ALIAS(_thread_sys_,x) \ PSEUDO_PREFIX(_thread_sys_,x,y) +/* XXX - actually sets errno */ +#define PSEUDO_NOERROR(x,y) ALIAS(_thread_sys_,x) \ + PSEUDO_PREFIX(_thread_sys_,x,y) ; \ + sc ; \ + PSEUDO_SUFFIX + #define PSEUDO(x,y) ALIAS(_thread_sys_,x) \ PSEUDO_PREFIX(_thread_sys_,x,y) ; \ sc ; \ PSEUDO_SUFFIX #define RSYSCALL(x) PSEUDO(x,x) - diff --git a/lib/libc/arch/sparc/SYS.h b/lib/libc/arch/sparc/SYS.h index 3f6fe17100f..cfaefa3805c 100644 --- a/lib/libc/arch/sparc/SYS.h +++ b/lib/libc/arch/sparc/SYS.h @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.8 2001/08/12 12:03:01 heko Exp $ + * $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:10 millert Exp $ */ #include <machine/asm.h> @@ -86,23 +86,32 @@ __ENTRY(p,x); mov (_CAT(SYS_,y))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \ t ST_SYSCALL; ERROR() +/* + * PSEUDO_NOERROR(x,y) is like PSEUDO(x,y) except that errno is not set. + */ +#define __PSEUDO_NOERROR(p,x,y) \ + __ENTRY(p,x); mov (_CAT(SYS_,y))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \ + t ST_SYSCALL + #ifdef _THREAD_SAFE /* * For the thread_safe versions, we prepend _thread_sys_ to the function * name so that the 'C' wrapper can go around the real name. */ -# define SYSCALL(x) __SYSCALL(_thread_sys_,x) -# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) -# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) -# define SYSENTRY(x) __ENTRY(_thread_sys_,x) +# define SYSCALL(x) __SYSCALL(_thread_sys_,x) +# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x) +# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) +# define SYSENTRY(x) __ENTRY(_thread_sys_,x) #else /* _THREAD_SAFE */ /* * The non-threaded library defaults to traditional syscalls where * the function name matches the syscall name. */ -# define SYSCALL(x) __SYSCALL(,x) -# define RSYSCALL(x) __RSYSCALL(,x) -# define PSEUDO(x,y) __PSEUDO(,x,y) -# define SYSENTRY(x) __ENTRY(,x) +# define SYSCALL(x) __SYSCALL(,x) +# define RSYSCALL(x) __RSYSCALL(,x) +# define PSEUDO(x,y) __PSEUDO(,x,y) +# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) +# define SYSENTRY(x) __ENTRY(,x) #endif /* _THREAD_SAFE */ .globl cerror diff --git a/lib/libc/arch/vax/SYS.h b/lib/libc/arch/vax/SYS.h index 27fbc42d8a4..ace50176650 100644 --- a/lib/libc/arch/vax/SYS.h +++ b/lib/libc/arch/vax/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.5 2001/08/23 21:58:37 miod Exp $ */ +/* $OpenBSD: SYS.h,v 1.6 2001/09/20 20:52:10 millert Exp $ */ /* $NetBSD: SYS.h,v 1.4 1997/05/02 18:15:32 kleink Exp $ */ /* @@ -60,26 +60,33 @@ jcs err; \ ret +#define __PSEUDO_NOERROR(p,x,y) \ + __ENTRY(p,x); \ + __DO_SYSCALL(y); \ + ret + #ifdef _THREAD_SAFE /* * For the thread_safe versions, we prepend _thread_sys_ to the function * name so that the 'C' wrapper can go around the real name. */ -#define SYSCALL(x) __SYSCALL(_thread_sys_,x,x) -#define RSYSCALL(x) __PSEUDO(_thread_sys_,x,x) -#define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) -#define SYSENTRY(x) __ENTRY(_thread_sys_,x) -#define SYSNAME(x) _CAT(__thread_sys_,x) +#define SYSCALL(x) __SYSCALL(_thread_sys_,x,x) +#define RSYSCALL(x) __PSEUDO(_thread_sys_,x,x) +#define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y) +#define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y) +#define SYSENTRY(x) __ENTRY(_thread_sys_,x) +#define SYSNAME(x) _CAT(__thread_sys_,x) #else _THREAD_SAFE /* * The non-threaded library defaults to traditional syscalls where * the function name matches the syscall name. */ -#define SYSCALL(x) __SYSCALL(,x,x) -#define RSYSCALL(x) __PSEUDO(,x,x) -#define PSEUDO(x,y) __PSEUDO(,x,y) -#define SYSENTRY(x) __ENTRY(,x) -#define SYSNAME(x) _CAT(_,x) +#define SYSCALL(x) __SYSCALL(,x,x) +#define RSYSCALL(x) __PSEUDO(,x,x) +#define PSEUDO(x,y) __PSEUDO(,x,y) +#define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) +#define SYSENTRY(x) __ENTRY(,x) +#define SYSNAME(x) _CAT(_,x) #endif _THREAD_SAFE .globl cerror |