about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sys
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-12-09 09:49:32 +0100
committerFlorian Weimer <fweimer@redhat.com>2021-12-09 09:49:32 +0100
commitc901c3e764d7c7079f006b4e21e877d5036eb4f5 (patch)
treeed5a2defd04179a354f4581b0b94b50b6634751e /sysdeps/unix/sysv/linux/sys
parente3e589829d16af9f7e73c7b70f74f3c5d5003e45 (diff)
downloadglibc-c901c3e764d7c7079f006b4e21e877d5036eb4f5.tar.gz
glibc-c901c3e764d7c7079f006b4e21e877d5036eb4f5.tar.xz
glibc-c901c3e764d7c7079f006b4e21e877d5036eb4f5.zip
nptl: Add public rseq symbols and <sys/rseq.h>
The relationship between the thread pointer and the rseq area
is made explicit.  The constant offset can be used by JIT compilers
to optimize rseq access (e.g., for really fast sched_getcpu).

Extensibility is provided through __rseq_size and __rseq_flags.
(In the future, the kernel could request a different rseq size
via the auxiliary vector.)

Co-Authored-By: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/sys')
-rw-r--r--sysdeps/unix/sysv/linux/sys/rseq.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux/sys/rseq.h
index c8edff50d4..1215b5d086 100644
--- a/sysdeps/unix/sysv/linux/sys/rseq.h
+++ b/sysdeps/unix/sysv/linux/sys/rseq.h
@@ -171,4 +171,14 @@ struct rseq
 
 #endif /* __GLIBC_HAVE_KERNEL_RSEQ */
 
+/* Offset from the thread pointer to the rseq area.  */
+extern const int __rseq_offset;
+
+/* Size of the registered rseq area.  0 if the registration was
+   unsuccessful.  */
+extern const unsigned int __rseq_size;
+
+/* Flags used during rseq registration.  */
+extern const unsigned int __rseq_flags;
+
 #endif /* sys/rseq.h */