Add field to tls_tcb to support segmented stacks in LLVM
authorMichael Neumann <mneumann@ntecs.de>
Tue, 22 Jul 2014 23:27:48 +0000 (01:27 +0200)
committerMichael Neumann <mneumann@ntecs.de>
Tue, 22 Jul 2014 23:27:48 +0000 (01:27 +0200)
commit166bae116c2735bbfd353b135de67878e1e5744b
tree2362216733fd5669dc9b47a5b532711dd4ba2b27
parentb22bdff41b6d8347306d2db04f97a2fbb82b4ee0
Add field to tls_tcb to support segmented stacks in LLVM

When segmented stack support is enabled, LLVM adds code in front of
every function to check if the stack is already exhausted, in which
case it calls __morestack. For this reason LLVM needs to know the lower
boundary of the stack to check against the stack pointer.
The stack boundary can be stored in this per-thread field (tcb_segstack)
and accessed via %fs:32 (x86_64) or %fs:16 (i386) from the code generated
by LLVM.
sys/cpu/i386/include/tls.h
sys/cpu/x86_64/include/tls.h