This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH siddhesh/wait_bitset] Use FUTEX_WAIT_BITSET forpthread_cond_timedwait for non-x86: ppc, s390
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, libc-alpha at sourceware dot org
- Date: Mon, 5 Nov 2012 16:04:17 +0530
- Subject: Re: [PATCH siddhesh/wait_bitset] Use FUTEX_WAIT_BITSET forpthread_cond_timedwait for non-x86: ppc, s390
- References: <20121022182330.4f774b71@spoyarek><20121024000039.5492B2C061@topped-with-meat.com><20121026154911.11670185@spoyarek><508ACE76.3030908@redhat.com><20121027082117.78c86bff@spoyarek><50942BDF.2030605@redhat.com>
On Fri, 02 Nov 2012 14:23:59 -0600, Jeff wrote:
> However, if it was in the INTERNAL_SYSCALL form I'd be a lot more
> comfortable approving it since I don't know s390 assembly :-)
> However, it shouldn't be to terrible to have the INTERNAL_SYSCALL
> definition handy and verify your code is doing the same thing.
>
I have verified that the result of using INTERNAL_SYSCALL is the same
as my assembly using the following (temporary) patch on top of my
changes.
Siddhesh
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index 0b7110f..b77026b 100644
--- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -93,6 +93,7 @@
__result; \
})
+#if 0
#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
({ \
register unsigned long int __r2 asm ("2") = (unsigned long int) (futexp); \
@@ -112,7 +113,21 @@
: "cc", "memory" ); \
__result; \
})
+#else
+#define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private) \
+ ({ \
+ INTERNAL_SYSCALL_DECL (__err); \
+ long int __ret; \
+ int __op = FUTEX_WAIT_BITSET | clockbit; \
+ \
+ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
+ __lll_private_flag (__op, private), \
+ (val), (timespec), NULL /* Unused. */, \
+ FUTEX_BITSET_MATCH_ANY); \
+ __ret; \
+ })
+#endif
#define lll_futex_wake(futex, nr, private) \
({ \