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
44c93556
Commit
44c93556
authored
Apr 03, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid: Avoid using wine_get/set_fs().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3160986
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
device.c
dlls/wineandroid.drv/device.c
+5
-6
init.c
dlls/wineandroid.drv/init.c
+4
-2
No files found.
dlls/wineandroid.drv/device.c
View file @
44c93556
...
...
@@ -39,7 +39,6 @@
#include "ddk/wdm.h"
#include "android.h"
#include "wine/server.h"
#include "wine/library.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
android
);
...
...
@@ -255,14 +254,14 @@ static inline BOOL is_client_in_process(void)
#ifdef __i386__
/* the Java VM uses %fs/%gs for its own purposes, so we need to wrap the calls */
static
WORD
orig_fs
,
java_fs
;
static
inline
void
wrap_java_call
(
void
)
{
wine_set_fs
(
java_fs
);
}
static
inline
void
unwrap_java_call
(
void
)
{
wine_set_fs
(
orig_fs
);
}
static
inline
void
wrap_java_call
(
void
)
{
__asm__
(
"mov %0,%%fs"
::
"r"
(
java_fs
)
);
}
static
inline
void
unwrap_java_call
(
void
)
{
__asm__
(
"mov %0,%%fs"
::
"r"
(
orig_fs
)
);
}
static
inline
void
init_java_thread
(
JavaVM
*
java_vm
)
{
orig_fs
=
wine_get_fs
(
);
__asm__
(
"mov %%fs,%0"
:
"=r"
(
orig_fs
)
);
(
*
java_vm
)
->
AttachCurrentThread
(
java_vm
,
&
jni_env
,
0
);
java_fs
=
wine_get_fs
(
);
wine_set_fs
(
orig_fs
);
__asm__
(
"mov %%fs,%0"
:
"=r"
(
java_fs
)
);
__asm__
(
"mov %0,%%fs"
::
"r"
(
orig_fs
)
);
}
#elif defined(__x86_64__)
...
...
dlls/wineandroid.drv/init.c
View file @
44c93556
...
...
@@ -635,7 +635,8 @@ static BOOL process_attach(void)
if
((
java_vm
=
wine_get_java_vm
()))
/* running under Java */
{
#ifdef __i386__
WORD
old_fs
=
wine_get_fs
();
WORD
old_fs
;
__asm__
(
"mov %%fs,%0"
:
"=r"
(
old_fs
)
);
#endif
load_android_libs
();
(
*
java_vm
)
->
AttachCurrentThread
(
java_vm
,
&
jni_env
,
0
);
...
...
@@ -643,7 +644,8 @@ static BOOL process_attach(void)
(
*
jni_env
)
->
RegisterNatives
(
jni_env
,
class
,
methods
,
ARRAY_SIZE
(
methods
));
(
*
jni_env
)
->
DeleteLocalRef
(
jni_env
,
class
);
#ifdef __i386__
wine_set_fs
(
old_fs
);
/* the Java VM hijacks %fs for its own purposes, restore it */
/* the Java VM hijacks %fs for its own purposes, restore it */
__asm__
(
"mov %0,%%fs"
::
"r"
(
old_fs
)
);
#endif
}
return
TRUE
;
...
...
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