mailing list of musl libc
 help / color / mirror / code / Atom feed
cd3a25195e5d737333b6e9ec310d839722b40262 blob 303 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 cd3a2519 ...
found cd3a2519 in https://inbox.vuxu.org/musl/20220329115433.918346-2-harald@profian.com/ ||
	https://inbox.vuxu.org/musl/20220329114257.914392-1-harald@profian.com/

applying [1/2] https://inbox.vuxu.org/musl/20220329115433.918346-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..cd3a2519

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

skipping https://inbox.vuxu.org/musl/20220329114257.914392-1-harald@profian.com/ for cd3a2519
index at:
100644 cd3a25195e5d737333b6e9ec310d839722b40262	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).