| ... | ... | @@ -46,7 +46,7 @@ const Variant = enum { |
| 46 | 46 | /// -------------------------------------^------------- |
| 47 | 47 | /// `-- The TP register points here. |
| 48 | 48 | /// |
| 49 | | /// The offset (which can be zero) is applied to the TP only; there is never physical gap |
| 49 | /// The offset (which can be zero) is applied to the TP only; there is never a physical gap |
| 50 | 50 | /// between the ABI TCB and the TLS blocks. This implies that we only need to align the TP. |
| 51 | 51 | /// |
| 52 | 52 | /// The first (and only) word in the ABI TCB points to the DTV. |
| ... | ... | @@ -71,6 +71,8 @@ const current_variant: Variant = switch (native_arch) { |
| 71 | 71 | .arm, |
| 72 | 72 | .armeb, |
| 73 | 73 | .csky, |
| 74 | .microblaze, |
| 75 | .microblazeel, |
| 74 | 76 | .thumb, |
| 75 | 77 | .thumbeb, |
| 76 | 78 | => .I_original, |
| ... | ... | @@ -135,19 +137,19 @@ const current_dtv_offset = switch (native_arch) { |
| 135 | 137 | /// Per-thread storage for the ELF TLS ABI. |
| 136 | 138 | const AbiTcb = switch (current_variant) { |
| 137 | 139 | .I_original, .I_modified => switch (native_arch) { |
| 138 | | // ARM EABI mandates enough space for two pointers: the first one points to the DTV as |
| 139 | | // usual, while the second one is unspecified. |
| 140 | 140 | .aarch64, |
| 141 | 141 | .aarch64_be, |
| 142 | 142 | .alpha, |
| 143 | 143 | .arm, |
| 144 | 144 | .armeb, |
| 145 | .microblaze, |
| 146 | .microblazeel, |
| 145 | 147 | .thumb, |
| 146 | 148 | .thumbeb, |
| 147 | 149 | => extern struct { |
| 148 | 150 | /// This is offset by `current_dtv_offset`. |
| 149 | 151 | dtv: usize, |
| 150 | | reserved: ?*anyopaque, |
| 152 | _reserved: ?*anyopaque, |
| 151 | 153 | }, |
| 152 | 154 | else => extern struct { |
| 153 | 155 | /// This is offset by `current_dtv_offset`. |
| ... | ... | @@ -297,6 +299,13 @@ pub fn setThreadPointer(addr: usize) void { |
| 297 | 299 | const rc = @call(.always_inline, linux.syscall1, .{ .set_thread_area, addr }); |
| 298 | 300 | assert(rc == 0); |
| 299 | 301 | }, |
| 302 | .microblaze, .microblazeel => { |
| 303 | asm volatile ( |
| 304 | \\ ori r21, %[addr], 0 |
| 305 | : |
| 306 | : [addr] "r" (addr), |
| 307 | ); |
| 308 | }, |
| 300 | 309 | .or1k => { |
| 301 | 310 | asm volatile ( |
| 302 | 311 | \\ l.ori r10, %[addr], 0 |