summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/android/system-target.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/hosted/android/system-target.h')
-rw-r--r--firmware/target/hosted/android/system-target.h16
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);
30void wait_for_interrupt(void); 32void wait_for_interrupt(void);
31void interrupt(void); 33void 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. */
38static 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