commit aff557e4e81f88028e34fad8aa86f7361ef1632e (tree)
parent 5e921261a08a9b27f95ce982e8a10b461520b922
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Tue, 21 Oct 2025 03:50:09 +0200
std.os.linux.tls: add sh support
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/lib/std/os/linux/tls.zig b/lib/std/os/linux/tls.zig
@@ -73,6 +73,8 @@ const current_variant: Variant = switch (native_arch) {
.csky,
.microblaze,
.microblazeel,
+ .sh,
+ .sheb,
.thumb,
.thumbeb,
=> .I_original,
@@ -144,6 +146,8 @@ const AbiTcb = switch (current_variant) {
.armeb,
.microblaze,
.microblazeel,
+ .sh,
+ .sheb,
.thumb,
.thumbeb,
=> extern struct {
@@ -337,6 +341,13 @@ pub fn setThreadPointer(addr: usize) void {
: [addr] "r" (addr),
: .{ .r0 = true });
},
+ .sh, .sheb => {
+ asm volatile (
+ \\ ldc gbr, %[addr]
+ :
+ : [addr] "r" (addr),
+ );
+ },
.sparc, .sparc64 => {
asm volatile (
\\ mov %[addr], %%g7