std.os.linux.tls: Add hexagon support.

This commit is contained in:
Alex Rønne Petersen 2024-07-28 19:05:58 +02:00
parent d2b21d5823
commit e6fe7a329a
No known key found for this signature in database

View File

@ -84,6 +84,7 @@ const current_variant: Variant = switch (native_arch) {
.riscv32, .riscv32,
.riscv64, .riscv64,
=> .I_modified, => .I_modified,
.hexagon,
.s390x, .s390x,
.sparc64, .sparc64,
.x86, .x86,
@ -246,6 +247,13 @@ pub fn setThreadPointer(addr: usize) void {
const rc = linux.syscall1(.set_thread_area, addr); const rc = linux.syscall1(.set_thread_area, addr);
assert(rc == 0); assert(rc == 0);
}, },
.hexagon => {
asm volatile (
\\ ugp = %[addr]
:
: [addr] "r" (addr),
);
},
.loongarch32, .loongarch64 => { .loongarch32, .loongarch64 => {
asm volatile ( asm volatile (
\\ mv tp, %[addr] \\ mv tp, %[addr]