mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 16:45:27 +00:00
std.os.linux.tls: Add loongarch support.
This commit is contained in:
parent
44d4656dfc
commit
9db992bd9b
@ -70,6 +70,8 @@ const current_variant: Variant = switch (native_arch) {
|
||||
.thumb,
|
||||
.thumbeb,
|
||||
=> .I_original,
|
||||
.loongarch32,
|
||||
.loongarch64,
|
||||
.m68k,
|
||||
.mips,
|
||||
.mipsel,
|
||||
@ -243,6 +245,13 @@ pub fn setThreadPointer(addr: usize) void {
|
||||
const rc = linux.syscall1(.set_thread_area, addr);
|
||||
assert(rc == 0);
|
||||
},
|
||||
.loongarch32, .loongarch64 => {
|
||||
asm volatile (
|
||||
\\ mv tp, %[addr]
|
||||
:
|
||||
: [addr] "r" (addr),
|
||||
);
|
||||
},
|
||||
.riscv32, .riscv64 => {
|
||||
asm volatile (
|
||||
\\ mv tp, %[addr]
|
||||
|
Loading…
Reference in New Issue
Block a user