mailing list of musl libc
 help / color / mirror / code / Atom feed
dcc5d116f7b29b1a94bcebce38999a7ac7a5baa0 blob 279 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 
#include <libc.h>
#include <syscall.h>
#include <bits/hwcap.h>

hidden int __set_thread_area(void *p)
{
	if (__hwcap2 & HWCAP2_FSGSBASE) {
		__asm__ ("wrfsbase %0" :: "r" (p) : "memory");
		return 0;
	}

	// arch_prctl(SET_FS, arg)
	return syscall(__NR_arch_prctl, 0x1002, p);
}
debug log:

solving dcc5d116 ...
found dcc5d116 in https://inbox.vuxu.org/musl/20220329122416.925516-2-harald@profian.com/

applying [1/1] https://inbox.vuxu.org/musl/20220329122416.925516-2-harald@profian.com/
diff --git a/src/thread/x86_64/__set_thread_area.c b/src/thread/x86_64/__set_thread_area.c
new file mode 100644
index 00000000..dcc5d116

Checking patch src/thread/x86_64/__set_thread_area.c...
Applied patch src/thread/x86_64/__set_thread_area.c cleanly.

index at:
100644 dcc5d116f7b29b1a94bcebce38999a7ac7a5baa0	src/thread/x86_64/__set_thread_area.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).