mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
std: Fix TLS definitions for 32bit PowerPC targets
Correct some silly errors and add the missing piece to set the thread pointer (r2).
This commit is contained in:
parent
d97981f6fd
commit
9bebdc77d6
@ -69,7 +69,7 @@ const tls_tcb_size = switch (builtin.arch) {
|
||||
|
||||
// Controls if the TP points to the end of the TCB instead of its beginning
|
||||
const tls_tp_points_past_tcb = switch (builtin.arch) {
|
||||
.riscv32, .riscv64, .mips, .mipsel, .powerpc64, .powerpc64le => true,
|
||||
.riscv32, .riscv64, .mips, .mipsel, .powerpc, .powerpc64, .powerpc64le => true,
|
||||
else => false,
|
||||
};
|
||||
|
||||
@ -165,7 +165,14 @@ pub fn setThreadPointer(addr: usize) void {
|
||||
const rc = std.os.linux.syscall1(.set_thread_area, addr);
|
||||
assert(rc == 0);
|
||||
},
|
||||
.powerpc, .powerpc64, .powerpc64le => {
|
||||
.powerpc => {
|
||||
asm volatile (
|
||||
\\ mr 2, %[addr]
|
||||
:
|
||||
: [addr] "r" (addr)
|
||||
);
|
||||
},
|
||||
.powerpc64, .powerpc64le => {
|
||||
asm volatile (
|
||||
\\ mr 13, %[addr]
|
||||
:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user