[PATCH] IA64 syscalls in lowlevellock.h

Ian Wienand <[email protected]>
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
Hello,

NPTL 0.29 gives constant warnings about trying to compare unsigned
with signed.  This is due to the registers in the syscall asm in
lowlevellock.h being declared as unsigned long int.  I think they
should be just longs.

-i
[email protected]
http://www.gelato.unsw.edu.au
syscall.diff (text/plain, 5.4 KB)
diff -ru ../libc-cvs-orig/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h ./nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
--- ../libc-cvs-orig/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h	2003-03-11 20:20:41.000000000 +1100
+++ ./nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h	2003-03-13 11:34:43.000000000 +1100
@@ -46,63 +46,63 @@
   "b6", "b7",								      \
   "memory"
 
-#define lll_futex_wait(futex, val) \
-  ({									      \
-     register unsigned long int __o0 asm ("out0")			      \
-       = (unsigned long int) (futex);					      \
-     register unsigned long int __o1 asm ("out1") = FUTEX_WAIT;		      \
-     register unsigned long int __o2 asm ("out2") = (unsigned long int) (val);\
-     register unsigned long int __o3 asm ("out3") = 0ul;		      \
-     register unsigned long int __r8 asm ("r8");			      \
-     register unsigned long int __r10 asm ("r10");			      \
-     register unsigned long int __r15 asm ("r15") = SYS_futex;		      \
-									      \
-     __asm __volatile ("break %3;;"					      \
-		       : "=r" (__r8), "=r" (__r10), "=r" (__r15)	      \
-		       : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1), \
-		 	"r" (__o2), "r" (__o3)				      \
-		       : lll_futex_clobbers);				      \
-     __r10 == -1 ? -__r8 : __r8;					      \
+#define lll_futex_wait(futex, val)						\
+  ({										\
+     register long int __o0 asm ("out0")					\
+       = (long int) (futex);							\
+     register long int __o1 asm ("out1") = FUTEX_WAIT;				\
+     register long int __o2 asm ("out2") = (long int) (val);			\
+     register long int __o3 asm ("out3") = 0ul;					\
+     register long int __r8 asm ("r8");						\
+     register long int __r10 asm ("r10");					\
+     register long int __r15 asm ("r15") = SYS_futex;				\
+										\
+     __asm __volatile ("break %3;;"						\
+		       : "=r" (__r8), "=r" (__r10), "=r" (__r15)		\
+		       : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1),	\
+		 	"r" (__o2), "r" (__o3)					\
+		       : lll_futex_clobbers);					\
+     __r10 == -1 ? -__r8 : __r8;						\
   })
 
 
-#define lll_futex_timed_wait(futex, val, timespec) \
-  ({									      \
-     register unsigned long int __o0 asm ("out0")			      \
-       = (unsigned long int) (futex);					      \
-     register unsigned long int __o1 asm ("out1") = FUTEX_WAIT;		      \
-     register unsigned long int __o2 asm ("out2") = (unsigned long int) (val);\
-     register unsigned long int __o3 asm ("out3")			      \
-       = (unsigned long int) (timespec);				      \
-     register unsigned long int __r8 asm ("r8");			      \
-     register unsigned long int __r10 asm ("r10");			      \
-     register unsigned long int __r15 asm ("r15") = SYS_futex;		      \
-									      \
-     __asm __volatile ("break %3;;"					      \
-		       : "=r" (__r8), "=r" (__r10), "=r" (__r15)	      \
-		       : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1), \
-			 "r" (__o2), "r" (__o3)				      \
-		       : lll_futex_clobbers);				      \
-     __r10 == -1 ? -__r8 : __r8;					      \
+#define lll_futex_timed_wait(futex, val, timespec)				\
+  ({										\
+     register long int __o0 asm ("out0")					\
+       = (long int) (futex);							\
+     register long int __o1 asm ("out1") = FUTEX_WAIT;				\
+     register long int __o2 asm ("out2") = (long int) (val);			\
+     register long int __o3 asm ("out3")					\
+       = (long int) (timespec);							\
+     register long int __r8 asm ("r8");						\
+     register long int __r10 asm ("r10");					\
+     register long int __r15 asm ("r15") = SYS_futex;				\
+										\
+     __asm __volatile ("break %3;;"						\
+		       : "=r" (__r8), "=r" (__r10), "=r" (__r15)		\
+		       : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1),	\
+			 "r" (__o2), "r" (__o3)					\
+		       : lll_futex_clobbers);					\
+     __r10 == -1 ? -__r8 : __r8;						\
   })
 
 
-#define lll_futex_wake(futex, nr) \
-  ({									      \
-     register unsigned long int __o0 asm ("out0")			      \
-       = (unsigned long int) (futex);					      \
-     register unsigned long int __o1 asm ("out1") = FUTEX_WAKE;		      \
-     register unsigned long int __o2 asm ("out2") = (unsigned long int) (nr); \
-     register unsigned long int __r8 asm ("r8");			      \
-     register unsigned long int __r10 asm ("r10");			      \
-     register unsigned long int __r15 asm ("r15") = SYS_futex;		      \
-									      \
-     __asm __volatile ("break %3;;"					      \
-		       : "=r" (__r8), "=r" (__r10), "=r" (__r15)	      \
-		       : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1), \
-			 "r" (__o2)					      \
-		       : "out3", lll_futex_clobbers);			      \
-     __r10 == -1 ? -__r8 : __r8;					      \
+#define lll_futex_wake(futex, nr)						\
+  ({										\
+     register long int __o0 asm ("out0")					\
+       = (long int) (futex);							\
+     register long int __o1 asm ("out1") = FUTEX_WAKE;				\
+     register long int __o2 asm ("out2") = (long int) (nr);			\
+     register long int __r8 asm ("r8");						\
+     register long int __r10 asm ("r10");					\
+     register long int __r15 asm ("r15") = SYS_futex;				\
+										\
+     __asm __volatile ("break %3;;"						\
+		       : "=r" (__r8), "=r" (__r10), "=r" (__r15)		\
+		       : "i" (0x100000), "2" (__r15), "r" (__o0), "r" (__o1),	\
+			 "r" (__o2)						\
+		       : "out3", lll_futex_clobbers);				\
+     __r10 == -1 ? -__r8 : __r8;						\
   })
 
 #define lll_compare_and_swap(futex, oldval, newval) \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.