public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sh/lowlevellock.h tidyup
@ 2006-01-20 11:50 Kaz Kojima
  2006-01-20 16:50 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Kaz Kojima @ 2006-01-20 11:50 UTC (permalink / raw)
  To: libc-hacker

Hi,

The attached is a tidyup patch for SH which is very same with
the recent change for x86.

Regards,
	kaz
--
[nptl/ChangeLog]

2006-01-20  Kaz Kojima  <kkojima@rr.iij4u.or.jp>

	* sysdeps/unix/sysv/linux/sh/lowlevellock.h (lll_futex_wait):
	Return status.
	(lll_futex_timed_wait): Define.

--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h	2004-06-04 00:29:17.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h	2006-01-19 09:47:46.000000000 +0900
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -181,19 +181,37 @@ typedef int lll_lock_t;
 # endif
 
 #define lll_futex_wait(futex, val) \
-  do {									      \
-    int __ignore;							      \
+  ({									      \
+    int __status;							      \
     register unsigned long __r3 asm ("r3") = SYS_futex;			      \
     register unsigned long __r4 asm ("r4") = (unsigned long) (futex);	      \
     register unsigned long __r5 asm ("r5") = FUTEX_WAIT;		      \
     register unsigned long __r6 asm ("r6") = (unsigned long) (val);	      \
     register unsigned long __r7 asm ("r7") = 0;				      \
     __asm __volatile (SYSCALL_WITH_INST_PAD				      \
-		      : "=z" (__ignore)					      \
+		      : "=z" (__status)					      \
 		      : "r" (__r3), "r" (__r4), "r" (__r5),		      \
 			"r" (__r6), "r" (__r7)				      \
 		      : "memory", "t");					      \
-  } while (0)
+    __status;								      \
+  })
+
+
+#define lll_futex_timed_wait(futex, val, timeout) \
+  ({									      \
+    int __status;							      \
+    register unsigned long __r3 asm ("r3") = SYS_futex;			      \
+    register unsigned long __r4 asm ("r4") = (unsigned long) (futex);	      \
+    register unsigned long __r5 asm ("r5") = FUTEX_WAIT;		      \
+    register unsigned long __r6 asm ("r6") = (unsigned long) (val);	      \
+    register unsigned long __r7 asm ("r7") = (timeout);			      \
+    __asm __volatile (SYSCALL_WITH_INST_PAD				      \
+		      : "=z" (__status)					      \
+		      : "r" (__r3), "r" (__r4), "r" (__r5),		      \
+			"r" (__r6), "r" (__r7)				      \
+		      : "memory", "t");					      \
+    __status;								      \
+  })
 
 
 #define lll_futex_wake(futex, nr) \

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sh/lowlevellock.h tidyup
  2006-01-20 11:50 [PATCH] sh/lowlevellock.h tidyup Kaz Kojima
@ 2006-01-20 16:50 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2006-01-20 16:50 UTC (permalink / raw)
  To: Kaz Kojima; +Cc: libc-hacker

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-20 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-20 11:50 [PATCH] sh/lowlevellock.h tidyup Kaz Kojima
2006-01-20 16:50 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).