[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]


I have adapted my ppc32 port of NPTL to the changes in nptl-0.29.  It
all looks good and works properly - I now have it running and passing
all of the tests on ppc32 (using a gcc patch from Alan Modra plus a
couple of changes to the ppc32-specific parts of glibc).

I have just a couple of minor changes I have made to the NPTL core:

- Why does allocate_stack set stacktop = (char *) (pd - 1) in the
  TLS_DTV_AT_TP case?  I don't see any reason why the stack shouldn't
  start immediately below the pthread struct.  I am using stacktop =
  (char *) pd here and that works fine.

- The test in _pthread_cleanup_push:

    if (buffer->__prev != NULL && FRAME_LEFT (buffer, buffer->__prev))
      buffer->__prev = NULL;

  looks bogus to me and causes tst-cleanup1 to fail on ppc32.  The
  thing is that the 3 cleanup buffers allocated in tf() in
  tst-cleanup1.c are declared in the same routine and gcc can allocate
  them at whatever positions in the stack frame that it likes.  In my
  case the innermost buffer gets allocated at the highest address and
  so _pthread_cleanup_push throws away the other 2.  I am using the
  patch below, and with this it works.

I think the ppc32 port is ready to go in (and a copyright assignment
for me has been signed and sent to RMS).  The patch is available at

Alan's gcc patch against the gcc-3_3-branch of gcc cvs is available in
It is still a bit experimental though.


diff -urN nptl-0.29/nptl/cleanup.c libc/nptl/cleanup.c
--- nptl-0.29/nptl/cleanup.c	2003-01-05 19:39:29.000000000 +1100
+++ libc/nptl/cleanup.c	2003-03-12 15:30:03.000000000 +1100
@@ -33,7 +33,8 @@
   buffer->__arg = arg;
   buffer->__prev = THREAD_GETMEM (self, cleanup);
-  if (buffer->__prev != NULL && FRAME_LEFT (buffer, buffer->__prev))
+  if (buffer->__prev != NULL
+      && FRAME_LEFT (CURRENT_STACK_FRAME, buffer->__prev))
     buffer->__prev = NULL;
   THREAD_SETMEM (self, cleanup, buffer);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]