This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] Fix ppc32
On Sat, Jan 04, 2003 at 10:01:16PM +0100, Franz Sirl wrote:
> On Saturday 04 January 2003 21:33, Jakub Jelinek wrote:
> > On Sat, Jan 04, 2003 at 05:06:01PM +0100, Franz Sirl wrote:
> > > * linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h:
> > > New file.
> >
> > Thanks for working on this.
>
> I'm forced to, if I want to keep my system uptodate :-). Any idea about the
> AIO problem?
Actually, I have - broken pread* and pwrite*.
The following patch (on top of the LIBC_CANCEL_HANDLED patch) should fix it.
__syscall_pread/__syscall_pwrite uses r3,r4,r5,r7,r8 regs to pass arguments,
so syscalls.list needs to indicate that.
Alternatively, you could do LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET in
sysdeps/unix/sysv/linux/powerpc/p{read,write}{,64}.c.
Also, sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S needs cancellation
support.
2003-01-06 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list
(s_pread64, s_pwrite64): Add 6th argument.
* sysdeps/unix/sysv/linux/powerpc/pread.c: Include sysdep-cancel.h,
add LIBC_CANCEL_HANDLED.
* sysdeps/unix/sysv/linux/powerpc/pread64.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/powerpc/pwrite64.c: Likewise.
linuxthreads/
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
(DOCARGS_6, UNDOCARGS_6): Define.
--- libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h.jj 2003-01-05 11:54:19.000000000 +0100
+++ libc/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h 2003-01-06 15:18:28.000000000 +0100
@@ -71,6 +71,9 @@
# define DOCARGS_5 stw 7,36(1); DOCARGS_4
# define UNDOCARGS_5 lwz 7,36(1); UNDOCARGS_4
+# define DOCARGS_6 stw 8,40(1); DOCARGS_5
+# define UNDOCARGS_6 lwz 8,40(1); UNDOCARGS_5
+
# ifdef IS_IN_libpthread
# define CENABLE bl JUMPTARGET(__pthread_enable_asynccancel)
# define CDISABLE bl JUMPTARGET(__pthread_disable_asynccancel)
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list.jj 2003-01-05 22:08:50.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list 2003-01-06 16:49:14.000000000 +0100
@@ -12,6 +12,6 @@ oldsetrlimit EXTRA setrlimit i:ip __old_
# System calls with 64bit args
s_ftruncate64 ftruncate64 ftruncate64 i:iii __syscall_ftruncate64
-s_pread64 pread64 pread Ci:ibnii __syscall_pread
-s_pwrite64 pwrite64 pwrite Ci:ibnii __syscall_pwrite
+s_pread64 pread64 pread Ci:ibniii __syscall_pread
+s_pwrite64 pwrite64 pwrite Ci:ibniii __syscall_pwrite
s_truncate64 truncate64 truncate64 i:sii __syscall_truncate64
--- libc/sysdeps/unix/sysv/linux/powerpc/pread.c.jj 2002-11-05 23:10:47.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/pread.c 2003-01-06 16:47:03.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <unistd.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
@@ -54,6 +54,9 @@ __libc_pread (fd, buf, count, offset)
strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread)
+/* __syscall_pread is cancellable. */
+LIBC_CANCEL_HANDLED ();
+
#define __libc_pread(fd, buf, count, offset) \
static internal_function __emulate_pread (fd, buf, count, offset)
#endif
--- libc/sysdeps/unix/sysv/linux/powerpc/pread64.c.jj 2002-11-05 23:10:47.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/pread64.c 2003-01-06 16:47:35.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <unistd.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
@@ -54,6 +54,9 @@ __libc_pread64 (fd, buf, count, offset)
weak_alias (__libc_pread64, __pread64)
weak_alias (__libc_pread64, pread64)
+/* __syscall_pread is cancellable. */
+LIBC_CANCEL_HANDLED ();
+
#define __libc_pread64(fd, buf, count, offset) \
static internal_function __emulate_pread64 (fd, buf, count, offset)
#endif
--- libc/sysdeps/unix/sysv/linux/powerpc/pwrite.c.jj 2002-11-05 23:10:47.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/pwrite.c 2003-01-06 16:48:11.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <unistd.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
@@ -54,6 +54,9 @@ __libc_pwrite (fd, buf, count, offset)
strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite)
+/* __syscall_pwrite is cancellable. */
+LIBC_CANCEL_HANDLED ();
+
#define __libc_pwrite(fd, buf, count, offset) \
static internal_function __emulate_pwrite (fd, buf, count, offset)
#endif
--- libc/sysdeps/unix/sysv/linux/powerpc/pwrite64.c.jj 2002-11-05 23:10:47.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/pwrite64.c 2003-01-06 16:48:48.000000000 +0100
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <unistd.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
#include <sys/syscall.h>
#include <bp-checks.h>
@@ -55,6 +55,9 @@ weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_def (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64)
+/* __syscall_pwrite is cancellable. */
+LIBC_CANCEL_HANDLED ();
+
#define __libc_pwrite64(fd, buf, count, offset) \
static internal_function __emulate_pwrite64 (fd, buf, count, offset)
#endif
Jakub