Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
eb64d4a9
Commit
eb64d4a9
authored
Jul 29, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
Aug 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use correct mcontext struct on macOS under Wow64.
parent
7fa12598
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
1 deletion
+53
-1
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+53
-1
No files found.
dlls/ntdll/unix/signal_x86_64.c
View file @
eb64d4a9
...
...
@@ -210,6 +210,42 @@ __ASM_GLOBAL_FUNC( alloc_fs_sel,
#include <i386/user_ldt.h>
/* The 'full' structs were added in the macOS 10.14.6 SDK/Xcode 10.3. */
#ifndef _STRUCT_X86_THREAD_FULL_STATE64
#define _STRUCT_X86_THREAD_FULL_STATE64 struct __darwin_x86_thread_full_state64
_STRUCT_X86_THREAD_FULL_STATE64
{
_STRUCT_X86_THREAD_STATE64
__ss64
;
__uint64_t
__ds
;
__uint64_t
__es
;
__uint64_t
__ss
;
__uint64_t
__gsbase
;
};
#define _STRUCT_MCONTEXT64_FULL struct __darwin_mcontext64_full
_STRUCT_MCONTEXT64_FULL
{
_STRUCT_X86_EXCEPTION_STATE64
__es
;
_STRUCT_X86_THREAD_FULL_STATE64
__ss
;
_STRUCT_X86_FLOAT_STATE64
__fs
;
};
#define _STRUCT_MCONTEXT_AVX64_FULL struct __darwin_mcontext_avx64_full
_STRUCT_MCONTEXT_AVX64_FULL
{
_STRUCT_X86_EXCEPTION_STATE64
__es
;
_STRUCT_X86_THREAD_FULL_STATE64
__ss
;
_STRUCT_X86_AVX_STATE64
__fs
;
};
#endif
/* AVX512 structs were added in the macOS 10.13 SDK/Xcode 9. */
#ifdef _STRUCT_MCONTEXT_AVX512_64_FULL
#define SIZEOF_STRUCT_MCONTEXT_AVX512_64_FULL sizeof(_STRUCT_MCONTEXT_AVX512_64_FULL)
#else
#define SIZEOF_STRUCT_MCONTEXT_AVX512_64_FULL 2664
#endif
#define RAX_sig(context) ((context)->uc_mcontext->__ss.__rax)
#define RBX_sig(context) ((context)->uc_mcontext->__ss.__rbx)
#define RCX_sig(context) ((context)->uc_mcontext->__ss.__rcx)
...
...
@@ -233,7 +269,23 @@ __ASM_GLOBAL_FUNC( alloc_fs_sel,
#define RSP_sig(context) ((context)->uc_mcontext->__ss.__rsp)
#define TRAP_sig(context) ((context)->uc_mcontext->__es.__trapno)
#define ERROR_sig(context) ((context)->uc_mcontext->__es.__err)
#define FPU_sig(context) ((XMM_SAVE_AREA32 *)&(context)->uc_mcontext->__fs.__fpu_fcw)
/* Once a custom LDT is installed (i.e. Wow64), mcontext will point to a
* larger '_full' struct which includes DS, ES, SS, and GSbase.
* This changes the offset of the FPU state.
* Checking mcsize is the only way to determine which mcontext is in use.
*/
static
inline
XMM_SAVE_AREA32
*
FPU_sig
(
const
ucontext_t
*
context
)
{
if
(
context
->
uc_mcsize
==
sizeof
(
_STRUCT_MCONTEXT64_FULL
)
||
context
->
uc_mcsize
==
sizeof
(
_STRUCT_MCONTEXT_AVX64_FULL
)
||
context
->
uc_mcsize
==
SIZEOF_STRUCT_MCONTEXT_AVX512_64_FULL
)
{
return
(
XMM_SAVE_AREA32
*
)
&
((
_STRUCT_MCONTEXT64_FULL
*
)
context
->
uc_mcontext
)
->
__fs
.
__fpu_fcw
;
}
return
(
XMM_SAVE_AREA32
*
)
&
(
context
)
->
uc_mcontext
->
__fs
.
__fpu_fcw
;
}
#define XState_sig(context) NULL
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment