diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-12-09 09:49:32 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-12-09 09:49:32 +0100 |
commit | 8d1927d8dc5aad0f01c929123086be3a5b799d18 (patch) | |
tree | 29aead65fea69f988ce19f391b5a61c3f1829a1d | |
parent | ce2248ab91b2ea09a378f85012f251f31ac65e31 (diff) | |
download | glibc-8d1927d8dc5aad0f01c929123086be3a5b799d18.zip glibc-8d1927d8dc5aad0f01c929123086be3a5b799d18.tar.gz glibc-8d1927d8dc5aad0f01c929123086be3a5b799d18.tar.bz2 |
nptl: Introduce THREAD_GETMEM_VOLATILE
This will be needed for rseq TCB access.
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
-rw-r--r-- | sysdeps/i386/nptl/tcb-access.h | 2 | ||||
-rw-r--r-- | sysdeps/nptl/tcb-access.h | 2 | ||||
-rw-r--r-- | sysdeps/x86_64/nptl/tcb-access.h | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/i386/nptl/tcb-access.h b/sysdeps/i386/nptl/tcb-access.h index 6c6d561..5ddd832 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 b4137b8..bbe20b7 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 18848a7..e4d2d07 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) \ |