diff options
-rw-r--r-- | lib/libc/arch/sparc/SYS.h | 35 | ||||
-rw-r--r-- | lib/libc/arch/sparc/sys/cerror.S | 14 |
2 files changed, 18 insertions, 31 deletions
diff --git a/lib/libc/arch/sparc/SYS.h b/lib/libc/arch/sparc/SYS.h index e8cb5290e09..f4ae3822957 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.11 2002/02/19 22:12:37 millert Exp $ + * $OpenBSD: SYS.h,v 1.12 2002/08/11 23:01:30 art Exp $ */ #include <machine/asm.h> @@ -43,23 +43,25 @@ #ifdef __STDC__ #define _CAT(x,y) x##y -#define __ENTRY(p,x) ENTRY(p##x) #else #define _CAT(x,y) x/**/y -#define __ENTRY(p,x) ENTRY(p/**/x) #endif +#define __ENTRY(p,x) ENTRY(_CAT(p,x)) ; .weak x ; x = _CAT(p,x) + /* - * ERROR branches to cerror. This is done with a macro so that I can - * change it to be position independent later, if need be. + * ERROR branches to cerror. */ #ifdef PIC #define ERROR() \ PIC_PROLOGUE(%g1,%g2); \ - ld [%g1+cerror],%g2; jmp %g2; nop + ld [%g1+_C_LABEL(__cerror)],%g2; jmp %g2; nop #else #define ERROR() \ - sethi %hi(cerror),%g1; or %lo(cerror),%g1,%g1; jmp %g1; nop + sethi %hi(_C_LABEL(__cerror)),%g1; \ + or %lo(_C_LABEL(__cerror)),%g1,%g1; \ + jmp %g1; \ + nop #endif /* @@ -93,25 +95,10 @@ __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 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 PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y) -# define SYSENTRY(x) __ENTRY(,x) -#endif /* _THREAD_SAFE */ - .globl cerror + + .globl _C_LABEL(__cerror) diff --git a/lib/libc/arch/sparc/sys/cerror.S b/lib/libc/arch/sparc/sys/cerror.S index a37e229e5ca..9795e5a5787 100644 --- a/lib/libc/arch/sparc/sys/cerror.S +++ b/lib/libc/arch/sparc/sys/cerror.S @@ -37,24 +37,24 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: cerror.S,v 1.2 1996/08/19 08:18:02 tholo Exp $" + .asciz "$OpenBSD: cerror.S,v 1.3 2002/08/11 23:01:30 art Exp $" #endif /* SYSLIBC_SCCS */ #include "DEFS.h" #include "SYS.h" - .globl _errno + .globl _C_LABEL(errno) #ifdef PIC -FUNC(cerror) - ld [%g1 + _errno], %g1 +FUNC(_C_LABEL(__cerror)) + ld [%g1 + _C_LABEL(errno)], %g1 st %o0, [%g1] mov -1, %o0 retl mov -1, %o1 #else -FUNC(cerror) - sethi %hi(_errno), %g1 - st %o0, [%g1 + %lo(_errno)] +FUNC(_C_LABEL(__cerror)) + sethi %hi(_C_LABEL(errno)), %g1 + st %o0, [%g1 + %lo(_C_LABEL(errno))] mov -1, %o0 retl mov -1, %o1 |