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
769c333c
Commit
769c333c
authored
Sep 12, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Factor out setup_raise_exception() on ARM64.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7736f383
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
signal_arm64.c
dlls/ntdll/signal_arm64.c
+24
-12
No files found.
dlls/ntdll/signal_arm64.c
View file @
769c333c
...
...
@@ -484,7 +484,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
*
* Setup the exception record and context on the thread stack.
*/
static
struct
stack_layout
*
setup_exception
(
ucontext_t
*
sigcontext
,
raise_func
func
)
static
struct
stack_layout
*
setup_exception
(
ucontext_t
*
sigcontext
)
{
struct
stack_layout
*
stack
;
DWORD
exception_code
=
0
;
...
...
@@ -500,14 +500,20 @@ static struct stack_layout *setup_exception( ucontext_t *sigcontext, raise_func
save_context
(
&
stack
->
context
,
sigcontext
);
save_fpu
(
&
stack
->
context
,
sigcontext
);
return
stack
;
}
/* now modify the sigcontext to return to the raise function */
/***********************************************************************
* setup_raise_exception
*
* Modify the signal context to call the exception raise function.
*/
static
void
setup_raise_exception
(
ucontext_t
*
sigcontext
,
struct
stack_layout
*
stack
,
raise_func
func
)
{
SP_sig
(
sigcontext
)
=
(
ULONG_PTR
)
stack
;
PC_sig
(
sigcontext
)
=
(
ULONG_PTR
)
func
;
REGn_sig
(
0
,
sigcontext
)
=
(
ULONG_PTR
)
&
stack
->
rec
;
/* first arg for raise_func */
REGn_sig
(
1
,
sigcontext
)
=
(
ULONG_PTR
)
&
stack
->
context
;
/* second arg for raise_func */
return
stack
;
}
/**********************************************************************
...
...
@@ -1054,14 +1060,14 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext )
case
1
:
/* handled */
return
;
case
-
1
:
/* overflow */
stack
=
setup_exception
(
context
,
raise_segv_exception
);
stack
=
setup_exception
(
context
);
stack
->
rec
.
ExceptionCode
=
EXCEPTION_STACK_OVERFLOW
;
return
;
goto
done
;
}
}
stack
=
setup_exception
(
context
,
raise_segv_exception
);
if
(
stack
->
rec
.
ExceptionCode
==
EXCEPTION_STACK_OVERFLOW
)
return
;
stack
=
setup_exception
(
context
);
if
(
stack
->
rec
.
ExceptionCode
==
EXCEPTION_STACK_OVERFLOW
)
goto
done
;
switch
(
signal
)
{
...
...
@@ -1082,6 +1088,8 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext )
stack
->
rec
.
ExceptionCode
=
EXCEPTION_ILLEGAL_INSTRUCTION
;
break
;
}
done:
setup_raise_exception
(
context
,
stack
,
raise_segv_exception
);
}
/**********************************************************************
...
...
@@ -1092,7 +1100,7 @@ static void segv_handler( int signal, siginfo_t *info, void *ucontext )
static
void
trap_handler
(
int
signal
,
siginfo_t
*
info
,
void
*
ucontext
)
{
ucontext_t
*
context
=
ucontext
;
struct
stack_layout
*
stack
=
setup_exception
(
context
,
raise_trap_exception
);
struct
stack_layout
*
stack
=
setup_exception
(
context
);
switch
(
info
->
si_code
)
{
...
...
@@ -1104,6 +1112,7 @@ static void trap_handler( int signal, siginfo_t *info, void *ucontext )
stack
->
rec
.
ExceptionCode
=
EXCEPTION_BREAKPOINT
;
break
;
}
setup_raise_exception
(
context
,
stack
,
raise_trap_exception
);
}
/**********************************************************************
...
...
@@ -1113,7 +1122,7 @@ static void trap_handler( int signal, siginfo_t *info, void *ucontext )
*/
static
void
fpe_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
,
raise_generic_exception
);
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
switch
(
siginfo
->
si_code
&
0xffff
)
{
...
...
@@ -1159,6 +1168,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
stack
->
rec
.
ExceptionCode
=
EXCEPTION_FLT_INVALID_OPERATION
;
break
;
}
setup_raise_exception
(
sigcontext
,
stack
,
raise_generic_exception
);
}
/**********************************************************************
...
...
@@ -1170,9 +1180,10 @@ static void int_handler( int signal, siginfo_t *siginfo, void *sigcontext )
{
if
(
!
dispatch_signal
(
SIGINT
))
{
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
,
raise_generic_exception
);
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
stack
->
rec
.
ExceptionCode
=
CONTROL_C_EXIT
;
setup_raise_exception
(
sigcontext
,
stack
,
raise_generic_exception
);
}
}
...
...
@@ -1184,10 +1195,11 @@ static void int_handler( int signal, siginfo_t *siginfo, void *sigcontext )
*/
static
void
abrt_handler
(
int
signal
,
siginfo_t
*
siginfo
,
void
*
sigcontext
)
{
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
,
raise_generic_exception
);
struct
stack_layout
*
stack
=
setup_exception
(
sigcontext
);
stack
->
rec
.
ExceptionCode
=
EXCEPTION_WINE_ASSERTION
;
stack
->
rec
.
ExceptionFlags
=
EH_NONCONTINUABLE
;
setup_raise_exception
(
sigcontext
,
stack
,
raise_generic_exception
);
}
...
...
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