freebsd-dev/sys/x86
John Baldwin 1a62e9bc00 Add <machine/tls.h> header to hold MD constants and helpers for TLS.
The header exports the following:

- Definition of struct tcb.
- Helpers to get/set the tcb for the current thread.
- TLS_TCB_SIZE (size of TCB)
- TLS_TCB_ALIGN (alignment of TCB)
- TLS_VARIANT_I or TLS_VARIANT_II
- TLS_DTV_OFFSET (bias of pointers in dtv[])
- TLS_TP_OFFSET (bias of "thread pointer" relative to TCB)

Note that TLS_TP_OFFSET does not account for if the unbiased thread
pointer points to the start of the TCB (arm and x86) or the end of the
TCB (MIPS, PowerPC, and RISC-V).

Note also that for amd64, the struct tcb does not include the unused
tcb_spare field included in the current structure in libthr.  libthr
does not use this field, and the existing calls in libc and rtld that
allocate a TCB for amd64 assume it is the size of 3 Elf_Addr's (and
thus do not allocate room for tcb_spare).

A <sys/_tls_variant_i.h> header is used by architectures using
Variant I TLS which uses a common struct tcb.

Reviewed by:	kib (older version of x86/tls.h), jrtc27
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33351
2021-12-09 13:17:13 -08:00
..
acpica x86: duplicate acpi_wakeup.c per i386 and amd64 2021-09-14 00:23:14 +03:00
bios smbios: Move smbios driver out from x86 machdep code 2021-02-23 21:17:09 +00:00
conf Retire synchronous PPP kernel driver sppp(4). 2021-10-22 11:41:36 -07:00
cpufreq modules: increase MAXMODNAME and provide backward compat 2021-12-09 18:09:53 +00:00
include Add <machine/tls.h> header to hold MD constants and helpers for TLS. 2021-12-09 13:17:13 -08:00
iommu dmar: Disable protected memory regions after initialization 2021-10-29 10:08:25 +02:00
isa x86: Perform late TSC calibration before LAPIC timer calibration 2021-12-06 10:42:19 -05:00
linux Drop "All rights reserved" from my copyright statements. 2021-07-20 10:05:50 +03:00
pci Fix "set but not used" in the x86 pci driver. 2021-12-05 15:10:16 -07:00
x86 mca: Some error handling logic improvements. 2021-12-08 21:39:24 -05:00
xen x86: Defer LAPIC calibration until after timecounters are available 2021-12-06 10:42:10 -05:00