authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-26 08:09:11+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-26 08:11:04+02:00
log0142405f8643d9e464991fb7606b0c5849cf64a1
tree1f536096b4d84c89f7da551429f0ef47b7274b83
parenta6ab35353293531d1b04cc18b667729fd5ee280e
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux.tls: add xtensa support


1 files changed, 11 insertions(+), 0 deletions(-)

lib/std/os/linux/tls.zig+11
...@@ -78,6 +78,8 @@ const current_variant: Variant = switch (native_arch) {...@@ -78,6 +78,8 @@ const current_variant: Variant = switch (native_arch) {
78 .sheb,78 .sheb,
79 .thumb,79 .thumb,
80 .thumbeb,80 .thumbeb,
81 .xtensa,
82 .xtensaeb,
81 => .I_original,83 => .I_original,
82 .loongarch32,84 .loongarch32,
83 .loongarch64,85 .loongarch64,
...@@ -152,6 +154,8 @@ const AbiTcb = switch (current_variant) {...@@ -152,6 +154,8 @@ const AbiTcb = switch (current_variant) {
152 .sheb,154 .sheb,
153 .thumb,155 .thumb,
154 .thumbeb,156 .thumbeb,
157 .xtensa,
158 .xtensaeb,
155 => extern struct {159 => extern struct {
156 /// This is offset by `current_dtv_offset`.160 /// This is offset by `current_dtv_offset`.
157 dtv: usize,161 dtv: usize,
...@@ -364,6 +368,13 @@ pub fn setThreadPointer(addr: usize) void {...@@ -364,6 +368,13 @@ pub fn setThreadPointer(addr: usize) void {
364 : [addr] "r" (addr),368 : [addr] "r" (addr),
365 );369 );
366 },370 },
371 .xtensa, .xtensaeb => {
372 asm volatile (
373 \\ wur %[addr], threadptr
374 :
375 : [addr] "a" (addr),
376 );
377 },
367 else => @compileError("Unsupported architecture"),378 else => @compileError("Unsupported architecture"),
368 }379 }
369}380}