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
59f1c98e
Commit
59f1c98e
authored
Aug 22, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Run signal handlers on the signal stack on ARM64.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
631f9b8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
signal_arm64.c
dlls/ntdll/signal_arm64.c
+10
-15
No files found.
dlls/ntdll/signal_arm64.c
View file @
59f1c98e
...
...
@@ -107,7 +107,7 @@ static DWORD64 get_fault_esr( ucontext_t *sigcontext )
#endif
/* linux */
static
const
size_t
teb_size
=
0x2000
;
/* we reserve two pages for the TEB */
static
size_t
signal_stack_size
;
static
const
size_t
signal_stack_size
=
max
(
MINSIGSTKSZ
,
8192
)
;
typedef
void
(
WINAPI
*
raise_func
)(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
);
typedef
int
(
*
wine_signal_handler
)(
unsigned
int
sig
);
...
...
@@ -872,24 +872,13 @@ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
*/
NTSTATUS
signal_alloc_thread
(
TEB
**
teb
)
{
static
size_t
sigstack_alignment
;
SIZE_T
size
;
NTSTATUS
status
;
if
(
!
sigstack_alignment
)
{
size_t
min_size
=
teb_size
+
max
(
MINSIGSTKSZ
,
8192
);
/* find the first power of two not smaller than min_size */
sigstack_alignment
=
12
;
while
((
1u
<<
sigstack_alignment
)
<
min_size
)
sigstack_alignment
++
;
signal_stack_size
=
(
1
<<
sigstack_alignment
)
-
teb_size
;
assert
(
sizeof
(
TEB
)
<=
teb_size
);
}
size
=
1
<<
sigstack_alignment
;
size
=
teb_size
+
max
(
MINSIGSTKSZ
,
8192
);
*
teb
=
NULL
;
if
(
!
(
status
=
virtual_alloc_aligned
(
(
void
**
)
teb
,
0
,
&
size
,
MEM_COMMIT
|
MEM_TOP_DOWN
,
PAGE_READWRITE
,
sigstack_alignment
)))
PAGE_READWRITE
,
13
)))
{
(
*
teb
)
->
Tib
.
Self
=
&
(
*
teb
)
->
Tib
;
(
*
teb
)
->
Tib
.
ExceptionList
=
(
void
*
)
~
0UL
;
...
...
@@ -915,6 +904,7 @@ void signal_free_thread( TEB *teb )
void
signal_init_thread
(
TEB
*
teb
)
{
static
BOOL
init_done
;
stack_t
ss
;
if
(
!
init_done
)
{
...
...
@@ -922,6 +912,11 @@ void signal_init_thread( TEB *teb )
init_done
=
TRUE
;
}
ss
.
ss_sp
=
(
char
*
)
teb
+
teb_size
;
ss
.
ss_size
=
signal_stack_size
;
ss
.
ss_flags
=
0
;
if
(
sigaltstack
(
&
ss
,
NULL
)
==
-
1
)
perror
(
"sigaltstack"
);
/* Win64/ARM applications expect the TEB pointer to be in the x18 platform register. */
__asm__
__volatile__
(
"mov x18, %0"
:
:
"r"
(
teb
)
);
...
...
@@ -937,7 +932,7 @@ void signal_init_process(void)
struct
sigaction
sig_act
;
sig_act
.
sa_mask
=
server_block_set
;
sig_act
.
sa_flags
=
SA_RESTART
|
SA_SIGINFO
;
sig_act
.
sa_flags
=
SA_RESTART
|
SA_SIGINFO
|
SA_ONSTACK
;
sig_act
.
sa_sigaction
=
int_handler
;
if
(
sigaction
(
SIGINT
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
...
...
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