Use direct TSD on OSX
Opened this issue · 0 comments
DmitrySkiba commented
ART uses fs
/ gs
registers to access Thread instances. While on x86 OSX it works because there is i386_set_ldt
function, x86_64 is out of luck, because OSX offers no way to set gs register.
The idea is to use unused slot from direct TSD and set/get it manually via gs
. The problem is that this introduces an indirection, and will sometimes require an intermediate register.
First model this approach in x86 (which works already) and solve all the issues. Then port that approach to x86_64 and make it work too.