From 89804fb30ab472ea777ba78900d0b1fac704f8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 28 Jul 2024 19:05:58 +0200 Subject: [PATCH] std.os.linux.tls: Add hexagon support. --- lib/std/os/linux/tls.zig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig index 94fe1e2b21a8..01e8aa916da8 100644 --- a/lib/std/os/linux/tls.zig +++ b/lib/std/os/linux/tls.zig @@ -84,6 +84,7 @@ const current_variant: Variant = switch (native_arch) { .riscv32, .riscv64, => .I_modified, + .hexagon, .s390x, .sparc64, .x86, @@ -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]