Implement TLS support, tls manual pages, and link the umtx and tls manual
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 21 Feb 2005 21:41:01 +0000 (21:41 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 21 Feb 2005 21:41:01 +0000 (21:41 +0000)
commit806bf111d28cfaddca0cf1d7ee1a7e685dd33866
treebd8e15bd699610318177a3ad1f46d9f32c94630f
parent271d192af9b9f71c47e04e0247f7018bc8ff7dee
Implement TLS support, tls manual pages, and link the umtx and tls manual
pages together.  TLS stands for 'thread local storage' and is used to
support efficient userland threading and threaded data access models.

Three TLS segments are supported in order to (eventually) support GCC3's
__thread qualifier.  David Xu's thread library only uses one descriptor
for now.  The system calls implement a mostly machine-independant API
which return architecture-specific results.  Rather then pass the actual
descriptor structure, which unnecessarily pollutes the userland
implementation, we pass a more generic (base,size) and the system call
returns the %gs load value for IA32.  For AMD64 and other architectures,
the returned value will be something for those architectures.

The current low level assembly support is not as efficient as it could be,
but it is good enough for now.  The heavy weight switch code for processes
does the work.  The light weight switch code for pure kernel threads has not
been changed (since the kernel doesn't use TLS descriptors we can just ignore
them).

Based on work by David Xu <davidxu@freebsd.org> and Matthew Dillon <dillon@backplane.com>
27 files changed:
lib/libc/sys/Makefile.inc
lib/libc/sys/tls.2 [new file with mode: 0644]
lib/libc/sys/umtx.2
sys/conf/files.i386
sys/cpu/i386/include/segments.h
sys/i386/i386/machdep.c
sys/i386/i386/swtch.s
sys/i386/i386/sys_machdep.c
sys/i386/i386/tls.c [new file with mode: 0644]
sys/i386/i386/vm_machdep.c
sys/i386/include/pcb_ext.h
sys/i386/include/segments.h
sys/i386/include/thread.h
sys/platform/pc32/i386/machdep.c
sys/platform/pc32/i386/swtch.s
sys/platform/pc32/i386/sys_machdep.c
sys/platform/pc32/i386/tls.c [new file with mode: 0644]
sys/platform/pc32/i386/vm_machdep.c
sys/platform/pc32/include/pcb_ext.h
sys/platform/pc32/include/thread.h
sys/sys/syscall-args
sys/sys/syscall-hide.h
sys/sys/syscall.h
sys/sys/syscall.mk
sys/sys/sysproto.h
sys/sys/sysunion.h
sys/sys/tls.h [new file with mode: 0644]