implemented saveThreadRegisters in C
use thread local storage as core local storage in kernel
quickfix for TLS passing to reference bug
better fix?