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
a6987506
Commit
a6987506
authored
Apr 03, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Avoid using wine_get/set_fs().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f82a5b61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
ldt.c
libs/wine/ldt.c
+7
-4
loader.c
libs/wine/loader.c
+4
-3
No files found.
libs/wine/ldt.c
View file @
a6987506
...
...
@@ -382,7 +382,7 @@ unsigned short wine_ldt_alloc_fs(void)
int
ret
;
/* the preloader may have allocated it already */
global_fs_sel
=
wine_get_fs
(
);
__asm__
(
"mov %%fs,%0"
:
"=r"
(
global_fs_sel
)
);
if
(
global_fs_sel
&&
is_gdt_sel
(
global_fs_sel
))
return
global_fs_sel
;
memset
(
&
ldt_info
,
0
,
sizeof
(
ldt_info
)
);
...
...
@@ -431,7 +431,7 @@ void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry )
{
internal_set_entry
(
sel
,
entry
);
}
wine_set_fs
(
sel
);
__asm__
(
"mov %0,%%fs"
::
"r"
(
sel
)
);
}
...
...
@@ -442,11 +442,14 @@ void wine_ldt_init_fs( unsigned short sel, const LDT_ENTRY *entry )
*/
void
wine_ldt_free_fs
(
unsigned
short
sel
)
{
WORD
fs
;
if
(
is_gdt_sel
(
sel
))
return
;
/* nothing to do */
if
(
!
((
wine_get_fs
()
^
sel
)
&
~
3
))
__asm__
(
"mov %%fs,%0"
:
"=r"
(
fs
)
);
if
(
!
((
fs
^
sel
)
&
~
3
))
{
/* FIXME: if freeing current %fs we cannot acquire locks */
wine_set_fs
(
0
);
__asm__
(
"mov %0,%%fs"
::
"r"
(
0
)
);
internal_set_entry
(
sel
,
&
null_entry
);
wine_ldt_copy
.
flags
[
sel
>>
3
]
=
0
;
}
...
...
libs/wine/loader.c
View file @
a6987506
...
...
@@ -923,10 +923,11 @@ static jstring wine_init_jni( JNIEnv *env, jobject obj, jobjectArray cmdline, jo
#ifdef __i386__
{
unsigned
short
java_fs
=
wine_get_fs
();
wine_set_fs
(
0
);
unsigned
short
java_fs
;
__asm__
(
"mov %%fs,%0"
:
"=r"
(
java_fs
)
);
__asm__
(
"mov %0,%%fs"
::
"r"
(
0
)
);
wine_init
(
argc
,
argv
,
error
,
sizeof
(
error
)
);
wine_set_fs
(
java_fs
);
__asm__
(
"mov %0,%%fs"
::
"r"
(
java_fs
)
);
}
#else
wine_init
(
argc
,
argv
,
error
,
sizeof
(
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