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
d3a68e43
Commit
d3a68e43
authored
Nov 10, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move the initialization of the thread register into signal_start_thread().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6ecc8039
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
79 deletions
+25
-79
loader.c
dlls/ntdll/unix/loader.c
+0
-1
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+0
-9
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+0
-10
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+5
-17
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+20
-40
thread.c
dlls/ntdll/unix/thread.c
+0
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+0
-1
No files found.
dlls/ntdll/unix/loader.c
View file @
d3a68e43
...
...
@@ -2166,7 +2166,6 @@ static void start_main_thread(void)
signal_init_threading
();
signal_alloc_thread
(
teb
);
signal_init_thread
(
teb
);
dbg_init
();
startup_info_size
=
server_init_process
();
virtual_map_user_shared_data
();
...
...
dlls/ntdll/unix/signal_arm.c
View file @
d3a68e43
...
...
@@ -1546,15 +1546,6 @@ void signal_free_thread( TEB *teb )
/**********************************************************************
* signal_init_thread
*/
void
signal_init_thread
(
TEB
*
teb
)
{
__asm__
__volatile__
(
"mcr p15, 0, %0, c13, c0, 2"
:
:
"r"
(
teb
)
);
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
...
...
dlls/ntdll/unix/signal_arm64.c
View file @
d3a68e43
...
...
@@ -1339,16 +1339,6 @@ void signal_free_thread( TEB *teb )
/**********************************************************************
* signal_init_thread
*/
void
signal_init_thread
(
TEB
*
teb
)
{
/* Win64/ARM applications expect the TEB pointer to be in the x18 platform register. */
__asm__
__volatile__
(
"mov x18, %0"
:
:
"r"
(
teb
)
);
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
...
...
dlls/ntdll/unix/signal_i386.c
View file @
d3a68e43
...
...
@@ -2368,21 +2368,6 @@ void signal_free_thread( TEB *teb )
/**********************************************************************
* signal_init_thread
*/
void
signal_init_thread
(
TEB
*
teb
)
{
const
WORD
fpu_cw
=
0x27f
;
struct
x86_thread_data
*
thread_data
=
(
struct
x86_thread_data
*
)
&
teb
->
GdiTebBatch
;
ldt_set_fs
(
thread_data
->
fs
,
teb
);
thread_data
->
gs
=
get_gs
();
__asm__
volatile
(
"fninit; fldcw %0"
:
:
"m"
(
fpu_cw
));
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
...
...
@@ -2436,11 +2421,14 @@ void DECLSPEC_HIDDEN call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, B
CONTEXT
*
ctx
,
context
=
{
CONTEXT_ALL
};
DWORD
*
stack
;
ldt_set_fs
(
thread_data
->
fs
,
teb
);
thread_data
->
gs
=
get_gs
();
context
.
SegCs
=
get_cs
();
context
.
SegDs
=
get_ds
();
context
.
SegEs
=
get_ds
();
context
.
SegFs
=
get_fs
()
;
context
.
SegGs
=
get_gs
()
;
context
.
SegFs
=
thread_data
->
fs
;
context
.
SegGs
=
thread_data
->
gs
;
context
.
SegSs
=
get_ds
();
context
.
EFlags
=
0x202
;
context
.
Eax
=
(
DWORD
)
entry
;
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
d3a68e43
...
...
@@ -2373,46 +2373,6 @@ static void *mac_thread_gsbase(void)
/**********************************************************************
* signal_init_thread
*/
void
signal_init_thread
(
TEB
*
teb
)
{
const
WORD
fpu_cw
=
0x27f
;
#if defined __linux__
arch_prctl
(
ARCH_SET_GS
,
teb
);
arch_prctl
(
ARCH_GET_FS
,
&
amd64_thread_data
()
->
pthread_teb
);
if
(
fs32_sel
)
alloc_fs_sel
(
fs32_sel
>>
3
,
(
char
*
)
teb
+
teb
->
WowTebOffset
);
#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
amd64_set_gsbase
(
teb
);
#elif defined(__NetBSD__)
sysarch
(
X86_64_SET_GSBASE
,
&
teb
);
#elif defined (__APPLE__)
__asm__
volatile
(
".byte 0x65
\n\t
movq %0,%c1"
:
:
"r"
(
teb
->
Tib
.
Self
),
"n"
(
FIELD_OFFSET
(
TEB
,
Tib
.
Self
)));
__asm__
volatile
(
".byte 0x65
\n\t
movq %0,%c1"
:
:
"r"
(
teb
->
ThreadLocalStoragePointer
),
"n"
(
FIELD_OFFSET
(
TEB
,
ThreadLocalStoragePointer
)));
amd64_thread_data
()
->
pthread_teb
=
mac_thread_gsbase
();
/* alloc_tls_slot() needs to poke a value to an address relative to each
thread's gsbase. Have each thread record its gsbase pointer into its
TEB so alloc_tls_slot() can find it. */
teb
->
Reserved5
[
0
]
=
amd64_thread_data
()
->
pthread_teb
;
#else
# error Please define setting %gs for your architecture
#endif
#ifdef __GNUC__
__asm__
volatile
(
"fninit; fldcw %0"
:
:
"m"
(
fpu_cw
));
#else
FIXME_
(
seh
)(
"FPU setup not implemented for this platform.
\n
"
);
#endif
}
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
...
...
@@ -2510,6 +2470,26 @@ void DECLSPEC_HIDDEN call_init_thunk( LPTHREAD_START_ROUTINE entry, void *arg, B
CONTEXT
*
ctx
,
context
=
{
0
};
I386_CONTEXT
*
wow_context
;
#if defined __linux__
arch_prctl
(
ARCH_SET_GS
,
teb
);
arch_prctl
(
ARCH_GET_FS
,
&
amd64_thread_data
()
->
pthread_teb
);
if
(
fs32_sel
)
alloc_fs_sel
(
fs32_sel
>>
3
,
(
char
*
)
teb
+
teb
->
WowTebOffset
);
#elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
amd64_set_gsbase
(
teb
);
#elif defined(__NetBSD__)
sysarch
(
X86_64_SET_GSBASE
,
&
teb
);
#elif defined (__APPLE__)
__asm__
volatile
(
".byte 0x65
\n\t
movq %0,%c1"
::
"r"
(
teb
->
Tib
.
Self
),
"n"
(
FIELD_OFFSET
(
TEB
,
Tib
.
Self
)));
__asm__
volatile
(
".byte 0x65
\n\t
movq %0,%c1"
::
"r"
(
teb
->
ThreadLocalStoragePointer
),
"n"
(
FIELD_OFFSET
(
TEB
,
ThreadLocalStoragePointer
)));
amd64_thread_data
()
->
pthread_teb
=
mac_thread_gsbase
();
/* alloc_tls_slot() needs to poke a value to an address relative to each
thread's gsbase. Have each thread record its gsbase pointer into its
TEB so alloc_tls_slot() can find it. */
teb
->
Reserved5
[
0
]
=
amd64_thread_data
()
->
pthread_teb
;
#else
# error Please define setting %gs for your architecture
#endif
context
.
ContextFlags
=
CONTEXT_ALL
;
context
.
Rcx
=
(
ULONG_PTR
)
entry
;
context
.
Rdx
=
(
ULONG_PTR
)
arg
;
...
...
dlls/ntdll/unix/thread.c
View file @
d3a68e43
...
...
@@ -1069,7 +1069,6 @@ static void start_thread( TEB *teb )
thread_data
->
pthread_id
=
pthread_self
();
pthread_setspecific
(
teb_key
,
teb
);
signal_init_thread
(
teb
);
server_init_thread
(
thread_data
->
start
,
&
suspend
);
signal_start_thread
(
thread_data
->
start
,
thread_data
->
param
,
suspend
,
teb
);
}
...
...
dlls/ntdll/unix/unix_private.h
View file @
d3a68e43
...
...
@@ -234,7 +234,6 @@ extern BOOL get_thread_times( int unix_pid, int unix_tid, LARGE_INTEGER *kernel_
extern
void
signal_init_threading
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
signal_alloc_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_free_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_process
(
void
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
signal_start_thread
(
PRTL_THREAD_START_ROUTINE
entry
,
void
*
arg
,
BOOL
suspend
,
TEB
*
teb
)
DECLSPEC_HIDDEN
;
...
...
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