From c14e4c326d6b916112d03994105ddd3389515954 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 26 Oct 1995 03:59:27 +0000 Subject: * hurd/hurdstartup.c (_hurd_startup): Use new exec_startup_get_info RPC from exec_startup.defs in place of old exec_startup from exec.defs. Remove kludge to guess user entry and phdr locations, since the new RPC gives us that info. * sysdeps/generic/_strerror.c: Undo last change. --- sysdeps/unix/sysv/linux/i386/brk.S | 2 +- sysdeps/unix/sysv/linux/i386/mmap.S | 3 ++- sysdeps/unix/sysv/linux/i386/sbrk.S | 4 ++-- sysdeps/unix/sysv/linux/i386/socket.S | 3 ++- sysdeps/unix/sysv/linux/i386/syscall.S | 14 +++++++------- sysdeps/unix/sysv/linux/i386/sysdep.h | 8 ++++---- sysdeps/unix/sysv/linux/i386/xmknod.S | 7 +++---- sysdeps/unix/sysv/linux/i386/xstat.S | 9 +++------ 8 files changed, 24 insertions(+), 26 deletions(-) (limited to 'sysdeps/unix/sysv/linux/i386') diff --git a/sysdeps/unix/sysv/linux/i386/brk.S b/sysdeps/unix/sysv/linux/i386/brk.S index ef2f55db97..2a9a2bcd24 100644 --- a/sysdeps/unix/sysv/linux/i386/brk.S +++ b/sysdeps/unix/sysv/linux/i386/brk.S @@ -32,8 +32,8 @@ C_LABEL(__curbrk) #endif .text -.globl C_SYMBOL_NAME(syscall_error) + SYSCALL_ERROR_HANDLER ENTRY (__brk) movl %ebx, %edx movl $SYS_ify(brk), %eax diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S index 96ea870846..1d1d628ad5 100644 --- a/sysdeps/unix/sysv/linux/i386/mmap.S +++ b/sysdeps/unix/sysv/linux/i386/mmap.S @@ -18,7 +18,8 @@ Cambridge, MA 02139, USA. */ #include -.globl syscall_error + .text + SYSCALL_ERROR_HANDLER ENTRY (__mmap) diff --git a/sysdeps/unix/sysv/linux/i386/sbrk.S b/sysdeps/unix/sysv/linux/i386/sbrk.S index 7a0e940cfe..e38e88f64d 100644 --- a/sysdeps/unix/sysv/linux/i386/sbrk.S +++ b/sysdeps/unix/sysv/linux/i386/sbrk.S @@ -22,7 +22,7 @@ Cambridge, MA 02139, USA. */ .globl C_SYMBOL_NAME(__curbrk) .text -.globl C_SYMBOL_NAME(syscall_error) + SYSCALL_ERROR_HANDLER ENTRY (__sbrk) @@ -53,7 +53,7 @@ ENTRY (__sbrk) movl C_SYMBOL_NAME(__curbrk), %ebx movl %ebx, %eax #endif - + addl 4(%esp), %ebx cmpl %ebx, %eax je .L2 diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S index 3d3a67213b..b2e6b2603f 100644 --- a/sysdeps/unix/sysv/linux/i386/socket.S +++ b/sysdeps/unix/sysv/linux/i386/socket.S @@ -22,7 +22,8 @@ Cambridge, MA 02139, USA. */ #define P(a, b) P2(a, b) #define P2(a, b) a##b -.globl syscall_error + .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. diff --git a/sysdeps/unix/sysv/linux/i386/syscall.S b/sysdeps/unix/sysv/linux/i386/syscall.S index 6e6aa5d3c8..52eb48a9ae 100644 --- a/sysdeps/unix/sysv/linux/i386/syscall.S +++ b/sysdeps/unix/sysv/linux/i386/syscall.S @@ -18,14 +18,14 @@ Cambridge, MA 02139, USA. */ #include -.globl syscall_error + .text + SYSCALL_ERROR_HANDLER /* Define error handler for PIC. */ ENTRY (syscall) - popl %ecx /* Pop return address into %ecx. */ - popl %eax /* Pop syscall number into %eax. */ - pushl %ecx /* Push back return address. */ - DO_CALL (5) /* Frob the args and do the system call. */ - movl (%esp), %ecx - pushl %ecx + PUSHARGS_5 /* Save register contents. */ + _DOARGS_5(36) /* Load arguments. */ + movl 16(%esp), %eax /* Load syscall number into %eax. */ + int $0x80 /* Do the system call. */ + POPARGS_5 /* Restore register contents. */ testl %eax, %eax /* Check %eax for error. */ jl JUMPTARGET(syscall_error) /* Jump to error handler if negative. */ ret /* Return to caller. */ diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 7bd910e534..f6da272c75 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -44,8 +44,7 @@ Cambridge, MA 02139, USA. */ .text; \ SYSCALL_ERROR_HANDLER \ ENTRY (name) \ - movl $SYS_ify (syscall_name), %eax; \ - DO_CALL (args); \ + DO_CALL (args, syscall_name); \ testl %eax, %eax; \ jl syscall_error; @@ -62,7 +61,7 @@ syscall_error: \ movl errno@GOT(%ecx), %ecx; \ movl %eax, (%ecx); \ movl $-1, %eax; \ - ret + ret; #endif /* We define our own ENTRY macro because the alignment should be 16 for @@ -119,9 +118,10 @@ syscall_error: \ i386 and i486 processors though. */ #undef DO_CALL -#define DO_CALL(args) \ +#define DO_CALL(args, syscall_name) \ PUSHARGS_##args \ DOARGS_##args \ + movl $SYS_ify (syscall_name), %eax; \ int $0x80 \ POPARGS_##args diff --git a/sysdeps/unix/sysv/linux/i386/xmknod.S b/sysdeps/unix/sysv/linux/i386/xmknod.S index fde3165d01..10778bdceb 100644 --- a/sysdeps/unix/sysv/linux/i386/xmknod.S +++ b/sysdeps/unix/sysv/linux/i386/xmknod.S @@ -19,21 +19,20 @@ Cambridge, MA 02139, USA. */ #include #include -.globl syscall_error + .text + SYSCALL_ERROR_HANDLER /* Error handler for PIC. */ ENTRY (__xmknod) popl %ecx /* Pop return address into %eax. */ popl %edx /* Pop version number into %edx. */ pushl %ecx /* Push back the return address. */ - movl $SYS_ify(mknod), %eax - /* Load syscall number for prev_stat in %eax. */ cmpl $1, %edx /* Version 1 xstat call? */ je .L1 /* Yes, do syscall. */ movl $-EINVAL, %eax /* Load error code into %eax. */ jmp .L2 -.L1: DO_CALL (3) /* Do the syscall. */ +.L1: DO_CALL (3, mknod) /* Do the syscall. */ movl (%esp), %ecx testl %eax, %eax /* Check for error. */ diff --git a/sysdeps/unix/sysv/linux/i386/xstat.S b/sysdeps/unix/sysv/linux/i386/xstat.S index 34822beda6..58c5f558c4 100644 --- a/sysdeps/unix/sysv/linux/i386/xstat.S +++ b/sysdeps/unix/sysv/linux/i386/xstat.S @@ -19,23 +19,20 @@ Cambridge, MA 02139, USA. */ #include #include -#define SYS_expand(name) SYS_ify(name) - -.globl syscall_error + .text + SYSCALL_ERROR_HANDLER /* Error handler for PIC. */ ENTRY (__xstat) popl %ecx /* Pop return address into %eax. */ popl %edx /* Pop version number into %edx. */ pushl %ecx /* Push back the return address. */ - movl $SYS_expand(stat), %eax - /* Load syscall number for prev_stat in %eax. */ cmpl $1, %edx /* Version 1 xstat call? */ je .L1 /* Yes, do syscall. */ movl $-EINVAL, %eax /* Load error code into %eax. */ jmp .L2 -.L1: DO_CALL (2) /* Do the syscall. */ +.L1: DO_CALL (2, stat) /* Do the syscall. */ movl (%esp), %ecx testl %eax, %eax /* Check for error. */ -- cgit v1.2.3