]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
authorRoland McGrath <roland@gnu.org>
Mon, 17 Mar 2003 11:25:18 +0000 (11:25 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 17 Mar 2003 11:25:18 +0000 (11:25 +0000)
* sysdeps/pthread/pthread_spin_init.c: New file.
* sysdeps/pthread/pthread_spin_unlock.c: New file.
* sysdeps/powerpc/Makefile: New file.
* sysdeps/powerpc/pthread_spin_lock.c: New file.
* sysdeps/powerpc/pthread_spin_trylock.c: New file.
* sysdeps/powerpc/pthreaddef.h: New file.
* sysdeps/powerpc/tcb-offsets.sym: New file.
* sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
* sysdeps/powerpc/tls.h: New file.
* sysdeps/powerpc/bits/atomic.h: New file.
* sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/lowlevellock.c: New file.
* sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
* sysdeps/unix/sysv/linux/sem_post.c: New file.
* sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
* sysdeps/unix/sysv/linux/sem_trywait.c: New file.
* sysdeps/unix/sysv/linux/sem_wait.c: New file.
* sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
* sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
* sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
* sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
* sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
* sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.

* sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
not gettimeofday.
* sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
* sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
* sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.

nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.c
nptl/sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c
nptl/sysdeps/unix/sysv/linux/ia64/sem_timedwait.c
nptl/sysdeps/unix/sysv/linux/lowlevelmutex.c [new file with mode: 0644]
nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.c
nptl/sysdeps/unix/sysv/linux/s390/lowlevelmutex.c
nptl/sysdeps/unix/sysv/linux/s390/sem_timedwait.c
nptl/sysdeps/unix/sysv/linux/sem_wait.c [new file with mode: 0644]

index 03c461222abe0a1610fc65118872c779207a6aff..7954468e417596e05006925a782b9b9fc8597053 100644 (file)
@@ -1,3 +1,43 @@
+2003-03-17  Roland McGrath  <roland@redhat.com>
+
+       PowerPC port contributed by Paul Mackerras <paulus@samba.org>.
+       * sysdeps/pthread/pthread_spin_init.c: New file.
+       * sysdeps/pthread/pthread_spin_unlock.c: New file.
+       * sysdeps/powerpc/Makefile: New file.
+       * sysdeps/powerpc/pthread_spin_lock.c: New file.
+       * sysdeps/powerpc/pthread_spin_trylock.c: New file.
+       * sysdeps/powerpc/pthreaddef.h: New file.
+       * sysdeps/powerpc/tcb-offsets.sym: New file.
+       * sysdeps/powerpc/td_ta_map_lwp2thr.c: New file.
+       * sysdeps/powerpc/tls.h: New file.
+       * sysdeps/powerpc/bits/atomic.h: New file.
+       * sysdeps/unix/sysv/linux/libc-lowlevelmutex.c: New file.
+       * sysdeps/unix/sysv/linux/libc-lowlevellock.c: New file.
+       * sysdeps/unix/sysv/linux/lowlevellock.c: New file.
+       * sysdeps/unix/sysv/linux/lowlevelmutex.c: New file.
+       * sysdeps/unix/sysv/linux/sem_post.c: New file.
+       * sysdeps/unix/sysv/linux/sem_timedwait.c: New file.
+       * sysdeps/unix/sysv/linux/sem_trywait.c: New file.
+       * sysdeps/unix/sysv/linux/sem_wait.c: New file.
+       * sysdeps/unix/sysv/linux/powerpc/Makefile: New file.
+       * sysdeps/unix/sysv/linux/powerpc/createthread.c: New file.
+       * sysdeps/unix/sysv/linux/powerpc/fork.c: New file.
+       * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/pt-vfork.S: New file.
+       * sysdeps/unix/sysv/linux/powerpc/pthread_once.c: New file.
+       * sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/bits/semaphore.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: New file.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: New file.
+
+       * sysdeps/unix/sysv/linux/ia64/lowlevellock.c: Use __gettimeofday,
+       not gettimeofday.
+       * sysdeps/unix/sysv/linux/ia64/lowlevelmutex.c: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/sem_timedwait.c: Likewise.
+       * sysdeps/unix/sysv/linux/s390/lowlevellock.c: Likewise.
+       * sysdeps/unix/sysv/linux/s390/lowlevelmutex.c: Likewise.
+       * sysdeps/unix/sysv/linux/s390/sem_timedwait.c: Likewise.
+
 2003-03-17  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/pthread/pthread_cond_wait.c: Correct exit criteria.
index 651fb88598f6112bc3d6f2ff4db7425d335d5cd8..1a1a2e1b23f6c7cf67c2e3f12124736975695aba 100644 (file)
@@ -29,7 +29,7 @@ lll_unlock_wake_cb (futex)
 {
   int oldval;
   int val = *futex;
-    
+
   do
     oldval = val;
   while ((val = lll_compare_and_swap (futex, oldval, 0)) != oldval);
@@ -55,7 +55,7 @@ ___lll_timedwait_tid (ptid, abstime)
     {
       /* Get current time.  */
       struct timeval tv;
-      gettimeofday (&tv, NULL);
+      __gettimeofday (&tv, NULL);
 
       /* Determine relative timeout.  */
       struct timespec rt;
index 7ab67ca56c9908facb52770fe0a1c271d5033d4a..bf6f5f384684031a6c540e33afeeb41079c0ddbe 100644 (file)
@@ -62,7 +62,7 @@ ___lll_mutex_timedlock (futex, abstime, newval)
     {
       /* Get the current time.  */
       struct timeval tv;
-      gettimeofday (&tv, NULL);
+      __gettimeofday (&tv, NULL);
 
       /* Compute relative timeout.  */
       struct timespec rt;
index b271217c41d5588ae82427f4282273f35cc7fb1a..881e6e20f781d175c2a7df695553e7506a67ba4d 100644 (file)
@@ -47,7 +47,7 @@ sem_timedwait (sem, abstime)
 
          /* Get the current time.  */
          struct timeval tv;
-         (void) gettimeofday(&tv, NULL);
+         (void) __gettimeofday(&tv, NULL);
 
          /* Compute the relative timeout.  */
          struct timespec rt;
diff --git a/nptl/sysdeps/unix/sysv/linux/lowlevelmutex.c b/nptl/sysdeps/unix/sysv/linux/lowlevelmutex.c
new file mode 100644 (file)
index 0000000..7c594e3
--- /dev/null
@@ -0,0 +1 @@
+/* Nothing needed here in fact.  */
index f98e163ae132efcbb58324c48d3530d21cc69810..60c39d01b5e91e8cdb681ed7f91e2722bbe49736 100644 (file)
@@ -72,7 +72,7 @@ ___lll_timedwait_tid (ptid, abstime)
     {
       /* Get current time.  */
       struct timeval tv;
-      gettimeofday (&tv, NULL);
+      __gettimeofday (&tv, NULL);
 
       /* Determine relative timeout.  */
       struct timespec rt;
index 3f1889bc77d81602be7aa9256d0188050b2bb2bc..d4d91db5ce96dc1cfa7d089179b5bbb584ff2129 100644 (file)
@@ -56,7 +56,7 @@ ___lll_mutex_timedlock (futex, abstime, newval)
     {
       /* Get the current time.  */
       struct timeval tv;
-      gettimeofday (&tv, NULL);
+      __gettimeofday (&tv, NULL);
 
       /* Compute relative timeout.  */
       struct timespec rt;
index d2ef2ceb30114130534caaca8ef6ff902e7e67ad..42433dec74a29478a7080231e5b89d447553c268 100644 (file)
@@ -51,7 +51,7 @@ sem_timedwait (sem, abstime)
 
       /* Get the current time.  */
       struct timeval tv;
-      (void) gettimeofday (&tv, NULL);
+      (void) __gettimeofday (&tv, NULL);
 
       /* Compute the relative timeout.  */
       struct timespec rt;
diff --git a/nptl/sysdeps/unix/sysv/linux/sem_wait.c b/nptl/sysdeps/unix/sysv/linux/sem_wait.c
new file mode 100644 (file)
index 0000000..0e50067
--- /dev/null
@@ -0,0 +1,58 @@
+/* sem_wait -- wait on a semaphore.  Generic futex-using version.
+   Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <sysdep.h>
+#include <lowlevellock.h>
+#include <internaltypes.h>
+#include <semaphore.h>
+
+#include <shlib-compat.h>
+
+
+int
+__new_sem_wait (sem_t *sem)
+{
+  int *futex = (int *) sem;
+  int val;
+  int err;
+
+  do
+    {
+      if (*futex > 0)
+       {
+         val = __lll_dec_if_positive (futex);
+         if (val > 0)
+           return 0;
+       }
+
+      err = lll_futex_wait (futex, 0);
+    }
+  while (err == 0 || err == -EWOULDBLOCK);
+
+  __set_errno (-err);
+  return -1;
+}
+
+versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1);
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1)
+strong_alias (__new_sem_wait, __old_sem_wait)
+compat_symbol (libpthread, __old_sem_wait, sem_wait, GLIBC_2_0);
+#endif