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
8f3bd63b
Commit
8f3bd63b
authored
Aug 14, 2020
by
Martin Storsjo
Committed by
Alexandre Julliard
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix arm64 sigcontext access for darwin.
Signed-off-by:
Martin Storsjo
<
martin@martin.st
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7f822441
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+31
-0
No files found.
dlls/ntdll/unix/signal_arm64.c
View file @
8f3bd63b
...
...
@@ -110,6 +110,24 @@ static DWORD64 get_fault_esr( ucontext_t *sigcontext )
return
0
;
}
#elif defined(__APPLE__)
/* All Registers access - only for local access */
# define REG_sig(reg_name, context) ((context)->uc_mcontext->__ss.__ ## reg_name)
# define REGn_sig(reg_num, context) ((context)->uc_mcontext->__ss.__x[reg_num])
/* Special Registers access */
# define SP_sig(context) REG_sig(sp, context)
/* Stack pointer */
# define PC_sig(context) REG_sig(pc, context)
/* Program counter */
# define PSTATE_sig(context) REG_sig(cpsr, context)
/* Current State Register */
# define FP_sig(context) REG_sig(fp, context)
/* Frame pointer */
# define LR_sig(context) REG_sig(lr, context)
/* Link Register */
static
DWORD64
get_fault_esr
(
ucontext_t
*
sigcontext
)
{
return
sigcontext
->
uc_mcontext
->
__es
.
__esr
;
}
#endif
/* linux */
static
pthread_key_t
teb_key
;
...
...
@@ -328,6 +346,7 @@ static void restore_context( const CONTEXT *context, ucontext_t *sigcontext )
*/
static
void
save_fpu
(
CONTEXT
*
context
,
ucontext_t
*
sigcontext
)
{
#ifdef linux
struct
fpsimd_context
*
fp
=
get_fpsimd_context
(
sigcontext
);
if
(
!
fp
)
return
;
...
...
@@ -335,6 +354,12 @@ static void save_fpu( CONTEXT *context, ucontext_t *sigcontext )
context
->
Fpcr
=
fp
->
fpcr
;
context
->
Fpsr
=
fp
->
fpsr
;
memcpy
(
context
->
V
,
fp
->
vregs
,
sizeof
(
context
->
V
)
);
#elif defined(__APPLE__)
context
->
ContextFlags
|=
CONTEXT_FLOATING_POINT
;
context
->
Fpcr
=
sigcontext
->
uc_mcontext
->
__ns
.
__fpcr
;
context
->
Fpsr
=
sigcontext
->
uc_mcontext
->
__ns
.
__fpsr
;
memcpy
(
context
->
V
,
sigcontext
->
uc_mcontext
->
__ns
.
__v
,
sizeof
(
context
->
V
)
);
#endif
}
...
...
@@ -345,12 +370,18 @@ static void save_fpu( CONTEXT *context, ucontext_t *sigcontext )
*/
static
void
restore_fpu
(
CONTEXT
*
context
,
ucontext_t
*
sigcontext
)
{
#ifdef linux
struct
fpsimd_context
*
fp
=
get_fpsimd_context
(
sigcontext
);
if
(
!
fp
)
return
;
fp
->
fpcr
=
context
->
Fpcr
;
fp
->
fpsr
=
context
->
Fpsr
;
memcpy
(
fp
->
vregs
,
context
->
V
,
sizeof
(
fp
->
vregs
)
);
#elif defined(__APPLE__)
sigcontext
->
uc_mcontext
->
__ns
.
__fpcr
=
context
->
Fpcr
;
sigcontext
->
uc_mcontext
->
__ns
.
__fpsr
=
context
->
Fpsr
;
memcpy
(
sigcontext
->
uc_mcontext
->
__ns
.
__v
,
context
->
V
,
sizeof
(
context
->
V
)
);
#endif
}
...
...
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