diff options
Diffstat (limited to 'firmware/target/hosted/android/system-target.h')
-rw-r--r-- | firmware/target/hosted/android/system-target.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/system-target.h b/firmware/target/hosted/android/system-target.h index 3938ad5fba..9145ab1e84 100644 --- a/firmware/target/hosted/android/system-target.h +++ b/firmware/target/hosted/android/system-target.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #ifndef __SYSTEM_TARGET_H__ | 21 | #ifndef __SYSTEM_TARGET_H__ |
22 | #define __SYSTEM_TARGET_H__ | 22 | #define __SYSTEM_TARGET_H__ |
23 | 23 | ||
24 | #include <jni.h> | ||
25 | |||
24 | #define disable_irq() | 26 | #define disable_irq() |
25 | #define enable_irq() | 27 | #define enable_irq() |
26 | #define disable_irq_save() 0 | 28 | #define disable_irq_save() 0 |
@@ -30,6 +32,20 @@ void power_off(void); | |||
30 | void wait_for_interrupt(void); | 32 | void wait_for_interrupt(void); |
31 | void interrupt(void); | 33 | void interrupt(void); |
32 | 34 | ||
35 | /* A JNI environment is specific to its thread, so use the correct way to | ||
36 | * obtain it: share a pointer to the JavaVM structure and ask that the JNI | ||
37 | * environment attached to the current thread. */ | ||
38 | static inline JNIEnv* getJavaEnvironment(void) | ||
39 | { | ||
40 | extern JavaVM *vm_ptr; | ||
41 | JNIEnv *env = NULL; | ||
42 | |||
43 | if (vm_ptr) | ||
44 | (*vm_ptr)->GetEnv(vm_ptr, (void**) &env, JNI_VERSION_1_2); | ||
45 | |||
46 | return env; | ||
47 | } | ||
48 | |||
33 | #endif /* __SYSTEM_TARGET_H__ */ | 49 | #endif /* __SYSTEM_TARGET_H__ */ |
34 | 50 | ||
35 | #define NEED_GENERIC_BYTESWAPS | 51 | #define NEED_GENERIC_BYTESWAPS |