From 98f7320f0780d3238f8196c6f03c0cf256e7d6fb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 23 Mar 2003 19:42:23 +0000 Subject: [PATCH] Define PSEUDO_NOERRNO, PSEUDO_END_NOERRNO, and ret_NOERRNO. --- sysdeps/unix/alpha/sysdep.h | 19 +++++++++++++++++-- sysdeps/unix/sysv/linux/arm/sysdep.h | 16 ++++++++++++++++ sysdeps/unix/sysv/linux/cris/sysdep.h | 14 +++++++++++++- sysdeps/unix/sysv/linux/hppa/sysdep.h | 15 ++++++++++++++- sysdeps/unix/sysv/linux/m68k/sysdep.h | 10 ++++++++++ 5 files changed, 70 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h index cb04cec2af5..6e550615158 100644 --- a/sysdeps/unix/alpha/sysdep.h +++ b/sysdeps/unix/alpha/sysdep.h @@ -119,6 +119,21 @@ $syscall_error: \ END(sym) #endif +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .globl name; \ + .align 4; \ + .ent name,0; \ +__LABEL(name) \ + PSEUDO_PROLOGUE; \ + PSEUDO_PREPARE_ARGS \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(sym) END(sym) + +#define ret_NOERRNO ret + #define r0 v0 #define r1 a4 @@ -167,8 +182,8 @@ $syscall_error: \ /* If TLS is in use, we have a conflict between the PAL_rduniq primitive, as modeled within GCC, and explicit use of the R0 register. If we use the register via the asm, the scheduler may place the PAL_rduniq insn - before we've copied the data from R0 into _sc_ret. If this happens - we'll get a reload abort, since R0 is live at the same time it is + before we've copied the data from R0 into _sc_ret. If this happens + we'll get a reload abort, since R0 is live at the same time it is needed for the PAL_rduniq. Solve this by using the "v" constraint instead of an asm for the syscall diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h index 785d3cf0d87..3e3c874e043 100644 --- a/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -64,6 +64,22 @@ SYSCALL_ERROR_HANDLER \ END (name) +#undef PSEUDO_NOERRNO +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .text; \ + ENTRY (name); \ + DO_CALL (syscall_name, args); + +#define PSEUDO_RET_NOERRNO \ + RETINSTR(movcc, pc, lr); \ + nop +#undef ret_NOERRNO +#define ret_NOERRNO PSEUDO_RET_NOERRNO + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + #if NOT_IN_libc # define SYSCALL_ERROR __local_syscall_error # define SYSCALL_ERROR_HANDLER \ diff --git a/sysdeps/unix/sysv/linux/cris/sysdep.h b/sysdeps/unix/sysv/linux/cris/sysdep.h index 4446b26f50f..f22a3d24e8c 100644 --- a/sysdeps/unix/sysv/linux/cris/sysdep.h +++ b/sysdeps/unix/sysv/linux/cris/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for CRIS. - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -106,6 +106,18 @@ PLTJUMP (syscall_error) @ \ END (name) +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + ENTRY (name) @ \ + DOARGS_##args @ \ + movu.w SYS_ify (syscall_name),$r9 @ \ + break 13 @ \ + UNDOARGS_return_##args + +#define ret_NOERRNO + +#define PSEUDO_END_NOERRNO(name) \ + END (name) + #define DOARGS_0 #define DOARGS_1 #define DOARGS_2 diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h index 4f08cc6e395..771c55c400f 100644 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.h +++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for PA-RISC. - Copyright (C) 1999,2001,02 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, , August 1999. Linux/PA-RISC changes by Philipp Rumpf, , March 2000. @@ -84,6 +84,10 @@ bv 0(2) ASM_LINE_SEP \ nop +#define ret_NOERRNO \ + bv 0(2) ASM_LINE_SEP \ + nop + #undef END #define END(name) \ 1: .size C_SYMBOL_NAME(name),1b-C_SYMBOL_NAME(name) @@ -115,6 +119,15 @@ #define PSEUDO_END(name) \ END (name) +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + ENTRY (name) \ + DO_CALL(syscall_name, args) ASM_LINE_SEP \ + nop + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + #define JUMPTARGET(name) name #define SYSCALL_PIC_SETUP /* Nothing. */ diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 125c584eb48..23e4202e8b9 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -68,6 +68,16 @@ SYSCALL_ERROR_HANDLER; \ END (name) +#undef PSEUDO_NOERRNO +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .text; \ + ENTRY (name) \ + DO_CALL (syscall_name, args) + +#undef PSEUDO_END_NOERRNO +#define PSEUDO_END_NOERRNO(name) \ + END (name) + #ifdef PIC # if RTLD_PRIVATE_ERRNO # define SYSCALL_ERROR_HANDLER \ -- 2.47.2