public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/fw/rseq] nptl: Introduce THREAD_GETMEM_VOLATILE
@ 2021-12-09  8:50 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2021-12-09  8:50 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8d1927d8dc5aad0f01c929123086be3a5b799d18

commit 8d1927d8dc5aad0f01c929123086be3a5b799d18
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Dec 9 09:49:32 2021 +0100

    nptl: Introduce THREAD_GETMEM_VOLATILE
    
    This will be needed for rseq TCB access.
    
    Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>

Diff:
---
 sysdeps/i386/nptl/tcb-access.h   | 2 ++
 sysdeps/nptl/tcb-access.h        | 2 ++
 sysdeps/x86_64/nptl/tcb-access.h | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/sysdeps/i386/nptl/tcb-access.h b/sysdeps/i386/nptl/tcb-access.h
index 6c6d561e39..5ddd83224b 100644
--- a/sysdeps/i386/nptl/tcb-access.h
+++ b/sysdeps/i386/nptl/tcb-access.h
@@ -41,6 +41,8 @@
        }								      \
      __value; })
 
+/* THREAD_GETMEM already forces a read.  */
+#define THREAD_GETMEM_VOLATILE(descr, member) THREAD_GETMEM (descr, member)
 
 /* Same as THREAD_GETMEM, but the member offset can be non-constant.  */
 #define THREAD_GETMEM_NC(descr, member, idx) \
diff --git a/sysdeps/nptl/tcb-access.h b/sysdeps/nptl/tcb-access.h
index b4137b8ab8..bbe20b7225 100644
--- a/sysdeps/nptl/tcb-access.h
+++ b/sysdeps/nptl/tcb-access.h
@@ -22,6 +22,8 @@
 
 #define THREAD_GETMEM(descr, member) \
   descr->member
+#define THREAD_GETMEM_VOLATILE(descr, member) \
+  (*(volatile __typeof (descr->member) *)&descr->member)
 #define THREAD_GETMEM_NC(descr, member, idx) \
   descr->member[idx]
 #define THREAD_SETMEM(descr, member, value) \
diff --git a/sysdeps/x86_64/nptl/tcb-access.h b/sysdeps/x86_64/nptl/tcb-access.h
index 18848a729d..e4d2d07a9b 100644
--- a/sysdeps/x86_64/nptl/tcb-access.h
+++ b/sysdeps/x86_64/nptl/tcb-access.h
@@ -39,6 +39,8 @@
        }								      \
      __value; })
 
+/* THREAD_GETMEM already forces a read.  */
+#define THREAD_GETMEM_VOLATILE(descr, member) THREAD_GETMEM (descr, member)
 
 /* Same as THREAD_GETMEM, but the member offset can be non-constant.  */
 # define THREAD_GETMEM_NC(descr, member, idx) \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-09  8:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09  8:50 [glibc/fw/rseq] nptl: Introduce THREAD_GETMEM_VOLATILE Florian Weimer

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).