* m4/jvm.m4: New file.
[cacao.git] / src / native / vm / openjdk / jvm.cpp
index 31e70d0f64f81d7fba87c6d1cf877864966321cd..1b9780fafffc3cd6a3cb4437f3bc324408ad16e6 100644 (file)
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include "vm/types.h"
+// Include our JNI header before the JVM headers, because the JVM
+// headers include jni.h and we want to override the typedefs in
+// jni.h.
+#include "native/jni.hpp"
+
+// We include jvm_md.h before jvm.h as the latter includes the former.
+#include INCLUDE_JVM_MD_H
+#include INCLUDE_JVM_H
 
 #include "mm/memory.h"
 
-#include "native/jni.hpp"
 #include "native/llni.h"
 #include "native/native.hpp"
 
 #include "native/vm/reflection.hpp"
 
 #include "native/vm/openjdk/hpi.h"
+#include "native/vm/openjdk/management.hpp"
 
 #include "threads/lock.hpp"
 #include "threads/thread.hpp"
@@ -59,7 +66,7 @@
 #include "toolbox/logging.h"
 #include "toolbox/list.hpp"
 
-#include "vm/array.h"
+#include "vm/array.hpp"
 
 #if defined(ENABLE_ASSERTION)
 #include "vm/assertion.hpp"
 #endif
 
 
-typedef struct {
-    /* Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx */
-    unsigned int jvm_version;   /* Consists of major, minor, micro (n.n.n) */
-                                /* and build number (xx) */
-    unsigned int update_version : 8;         /* Update release version (uu) */
-    unsigned int special_update_version : 8; /* Special update release version (c) */
-    unsigned int reserved1 : 16; 
-    unsigned int reserved2; 
-
-    /* The following bits represents JVM supports that JDK has dependency on.
-     * JDK can use these bits to determine which JVM version
-     * and support it has to maintain runtime compatibility.
-     *
-     * When a new bit is added in a minor or update release, make sure
-     * the new bit is also added in the main/baseline.
-     */
-    unsigned int is_attachable : 1;
-    unsigned int : 31;
-    unsigned int : 32;
-    unsigned int : 32;
-} jvm_version_info;
-
-
-/*
- * A structure used to a capture exception table entry in a Java method.
- */
-typedef struct {
-    jint start_pc;
-    jint end_pc;
-    jint handler_pc;
-    jint catchType;
-} JVM_ExceptionTableEntryType;
-
-
 // Interface functions are exported as C functions.
 extern "C" {
 
@@ -3259,9 +3232,7 @@ void *JVM_GetManagement(jint version)
 {
        TRACEJVMCALLS(("JVM_GetManagement(version=%d)", version));
 
-       /* TODO We current don't support the management interface. */
-
-       return NULL;
+       return Management::get_jmm_interface(version);
 }