1. 28 Jul, 2016 2 commits
    • Ken Thomases's avatar
      kernel32: For Mac 64-bit, re-enable the inlining of various functions,… · 2e636d4f
      Ken Thomases authored
      kernel32: For Mac 64-bit, re-enable the inlining of various functions, leveraging the TEB self pointer at %gs:0x30.
      
      On other platforms, gsbase is set to point to Wine's TEB.  So, these functions
      can use %gs-relative addressing with the field offsets to access the fields of
      the TEB.
      
      On the Mac, gsbase points to internals of the pthread implementation and that
      wouldn't work.  However, Wine hijacks %gs:0x30 and stores the TEB address there.
      So, we access the TEB fields by first loading the TEB address and then
      accessing its fields relative to that.
      Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com>
      Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
      2e636d4f
    • Ken Thomases's avatar
      ntdll: For Mac 64-bit, poke the TEB address to %gs:0x30 and re-enable the… · 75019420
      Ken Thomases authored
      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: 's avatarKen Thomases <ken@codeweavers.com>
      Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
      75019420
  2. 27 Jul, 2016 22 commits
  3. 26 Jul, 2016 16 commits