ntdll: For Mac 64-bit, poke the TEB address to %gs:0x30 and re-enable the inlining...
commit7501942008f91a9a137fe598ce5ce7cb47de5522
authorKen Thomases <ken@codeweavers.com>
Wed, 27 Jul 2016 15:42:29 +0000 (27 10:42 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 28 Jul 2016 12:38:01 +0000 (28 21:38 +0900)
tree781a7b0f22a230dbb819c5e4ea6ba45d04548107
parentb05704dbbd429a5325132c77a3e13fcb88b2995f
ntdll: For Mac 64-bit, poke the TEB address to %gs:0x30 and re-enable the inlining of NtCurrentTeb().

64-bit Windows apps have hard-coded accesses to %gs:0x30 baked into them.  They
need to find the TEB self pointer there.

Technically, the gsbase register and the memory it points to belong to the
pthread implementation on macOS.  It's used for the pthread TLS implementation.
However, study of the sources and experimentation reveal that TLS slot 6
(offset 0x30) is not currently used.  Furthermore, Apple has promised to not
use that slot in the future.  So, we hijack it for our purposes.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/ntdll/ntdll.spec
dlls/ntdll/signal_x86_64.c
include/winnt.h