diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/sparc')
5 files changed, 39 insertions, 17 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h index 9bbe6bcdab..384c5c219b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/init-first.h @@ -76,12 +76,12 @@ cmp %g2, 0 beq 3f sethi %hi(__libc_multiple_libcs), %g3 - ld [%g4+%g2], %g2 + ld [%g2], %g2 subcc %g0, %g2, %g0 subx %g0, -1, %g2 3: or %g3, %lo(__libc_multiple_libcs), %g3 cmp %g2, 0 - st %g2, [%g3+%g4] + st %g2, [%g3] /* If so, argc et al are in %o0-%o2 already. Otherwise, load them. */ bnz " #INIT " nop diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S index bdfc2fcc6d..4c65ac7f3c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/socket.S @@ -23,6 +23,13 @@ #define P(a, b) P2(a, b) #define P2(a, b) a##b +#ifndef NARGS +#ifdef socket +#error NARGS not defined +#endif +#define NARGS 3 +#endif + .text /* The socket-oriented system calls are handled unusually in Linux. They are all gated through the single `socketcall' system call number. @@ -34,25 +41,36 @@ .globl P(__,socket) ENTRY (P(__,socket)) - mov SYS_ify(socketcall), %g1 /* System call number */ - /* Use ## so `socket' is a separate token that might be #define'd. */ - mov P(SOCKOP_,socket), %o0 /* Subcode is first arg to syscall. */ - mov %i0,%o1 /* args pointer is second arg to syscall */ + /* Drop up to 6 arguments (recvfrom) into the memory allocated by + the caller for varargs, since that's really what we have. */ + st %o0, [%sp + 68 + 0] + st %o1, [%sp + 68 + 4] +#if NARGS > 2 + st %o2, [%sp + 68 + 8] +#if NARGS > 3 + st %o3, [%sp + 68 + 12] +#if NARGS > 4 + st %o4, [%sp + 68 + 16] +#if NARGS > 5 + st %o5, [%sp + 68 + 20] +#endif +#endif +#endif +#endif + mov P(SOCKOP_,socket), %o0 /* arg 1: socket subfunction */ + add %sp, 68, %o1 /* arg 2: parameter block */ + LOADSYSCALL(socketcall) t 0x10 - bcc,a 1 - nop - save %sp,96,%sp - call __errno_location - nop - st %i0,[%o0] - restore + + bcs,a 1f + nop retl - mov -1,%o0 -1: - ret + nop + +1: SYSCALL_ERROR_HANDLER -PSEUDO_END (P(__,socket)) +END (P(__,socket)) weak_alias (P(__,socket), socket) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c new file mode 100644 index 0000000000..b7f298dea8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pread64.c @@ -0,0 +1 @@ +/* Empty since the pread syscall is equivalent. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c new file mode 100644 index 0000000000..b7f298dea8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/pwrite64.c @@ -0,0 +1 @@ +/* Empty since the pread syscall is equivalent. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index e5425e9a29..d0bee8fa07 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -2,6 +2,8 @@ # Whee! 64-bit systems naturally implement llseek. llseek EXTRA lseek 3 llseek +pread EXTRA pread 4 __pread pread __pread64 pread64 +pwrite EXTRA pwrite 4 __pwrite pwrite __pwrite64 pwrite64 # Override select.S in parent directory: select - select 5 __select select |