std.os.linux.tls: add sh support

This commit is contained in:
Alex Rønne Petersen 2025-10-21 03:50:09 +02:00
parent 5e921261a0
commit aff557e4e8
No known key found for this signature in database

View File

@ -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