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
0a393d7e
Commit
0a393d7e
authored
Nov 25, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Dec 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loader: Implement setting %gs for amd64.
parent
023c2273
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
pthread.c
loader/pthread.c
+17
-1
No files found.
loader/pthread.c
View file @
0a393d7e
...
...
@@ -48,10 +48,15 @@
static
int
init_done
;
static
int
nb_threads
=
1
;
#if
ndef __i386__
#if
!defined(__i386__) && !defined(__x86_64__)
static
pthread_key_t
teb_key
;
#endif
#if defined(__x86_64__) && defined(__linux__)
#include <asm/prctl.h>
extern
int
arch_prctl
(
int
func
,
void
*
ptr
);
#endif
/***********************************************************************
* init_process
*
...
...
@@ -141,6 +146,13 @@ static void init_current_teb( struct wine_pthread_thread_info *info )
wine_ldt_set_limit
(
&
fs_entry
,
info
->
teb_size
-
1
);
wine_ldt_set_flags
(
&
fs_entry
,
WINE_LDT_FLAGS_DATA
|
WINE_LDT_FLAGS_32BIT
);
wine_ldt_init_fs
(
info
->
teb_sel
,
&
fs_entry
);
#elif defined(__x86_64__)
/* On x86_64, it's in %gs */
# ifdef __linux__
arch_prctl
(
ARCH_SET_GS
,
info
->
teb_base
);
# else
# error Please define setting %gs for your architecture
# endif
#else
if
(
!
init_done
)
/* first thread */
pthread_key_create
(
&
teb_key
,
NULL
);
...
...
@@ -174,6 +186,10 @@ static void *get_current_teb(void)
void
*
ret
;
__asm__
(
".byte 0x64
\n\t
movl 0x18,%0"
:
"=r"
(
ret
)
);
return
ret
;
#elif defined(__x86_64__)
void
*
ret
;
__asm__
(
".byte 0x65
\n\t
movq 0x30,%0"
:
"=r"
(
ret
)
);
return
ret
;
#else
return
pthread_getspecific
(
teb_key
);
#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