diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/clone.S | 7 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/mmap.S | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/socket.S | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/syscall.S | 5 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.S | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.h | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/clone.S | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/mmap.S | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/sigreturn.S | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/socket.S | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/syscall.S | 3 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/sysdep.S | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/m68k/sysdep.h | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/syscalls.list | 12 |
14 files changed, 44 insertions, 62 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index d213b80539..7e02f76dfe 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -66,9 +66,6 @@ ENTRY(__clone) jz thread_start ret -PSEUDO_END (__clone) - - SYSCALL_ERROR_HANDLER thread_start: subl %ebp,%ebp /* terminate the stack frame */ @@ -76,4 +73,6 @@ thread_start: pushl %eax call JUMPTARGET (_exit) -weak_alias(__clone, clone) +PSEUDO_END (__clone) + +weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S index 30b0f76a43..16029d1110 100644 --- a/sysdeps/unix/sysv/linux/i386/mmap.S +++ b/sysdeps/unix/sysv/linux/i386/mmap.S @@ -19,7 +19,6 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> .text - SYSCALL_ERROR_HANDLER ENTRY (__mmap) @@ -42,6 +41,7 @@ ENTRY (__mmap) /* Successful; return the syscall's value. */ ret - .size __mmap,.-__mmap + +PSEUDO_END (__mmap) weak_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S index 0cf4bfdf9e..78e8b03cce 100644 --- a/sysdeps/unix/sysv/linux/i386/socket.S +++ b/sysdeps/unix/sysv/linux/i386/socket.S @@ -23,8 +23,6 @@ Cambridge, MA 02139, USA. */ #define P2(a, b) a##b .text - SYSCALL_ERROR_HANDLER - /* The socket-oriented system calls are handled unusally in Linux. They are all gated through the single `socketcall' system call number. `socketcall' takes two arguments: the first is the subcode, specifying @@ -52,11 +50,12 @@ ENTRY (P(__,socket)) movl %edx, %ebx /* %eax is < 0 if there was an error. */ - testl %eax, %eax - jl syscall_error + cmpl $-125, %eax + jae syscall_error /* Successful; return the syscall's value. */ ret - .size P(__,socket),.-P(__,socket) + +PSEUDO_END (P(__,socket)) weak_alias (P(__,socket), socket) diff --git a/sysdeps/unix/sysv/linux/i386/syscall.S b/sysdeps/unix/sysv/linux/i386/syscall.S index e7839cd1c0..018a86ee39 100644 --- a/sysdeps/unix/sysv/linux/i386/syscall.S +++ b/sysdeps/unix/sysv/linux/i386/syscall.S @@ -22,8 +22,8 @@ Cambridge, MA 02139, USA. */ more information about the value -125 used below.*/ .text - SYSCALL_ERROR_HANDLER /* Define error handler for PIC. */ ENTRY (syscall) + PUSHARGS_5 /* Save register contents. */ _DOARGS_5(36) /* Load arguments. */ movl 16(%esp), %eax /* Load syscall number into %eax. */ @@ -32,4 +32,5 @@ ENTRY (syscall) cmpl $-125, %eax /* Check %eax for error. */ jae syscall_error /* Jump to error handler if error. */ ret /* Return to caller. */ - .size syscall,.-syscall + +PSEUDO_END (syscall) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.S b/sysdeps/unix/sysv/linux/i386/sysdep.S index 9727f8976f..742ba2b1a9 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.S +++ b/sysdeps/unix/sysv/linux/i386/sysdep.S @@ -67,4 +67,4 @@ ENTRY (__errno_location) movl $errno, %eax #endif ret - .size __errno_location, .-__errno_location +END (__errno_location) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index b00c976351..5d378fd179 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -28,11 +28,7 @@ Cambridge, MA 02139, USA. */ of the kernel. But these symbols do not follow the SYS_* syntax so we have to redefine the `SYS_ify' macro here. */ #undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif +#define SYS_ify(syscall_name) __NR_##syscall_name #ifdef ASSEMBLER @@ -51,19 +47,22 @@ Cambridge, MA 02139, USA. */ #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ .text; \ - SYSCALL_ERROR_HANDLER \ ENTRY (name) \ DO_CALL (args, syscall_name); \ cmpl $-125, %eax; \ jae syscall_error; +#undef PSEUDO_END +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER \ + END (name) + #ifndef PIC #define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ #else /* Store (- %eax) into errno through the GOT. */ #ifdef _LIBC_REENTRANT #define SYSCALL_ERROR_HANDLER \ - .type syscall_error,@function; \ syscall_error: \ pushl %ebx; \ call 0f; \ @@ -79,13 +78,11 @@ syscall_error: \ popl %ebx; \ movl %ecx, (%eax); \ movl $-1, %eax; \ - ret; \ - .size syscall_error,.-syscall-error; + ret; /* A quick note: it is assumed that the call to `__errno_location' does not modify the stack! */ #else #define SYSCALL_ERROR_HANDLER \ - .type syscall_error,@function; \ syscall_error: \ call 0f; \ 0:popl %ecx; \ @@ -95,8 +92,7 @@ syscall_error: \ movl errno@GOT(%ecx), %ecx; \ movl %edx, (%ecx); \ movl $-1, %eax; \ - ret; \ - .size syscall_error,.-syscall-error; + ret; #endif /* _LIBC_REENTRANT */ #endif /* PIC */ @@ -121,7 +117,7 @@ syscall_error: \ (Of course a function with say 3 arguments does not have entries for arguments 4 and 5.) - The following code tries hard to be optimal. A general assuption + The following code tries hard to be optimal. A general assumption (which is true according to the data books I have) is that 2 * xchg is more expensive than pushl + movl + popl @@ -136,7 +132,7 @@ syscall_error: \ (2 * movl is less expensive than pushl + popl). Second unlike for the other registers we don't save the content of - %ecx and %edx when we have than 1 and 2 registers resp. + %ecx and %edx when we have more than 1 and 2 registers resp. The code below might look a bit long but we have to take care for the pipelined processors (i586 and up). Here the `pushl' and `popl' diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S index 4dcd90e96c..4465dd8f68 100644 --- a/sysdeps/unix/sysv/linux/m68k/clone.S +++ b/sysdeps/unix/sysv/linux/m68k/clone.S @@ -27,7 +27,6 @@ Cambridge, MA 02139, USA. */ .text ENTRY (__clone) - CALL_MCOUNT /* Sanity check arguments. */ movel #-EINVAL, %d0 @@ -63,17 +62,12 @@ ENTRY (__clone) rts - SYSCALL_ERROR_HANDLER - thread_start: subl %fp, %fp /* terminate the stack frame */ jsr (%a0) movel %d0, -(%sp) -#ifdef PIC - bsrl _exit@PLTPC -#else - jbsr _exit -#endif + jbsr JUMPTARGET (_exit) + PSEUDO_END (__clone) weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/m68k/mmap.S b/sysdeps/unix/sysv/linux/m68k/mmap.S index 9bac533d44..257ff4da28 100644 --- a/sysdeps/unix/sysv/linux/m68k/mmap.S +++ b/sysdeps/unix/sysv/linux/m68k/mmap.S @@ -19,10 +19,7 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> .text - SYSCALL_ERROR_HANDLER - ENTRY (__mmap) - CALL_MCOUNT move.l #SYS_ify (mmap), %d0 /* System call number in %d0. */ diff --git a/sysdeps/unix/sysv/linux/m68k/sigreturn.S b/sysdeps/unix/sysv/linux/m68k/sigreturn.S index 04f0db553c..0971acd20e 100644 --- a/sysdeps/unix/sysv/linux/m68k/sigreturn.S +++ b/sysdeps/unix/sysv/linux/m68k/sigreturn.S @@ -20,12 +20,10 @@ Cambridge, MA 02139, USA. */ .text ENTRY (__sigreturn) - CALL_MCOUNT - addq.l #4, %sp /* Pop the return PC. */ DO_CALL (#SYS_ify (sigreturn), 0) /* Do the system call; it never returns. */ /* NOTREACHED */ -PSEUDO_END (__sigreturn) +END (__sigreturn) weak_alias (__sigreturn, sigreturn) diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S index 1294287cce..d0741afeb1 100644 --- a/sysdeps/unix/sysv/linux/m68k/socket.S +++ b/sysdeps/unix/sysv/linux/m68k/socket.S @@ -23,8 +23,6 @@ Cambridge, MA 02139, USA. */ #define P2(a, b) a##b .text - SYSCALL_ERROR_HANDLER - /* The socket-oriented system calls are handled unusally in Linux. They are all gated through the single `socketcall' system call number. `socketcall' takes two arguments: the first is the subcode, specifying @@ -35,7 +33,6 @@ Cambridge, MA 02139, USA. */ .globl P(__,socket) ENTRY (P(__,socket)) - CALL_MCOUNT /* Save registers. */ move.l %d2, %a0 diff --git a/sysdeps/unix/sysv/linux/m68k/syscall.S b/sysdeps/unix/sysv/linux/m68k/syscall.S index 1c7bd6bbd1..b7417aa911 100644 --- a/sysdeps/unix/sysv/linux/m68k/syscall.S +++ b/sysdeps/unix/sysv/linux/m68k/syscall.S @@ -22,10 +22,7 @@ Cambridge, MA 02139, USA. */ more information about the value -128 used below.*/ .text - SYSCALL_ERROR_HANDLER ENTRY (syscall) - CALL_MCOUNT - move.l 4(%sp), %d0 /* Load syscall number. */ _DOARGS_5 (24) /* Frob arguments. */ trap &0 /* Do the system call. */ diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S index 31fa20f55d..848ece58e8 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.S +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S @@ -46,7 +46,10 @@ __errno = errno /* This name is expected by the MT code. */ /* The syscall stubs jump here when they detect an error. */ -ENTRY (__syscall_error) + .globl __syscall_error + .type __syscall_error, @function + .align 4 +__syscall_error: neg.l %d0 move.l %d0, errno #ifdef _LIBC_REENTRANT @@ -59,15 +62,14 @@ ENTRY (__syscall_error) return a pointer. */ move.l %d0, %a0 rts -PSEUDO_END (__syscall_error) +END (__syscall_error) #endif /* PIC */ ENTRY (__errno_location) - CALL_MCOUNT #ifdef PIC move.l (%pc, errno@GOTPC), %a0 #else lea errno, %a0 #endif rts -PSEUDO_END (__errno_location) +END (__errno_location) diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 9cddd20552..3366caab45 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -41,6 +41,9 @@ Cambridge, MA 02139, USA. */ C_LABEL(name) \ CALL_MCOUNT +#undef END +#define END(name) .size name, . - name + /* If compiled for profiling, call `_mcount' at the start of each function. */ #ifdef PROF /* The mcount code relies on a normal frame pointer being on the stack @@ -76,7 +79,6 @@ Cambridge, MA 02139, USA. */ error values. */ #define PSEUDO(name, syscall_name, args) \ .text; \ - SYSCALL_ERROR_HANDLER \ ENTRY (name) \ DO_CALL (&SYS_ify (syscall_name), args); \ moveq.l &-128, %d1; \ @@ -84,13 +86,14 @@ Cambridge, MA 02139, USA. */ jcc syscall_error #undef PSEUDO_END -#define PSEUDO_END(name) .size name, . - name +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER; \ + END (name) #ifdef PIC /* Store (- %d0) into errno through the GOT. */ #ifdef _LIBC_REENTRANT #define SYSCALL_ERROR_HANDLER \ - .type syscall_error, @function; \ syscall_error: \ move.l (errno@GOTPC, %pc), %a0; \ neg.l %d0; \ @@ -105,7 +108,6 @@ syscall_error: \ rts; #else #define SYSCALL_ERROR_HANDLER \ - .type syscall_error, @function; \ syscall_error: \ move.l (errno@GOTPC, %pc), %a0; \ neg.l %d0; \ diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index d6165608a1..129951a6dd 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -13,7 +13,7 @@ geteuid - geteuid 0 __geteuid geteuid getpgid - getpgid 1 __getpgid getpgid getpgrp - getpgrp 0 getpgrp getppid - getppid 0 __getppid getppid -getresuid - getresuid 3 getresuid +getresuid EXTRA getresuid 3 getresuid getsid - getsid 1 getsid init_module EXTRA init_module 5 init_module ioperm - ioperm 3 ioperm @@ -35,22 +35,22 @@ s_getpriority getpriority getpriority 2 __syscall_getpriority s_ptrace ptrace ptrace 4 __syscall_ptrace s_reboot EXTRA reboot 3 __syscall_reboot s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend -sched_setp - sched_setparam 2 __sched_setparam sched_setparam +s_sysctl sysctl _sysctl 1 __syscall__sysctl sched_getp - sched_getparam 2 __sched_getparam sched_getparam -sched_sets - sched_setscheduler 3 __sched_setscheduler sched_setscheduler sched_gets - sched_getscheduler 1 __sched_getscheduler sched_getscheduler -sched_yield - sched_yield 0 __sched_yield sched_yield sched_primax - sched_get_priority_max 1 __sched_get_priority_max sched_get_priority_max sched_primin - sched_get_priority_min 1 __sched_get_priority_min sched_get_priority_min sched_rr_gi - sched_rr_get_interval 2 __sched_rr_get_interval sched_rr_get_interval +sched_setp - sched_setparam 2 __sched_setparam sched_setparam +sched_sets - sched_setscheduler 3 __sched_setscheduler sched_setscheduler +sched_yield - sched_yield 0 __sched_yield sched_yield select - _newselect 5 __select select setfsgid EXTRA setfsgid 1 setfsgid setfsuid EXTRA setfsuid 1 setfsuid setpgid - setpgid 2 __setpgid setpgid -setresuid - setresuid 3 setresuid +setresuid EXTRA setresuid 3 setresuid sigpending - sigpending 1 sigpending sigprocmask - sigprocmask 3 __sigprocmask sigprocmask -s_sysctl sysctl _sysctl 1 __syscall__sysctl sysinfo EXTRA sysinfo 1 sysinfo swapon - swapon 2 swapon umount EXTRA umount 1 __umount umount |