aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2024-07-23 00:57:25 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2024-07-30 02:32:32 +0200
commitb52e05426160c193c29e01072736a319e5fb6f24 (patch)
treea07dfb7454def797044aebb1c42c607e87378be7 /lib/std/Thread.zig
parent38e0f049c531e83ec2eec80d50b624e6c3b8c486 (diff)
downloadzig-b52e05426160c193c29e01072736a319e5fb6f24.tar.gz
zig-b52e05426160c193c29e01072736a319e5fb6f24.zip
std.os.linux.tls: Refactor and improve documentation.
* Elaborate on the sub-variants of Variant I. * Clarify the use of the TCB term. * Rename a bunch of stuff to be more accurate/descriptive. * Follow Zig's style around namespacing more. * Use a structure for the ABI TCB. No functional change intended.
Diffstat (limited to 'lib/std/Thread.zig')
-rw-r--r--lib/std/Thread.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig
index c9c867090d..224a309730 100644
--- a/lib/std/Thread.zig
+++ b/lib/std/Thread.zig
@@ -1261,9 +1261,9 @@ const LinuxThreadImpl = struct {
bytes = std.mem.alignForward(usize, bytes, page_size);
stack_offset = bytes;
- bytes = std.mem.alignForward(usize, bytes, linux.tls.tls_image.alloc_align);
+ bytes = std.mem.alignForward(usize, bytes, linux.tls.area_desc.alignment);
tls_offset = bytes;
- bytes += linux.tls.tls_image.alloc_size;
+ bytes += linux.tls.area_desc.size;
bytes = std.mem.alignForward(usize, bytes, @alignOf(Instance));
instance_offset = bytes;
@@ -1304,12 +1304,12 @@ const LinuxThreadImpl = struct {
};
// Prepare the TLS segment and prepare a user_desc struct when needed on x86
- var tls_ptr = linux.tls.prepareTLS(mapped[tls_offset..]);
+ var tls_ptr = linux.tls.prepareArea(mapped[tls_offset..]);
var user_desc: if (target.cpu.arch == .x86) linux.user_desc else void = undefined;
if (target.cpu.arch == .x86) {
defer tls_ptr = @intFromPtr(&user_desc);
user_desc = .{
- .entry_number = linux.tls.tls_image.gdt_entry_number,
+ .entry_number = linux.tls.area_desc.gdt_entry_number,
.base_addr = tls_ptr,
.limit = 0xfffff,
.flags = .{