authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-23 07:27:07+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-30 02:32:55+02:00
log44d4656dfc8ecf10a4dea0462767ca4e6513a818
tree86ddf40bb27aff3b478393dd831507cb4de1ca13
parent37275c0f69769774ba4f1fc577b04aa36e24ac6f
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.os.linux.tls: Add m68k support.


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

lib/std/os/linux/tls.zig+7
...@@ -70,6 +70,7 @@ const current_variant: Variant = switch (native_arch) {...@@ -70,6 +70,7 @@ const current_variant: Variant = switch (native_arch) {
70 .thumb,70 .thumb,
71 .thumbeb,71 .thumbeb,
72 => .I_original,72 => .I_original,
73 .m68k,
73 .mips,74 .mips,
74 .mipsel,75 .mipsel,
75 .mips64,76 .mips64,
...@@ -90,6 +91,7 @@ const current_variant: Variant = switch (native_arch) {...@@ -90,6 +91,7 @@ const current_variant: Variant = switch (native_arch) {
9091
91/// The Offset value for the modified Variant I.92/// The Offset value for the modified Variant I.
92const current_tp_offset = switch (native_arch) {93const current_tp_offset = switch (native_arch) {
94 .m68k,
93 .mips,95 .mips,
94 .mipsel,96 .mipsel,
95 .mips64,97 .mips64,
...@@ -104,6 +106,7 @@ const current_tp_offset = switch (native_arch) {...@@ -104,6 +106,7 @@ const current_tp_offset = switch (native_arch) {
104106
105/// Usually only used by the modified Variant I.107/// Usually only used by the modified Variant I.
106const current_dtv_offset = switch (native_arch) {108const current_dtv_offset = switch (native_arch) {
109 .m68k,
107 .mips,110 .mips,
108 .mipsel,111 .mipsel,
109 .mips64,112 .mips64,
...@@ -236,6 +239,10 @@ pub fn setThreadPointer(addr: usize) void {...@@ -236,6 +239,10 @@ pub fn setThreadPointer(addr: usize) void {
236 const rc = @call(.always_inline, linux.syscall1, .{ .set_tls, addr });239 const rc = @call(.always_inline, linux.syscall1, .{ .set_tls, addr });
237 assert(rc == 0);240 assert(rc == 0);
238 },241 },
242 .m68k => {
243 const rc = linux.syscall1(.set_thread_area, addr);
244 assert(rc == 0);
245 },
239 .riscv32, .riscv64 => {246 .riscv32, .riscv64 => {
240 asm volatile (247 asm volatile (
241 \\ mv tp, %[addr]248 \\ mv tp, %[addr]