From 5bfed16d69f287251f95d8ec35ec16068b453224 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 5 Nov 2002 19:58:06 +0000 Subject: Update. 2002-11-05 Franz Sirl * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Handle __NR_pread64 and __NR_pwrite64. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/pread.c: Remove __NR_pread64 and __NR_pwrite64. Revert change to use INLINE_SYSCALL. * sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/ftruncate64.c: Revert change to use INLINE_SYSCALL. * sysdeps/unix/sysv/linux/powerpc/truncate64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INLINE_SYSCALL): Update clobber list and add a comment about the syscall ABI. --- sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index c0f04f1ddd..9389d5ca12 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -21,6 +21,24 @@ #include +/* Some systen calls got renamed over time, but retained the same semantics. + Handle them here so they can be catched by both C and assembler stubs in + glibc. */ + +#ifdef __NR_pread64 +# ifdef __NR_pread +# error "__NR_pread and __NR_pread64 both defined???" +# endif +# define __NR_pread __NR_pread64 +#endif + +#ifdef __NR_pwrite64 +# ifdef __NR_pwrite +# error "__NR_pwrite and __NR_pwrite64 both defined???" +# endif +# define __NR_pwrite __NR_pwrite64 +#endif + /* For Linux we can use the system call table in the header file /usr/include/asm/unistd.h of the kernel. But these symbols do not follow the SYS_* syntax @@ -36,6 +54,11 @@ # include +/* On powerpc a system call basically clobbers the same registers like a + function call, with the exception of LR (which is needed for the + "sc; bnslr" sequence) and CR (where only CR0.SO is clobbered to signal + an error return status). */ + # undef INLINE_SYSCALL # define INLINE_SYSCALL(name, nr, args...) \ ({ \ @@ -59,7 +82,7 @@ "=&r" (r3), "=&r" (r4), "=&r" (r5), "=&r" (r6), "=&r" (r7), \ "=&r" (r8), "=&r" (r9), "=&r" (r10), "=&r" (r11), "=&r" (r12) \ : ASM_INPUT_##nr \ - : "cc", "memory"); \ + : "cr0", "ctr", "memory"); \ err = r0; \ ret = r3; \ if (err & (1 << 28)) \ -- cgit 1.4.1