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) {
7878 .sheb,
7979 .thumb,
8080 .thumbeb,
81 .xtensa,
82 .xtensaeb,
8183 => .I_original,
8284 .loongarch32,
8385 .loongarch64,
......@@ -152,6 +154,8 @@ const AbiTcb = switch (current_variant) {
152154 .sheb,
153155 .thumb,
154156 .thumbeb,
157 .xtensa,
158 .xtensaeb,
155159 => extern struct {
156160 /// This is offset by `current_dtv_offset`.
157161 dtv: usize,
......@@ -364,6 +368,13 @@ pub fn setThreadPointer(addr: usize) void {
364368 : [addr] "r" (addr),
365369 );
366370 },
371 .xtensa, .xtensaeb => {
372 asm volatile (
373 \\ wur %[addr], threadptr
374 :
375 : [addr] "a" (addr),
376 );
377 },
367378 else => @compileError("Unsupported architecture"),
368379 }
369380}