Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
531ff0be
Commit
531ff0be
authored
Jul 03, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Split the signal setup into process-wide and thread-specific routines.
parent
f3bf2a70
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
27 deletions
+54
-27
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+2
-1
server.c
dlls/ntdll/server.c
+1
-1
signal_i386.c
dlls/ntdll/signal_i386.c
+14
-11
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+12
-5
signal_sparc.c
dlls/ntdll/signal_sparc.c
+12
-4
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+12
-4
thread.c
dlls/ntdll/thread.c
+1
-1
No files found.
dlls/ntdll/ntdll_misc.h
View file @
531ff0be
...
@@ -53,7 +53,8 @@ extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handl
...
@@ -53,7 +53,8 @@ extern NTSTATUS NTDLL_wait_for_multiple_objects( UINT count, const HANDLE *handl
const
LARGE_INTEGER
*
timeout
,
HANDLE
signal_object
);
const
LARGE_INTEGER
*
timeout
,
HANDLE
signal_object
);
/* init routines */
/* init routines */
extern
BOOL
SIGNAL_Init
(
void
);
extern
void
signal_init_thread
(
void
);
extern
void
signal_init_process
(
void
);
extern
size_t
get_signal_stack_total_size
(
void
);
extern
size_t
get_signal_stack_total_size
(
void
);
extern
void
version_init
(
const
WCHAR
*
appname
);
extern
void
version_init
(
const
WCHAR
*
appname
);
extern
void
debug_init
(
void
);
extern
void
debug_init
(
void
);
...
...
dlls/ntdll/server.c
View file @
531ff0be
...
@@ -985,7 +985,7 @@ NTSTATUS server_init_process_done(void)
...
@@ -985,7 +985,7 @@ NTSTATUS server_init_process_done(void)
* We do need the handlers in place by the time the request is over, so
* We do need the handlers in place by the time the request is over, so
* we set them up here. If we segfault between here and the server call
* we set them up here. If we segfault between here and the server call
* something is very wrong... */
* something is very wrong... */
if
(
!
SIGNAL_Init
())
exit
(
1
);
signal_init_process
(
);
/* Signal the parent process to continue */
/* Signal the parent process to continue */
SERVER_START_REQ
(
init_process_done
)
SERVER_START_REQ
(
init_process_done
)
...
...
dlls/ntdll/signal_i386.c
View file @
531ff0be
...
@@ -1533,12 +1533,10 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
...
@@ -1533,12 +1533,10 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
/**********************************************************************
/**********************************************************************
*
SIGNAL_Init
*
signal_init_thread
*/
*/
BOOL
SIGNAL_Init
(
void
)
void
signal_init_thread
(
void
)
{
{
struct
sigaction
sig_act
;
#ifdef HAVE_SIGALTSTACK
#ifdef HAVE_SIGALTSTACK
stack_t
ss
;
stack_t
ss
;
...
@@ -1553,12 +1551,16 @@ BOOL SIGNAL_Init(void)
...
@@ -1553,12 +1551,16 @@ BOOL SIGNAL_Init(void)
ss
.
ss_sp
=
get_signal_stack
();
ss
.
ss_sp
=
get_signal_stack
();
ss
.
ss_size
=
signal_stack_size
;
ss
.
ss_size
=
signal_stack_size
;
ss
.
ss_flags
=
0
;
ss
.
ss_flags
=
0
;
if
(
sigaltstack
(
&
ss
,
NULL
)
==
-
1
)
if
(
sigaltstack
(
&
ss
,
NULL
)
==
-
1
)
perror
(
"sigaltstack"
);
{
perror
(
"sigaltstack"
);
return
FALSE
;
}
#endif
/* HAVE_SIGALTSTACK */
#endif
/* HAVE_SIGALTSTACK */
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
{
struct
sigaction
sig_act
;
sig_act
.
sa_mask
=
server_block_set
;
sig_act
.
sa_mask
=
server_block_set
;
sig_act
.
sa_flags
=
SA_SIGINFO
|
SA_RESTART
;
sig_act
.
sa_flags
=
SA_SIGINFO
|
SA_RESTART
;
...
@@ -1594,11 +1596,12 @@ BOOL SIGNAL_Init(void)
...
@@ -1594,11 +1596,12 @@ BOOL SIGNAL_Init(void)
if
(
sigaction
(
SIGUSR2
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
if
(
sigaction
(
SIGUSR2
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
#endif
#endif
return
TRUE
;
signal_init_thread
();
return
;
error:
error:
perror
(
"sigaction"
);
perror
(
"sigaction"
);
return
FALSE
;
exit
(
1
)
;
}
}
...
...
dlls/ntdll/signal_powerpc.c
View file @
531ff0be
...
@@ -648,9 +648,16 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
...
@@ -648,9 +648,16 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
/**********************************************************************
/**********************************************************************
*
SIGNAL_Init
*
signal_init_thread
*/
*/
BOOL
SIGNAL_Init
(
void
)
void
signal_init_thread
(
void
)
{
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
{
{
if
(
set_handler
(
SIGINT
,
(
void
(
*
)())
int_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGINT
,
(
void
(
*
)())
int_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGFPE
,
(
void
(
*
)())
fpe_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGFPE
,
(
void
(
*
)())
fpe_handler
)
==
-
1
)
goto
error
;
...
@@ -665,12 +672,12 @@ BOOL SIGNAL_Init(void)
...
@@ -665,12 +672,12 @@ BOOL SIGNAL_Init(void)
#ifdef SIGTRAP
#ifdef SIGTRAP
if
(
set_handler
(
SIGTRAP
,
(
void
(
*
)())
trap_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGTRAP
,
(
void
(
*
)())
trap_handler
)
==
-
1
)
goto
error
;
#endif
#endif
signal_init_thread
();
return
TRUE
;
return
;
error:
error:
perror
(
"sigaction"
);
perror
(
"sigaction"
);
return
FALSE
;
exit
(
1
)
;
}
}
...
...
dlls/ntdll/signal_sparc.c
View file @
531ff0be
...
@@ -457,9 +457,16 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
...
@@ -457,9 +457,16 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
/**********************************************************************
/**********************************************************************
*
SIGNAL_Init
*
signal_init_thread
*/
*/
BOOL
SIGNAL_Init
(
void
)
void
signal_init_thread
(
void
)
{
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
{
{
if
(
set_handler
(
SIGINT
,
(
void
(
*
)())
int_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGINT
,
(
void
(
*
)())
int_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGFPE
,
(
void
(
*
)())
fpe_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGFPE
,
(
void
(
*
)())
fpe_handler
)
==
-
1
)
goto
error
;
...
@@ -476,11 +483,12 @@ BOOL SIGNAL_Init(void)
...
@@ -476,11 +483,12 @@ BOOL SIGNAL_Init(void)
this is correct, because that is what x86 does, or it is harmful
this is correct, because that is what x86 does, or it is harmful
because it could obscure problems in user code */
because it could obscure problems in user code */
asm
(
"ta 6"
);
/* 6 == ST_FIX_ALIGN defined in sys/trap.h */
asm
(
"ta 6"
);
/* 6 == ST_FIX_ALIGN defined in sys/trap.h */
return
TRUE
;
signal_init_thread
();
return
;
error:
error:
perror
(
"sigaction"
);
perror
(
"sigaction"
);
return
FALSE
;
exit
(
1
)
;
}
}
...
...
dlls/ntdll/signal_x86_64.c
View file @
531ff0be
...
@@ -481,9 +481,16 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
...
@@ -481,9 +481,16 @@ int __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh)
/**********************************************************************
/**********************************************************************
*
SIGNAL_Init
*
signal_init_thread
*/
*/
BOOL
SIGNAL_Init
(
void
)
void
signal_init_thread
(
void
)
{
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
{
{
if
(
set_handler
(
SIGINT
,
(
void
(
*
)())
int_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGINT
,
(
void
(
*
)())
int_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGFPE
,
(
void
(
*
)())
fpe_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGFPE
,
(
void
(
*
)())
fpe_handler
)
==
-
1
)
goto
error
;
...
@@ -498,11 +505,12 @@ BOOL SIGNAL_Init(void)
...
@@ -498,11 +505,12 @@ BOOL SIGNAL_Init(void)
#ifdef SIGTRAP
#ifdef SIGTRAP
if
(
set_handler
(
SIGTRAP
,
(
void
(
*
)())
trap_handler
)
==
-
1
)
goto
error
;
if
(
set_handler
(
SIGTRAP
,
(
void
(
*
)())
trap_handler
)
==
-
1
)
goto
error
;
#endif
#endif
return
TRUE
;
signal_init_thread
();
return
;
error:
error:
perror
(
"sigaction"
);
perror
(
"sigaction"
);
return
FALSE
;
exit
(
1
)
;
}
}
...
...
dlls/ntdll/thread.c
View file @
531ff0be
...
@@ -424,7 +424,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
...
@@ -424,7 +424,7 @@ static void start_thread( struct wine_pthread_thread_info *info )
thread_data
->
debug_info
=
&
debug_info
;
thread_data
->
debug_info
=
&
debug_info
;
pthread_functions
.
init_current_teb
(
info
);
pthread_functions
.
init_current_teb
(
info
);
SIGNAL_Init
();
signal_init_thread
();
server_init_thread
(
info
->
pid
,
info
->
tid
,
func
);
server_init_thread
(
info
->
pid
,
info
->
tid
,
func
);
pthread_functions
.
init_thread
(
info
);
pthread_functions
.
init_thread
(
info
);
virtual_alloc_thread_stack
(
info
->
stack_base
,
info
->
stack_size
);
virtual_alloc_thread_stack
(
info
->
stack_base
,
info
->
stack_size
);
...
...
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