2010-02-11  Aurelien Jarno  <aurelien@aurel32.net>

	* ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:
	remove useless <sysdep.h> include. Move <tls.h> include to...
	* ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c: here.

---
 ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c |    1 
 ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h |   20 ++++++++---------
 2 files changed, 11 insertions(+), 10 deletions(-)

--- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
+++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.c
@@ -21,6 +21,7 @@
 #include <sysdep.h>
 #include <lowlevellock.h>
 #include <sys/time.h>
+#include <tls.h>		/* Need THREAD_*, and header.*.  */
 
 void
 __lll_lock_wait (lll_lock_t *futex, int private)
--- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
+++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h
@@ -21,10 +21,8 @@
 #include <time.h>
 #include <sys/param.h>
 #include <bits/pthreadtypes.h>
-#include <sysdep.h>
 #include <atomic.h>
 #include <kernel-features.h>	/* Need __ASSUME_PRIVATE_FUTEX.  */
-#include <tls.h>		/* Need THREAD_*, and header.*.  */
 
 /* HPPA only has one atomic read and modify memory operation,
    load and clear, so hppa uses a kernel helper routine to implement
@@ -289,18 +287,20 @@
   __lll_robust_timedlock (&(futex), abstime, id, private)
 
 #define __lll_unlock(futex, private) \
-  (void)					\
-  ({ int val = atomic_exchange_rel (futex, 0);  \
-     if (__builtin_expect (val > 1, 0))         \
-       lll_futex_wake (futex, 1, private);      \
+  (void)						\
+  ({ int *__futex = (futex);				\
+     int val = atomic_exchange_rel (__futex, 0);	\
+     if (__builtin_expect (val > 1, 0))			\
+       lll_futex_wake (__futex, 1, private);		\
   })
 #define lll_unlock(futex, private) __lll_unlock(&(futex), private)
 
 #define  __lll_robust_unlock(futex,private) \
-  (void)                                               \
-    ({ int val = atomic_exchange_rel (futex, 0);       \
-       if (__builtin_expect (val & FUTEX_WAITERS, 0))  \
-         lll_futex_wake (futex, 1, private);           \
+  (void)						\
+    ({ int *__futex = (futex);				\
+       int val = atomic_exchange_rel (__futex, 0);	\
+       if (__builtin_expect (val & FUTEX_WAITERS, 0))	\
+         lll_futex_wake (__futex, 1, private);		\
     })
 #define lll_robust_unlock(futex, private) \
   __lll_robust_unlock(&(futex), private)
