Skip to content

Commit

Permalink
std.os.linux.tls: Add hexagon support.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp committed Jul 29, 2024
1 parent 4914ab9 commit 89804fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/std/os/linux/tls.zig
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const current_variant: Variant = switch (native_arch) {
.riscv32,
.riscv64,
=> .I_modified,
.hexagon,
.s390x,
.sparc64,
.x86,
Expand Down Expand Up @@ -246,6 +247,13 @@ pub fn setThreadPointer(addr: usize) void {
const rc = linux.syscall1(.set_thread_area, addr);
assert(rc == 0);
},
.hexagon => {
asm volatile (
\\ ugp = %[addr]
:
: [addr] "r" (addr),
);
},
.loongarch32, .loongarch64 => {
asm volatile (
\\ mv tp, %[addr]
Expand Down

0 comments on commit 89804fb

Please sign in to comment.