Commit 44c93556 authored by Alexandre Julliard's avatar Alexandre Julliard

wineandroid: Avoid using wine_get/set_fs().

parent e3160986
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "ddk/wdm.h" #include "ddk/wdm.h"
#include "android.h" #include "android.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/library.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(android); WINE_DEFAULT_DEBUG_CHANNEL(android);
...@@ -255,14 +254,14 @@ static inline BOOL is_client_in_process(void) ...@@ -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 */ #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 WORD orig_fs, java_fs;
static inline void wrap_java_call(void) { wine_set_fs( java_fs ); } static inline void wrap_java_call(void) { __asm__( "mov %0,%%fs" :: "r" (java_fs) ); }
static inline void unwrap_java_call(void) { wine_set_fs( orig_fs ); } static inline void unwrap_java_call(void) { __asm__( "mov %0,%%fs" :: "r" (orig_fs) ); }
static inline void init_java_thread( JavaVM *java_vm ) 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_vm)->AttachCurrentThread( java_vm, &jni_env, 0 );
java_fs = wine_get_fs(); __asm__( "mov %%fs,%0" : "=r" (java_fs) );
wine_set_fs( orig_fs ); __asm__( "mov %0,%%fs" :: "r" (orig_fs) );
} }
#elif defined(__x86_64__) #elif defined(__x86_64__)
......
...@@ -635,7 +635,8 @@ static BOOL process_attach(void) ...@@ -635,7 +635,8 @@ static BOOL process_attach(void)
if ((java_vm = wine_get_java_vm())) /* running under Java */ if ((java_vm = wine_get_java_vm())) /* running under Java */
{ {
#ifdef __i386__ #ifdef __i386__
WORD old_fs = wine_get_fs(); WORD old_fs;
__asm__( "mov %%fs,%0" : "=r" (old_fs) );
#endif #endif
load_android_libs(); load_android_libs();
(*java_vm)->AttachCurrentThread( java_vm, &jni_env, 0 ); (*java_vm)->AttachCurrentThread( java_vm, &jni_env, 0 );
...@@ -643,7 +644,8 @@ static BOOL process_attach(void) ...@@ -643,7 +644,8 @@ static BOOL process_attach(void)
(*jni_env)->RegisterNatives( jni_env, class, methods, ARRAY_SIZE( methods )); (*jni_env)->RegisterNatives( jni_env, class, methods, ARRAY_SIZE( methods ));
(*jni_env)->DeleteLocalRef( jni_env, class ); (*jni_env)->DeleteLocalRef( jni_env, class );
#ifdef __i386__ #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 #endif
} }
return TRUE; return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment