diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig index e188f954626cb7b6ad9b78faf5d723ffc2eae4cd..ef87253cec80f6fb526994bcca2570cb998789aa 100644 --- a/lib/std/os/linux/tls.zig +++ b/lib/std/os/linux/tls.zig @@ -78,6 +78,8 @@ const current_variant: Variant = switch (native_arch) { .sheb, .thumb, .thumbeb, + .xtensa, + .xtensaeb, => .I_original, .loongarch32, .loongarch64, @@ -152,6 +154,8 @@ const AbiTcb = switch (current_variant) { .sheb, .thumb, .thumbeb, + .xtensa, + .xtensaeb, => extern struct { /// This is offset by `current_dtv_offset`. dtv: usize, @@ -364,6 +368,13 @@ pub fn setThreadPointer(addr: usize) void { : [addr] "r" (addr), ); }, + .xtensa, .xtensaeb => { + asm volatile ( + \\ wur %[addr], threadptr + : + : [addr] "a" (addr), + ); + }, else => @compileError("Unsupported architecture"), } }