Page MenuHomeFreeBSD

libc: Use variables more consistent with Variant I for Variant II TLS
ClosedPublic

Authored by jrtc27 on May 7 2025, 3:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 6, 4:45 PM
Unknown Object (File)
Sun, Jul 6, 10:33 AM
Unknown Object (File)
Sat, Jul 5, 6:57 AM
Unknown Object (File)
Sat, Jul 5, 6:25 AM
Unknown Object (File)
Sat, Jul 5, 6:13 AM
Unknown Object (File)
Tue, Jul 1, 10:50 PM
Unknown Object (File)
Tue, Jul 1, 10:16 PM
Unknown Object (File)
Sat, Jun 28, 12:37 AM
Subscribers

Details

Summary

Firstly, the first argument to __libc_allocate_tls is the old TCB
(versus oldtls, which has less of a clear meaning), so rename it to
oldtcb like Variant I.

Secondly, segbase and oldsegbase are oriented towards what ends up in
the segment registers, but that's not the main concern here, and those
don't convey what they actually point to. Instead, rename segbase to tcb
and change it to a uintptr_t **, and remove oldsegbase as it's always
equal to oldtcb, again both matching Variant I.

Finally, rename tls to tls_block, and add back a (different) tls
variable rather than constantly recomputing tcb - libc_tls_static_space,
again both matching Variant I.

Whilst here, similarly fix the oldtls argument to be oldtcb in the PIC
__libc_allocate_tls stub.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrtc27 requested review of this revision.May 7 2025, 3:00 AM

Only include libc changes

This revision is now accepted and ready to land.May 7 2025, 6:38 PM