mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
nptl: Move the rseq area to the 'extra TLS' block
Move the rseq area to the newly added 'extra TLS' block, this is the last step in adding support for the rseq extended ABI. The size of the rseq area is now dynamic and depends on the rseq features reported by the kernel through the elf auxiliary vector. This will allow applications to use rseq features past the 32 bytes of the original rseq ABI as they become available in future kernels. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <sched.h>
|
||||
#include <sysdep.h>
|
||||
#include <sysdep-vdso.h>
|
||||
#include <rseq-internal.h>
|
||||
|
||||
static int
|
||||
vsyscall_sched_getcpu (void)
|
||||
@@ -36,6 +37,6 @@ vsyscall_sched_getcpu (void)
|
||||
int
|
||||
sched_getcpu (void)
|
||||
{
|
||||
int cpu_id = THREAD_GETMEM_VOLATILE (THREAD_SELF, rseq_area.cpu_id);
|
||||
int cpu_id = RSEQ_GETMEM_ONCE (cpu_id);
|
||||
return __glibc_likely (cpu_id >= 0) ? cpu_id : vsyscall_sched_getcpu ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user