1168 * for the JVM version and capabilities. sun.misc.Version defines 1169 * the methods for getting the VM version and its capabilities. 1170 * 1171 * When a new bit is added, the following should be updated to provide 1172 * access to the new capability: 1173 * HS: JVM_GetVersionInfo and Abstract_VM_Version class 1174 * SDK: Version class 1175 * 1176 * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for 1177 * JVM to query for the JDK version and capabilities. 1178 * 1179 * When a new bit is added, the following should be updated to provide 1180 * access to the new capability: 1181 * HS: JDK_Version class 1182 * SDK: JDK_GetVersionInfo0 1183 * 1184 * ========================================================================== 1185 */ 1186 typedef struct { 1187 /* VM version string: follows the JDK release version naming convention */ 1188 unsigned int jvm_version; /* <major_ver>.<minor_ver>.<micro_ver>[-<identifier>][-<debug_target>][-b<nn>] */ 1189 unsigned int update_version : 8; 1190 unsigned int special_update_version : 8; 1191 unsigned int reserved1 : 16; 1192 unsigned int reserved2; 1193 1194 /* The following bits represents JVM supports that JDK has dependency on. 1195 * JDK can use these bits to determine which JVM version 1196 * and support it has to maintain runtime compatibility. 1197 * 1198 * When a new bit is added in a minor or update release, make sure 1199 * the new bit is also added in the main/baseline. 1200 */ 1201 unsigned int is_attachable : 1; 1202 unsigned int : 31; 1203 unsigned int : 32; 1204 unsigned int : 32; 1205 } jvm_version_info; 1206 1207 #define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) 1208 #define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) 1209 #define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) 1210 #define JVM_VERSION_BUILD(version) ((version & 0x000000FF)) 1211 1212 JNIEXPORT void JNICALL 1213 JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size); 1214 1215 typedef struct { 1216 // Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx 1217 unsigned int jdk_version; /* Consists of major, minor, micro (n.n.n) */ 1218 /* and build number (xx) */ 1219 unsigned int update_version : 8; /* Update release version (uu) */ 1220 unsigned int special_update_version : 8; /* Special update release version (c)*/ 1221 unsigned int reserved1 : 16; 1222 unsigned int reserved2; 1223 1224 /* The following bits represents new JDK supports that VM has dependency on. 1225 * VM implementation can use these bits to determine which JDK version 1226 * and support it has to maintain runtime compatibility. 1227 * 1228 * When a new bit is added in a minor or update release, make sure 1229 * the new bit is also added in the main/baseline. 1230 */ 1231 unsigned int thread_park_blocker : 1; 1232 unsigned int post_vm_init_hook_enabled : 1; 1233 unsigned int pending_list_uses_discovered_field : 1; 1234 unsigned int : 29; 1235 unsigned int : 32; 1236 unsigned int : 32; 1237 } jdk_version_info; 1238 1239 #define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) 1240 #define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) 1241 #define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8) 1242 1243 /* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN) 1244 * It will be zero for internal builds. 1245 */ 1246 #define JDK_VERSION_BUILD(version) ((version & 0x000000FF)) 1247 1248 /* 1249 * This is the function JDK_GetVersionInfo0 defined in libjava.so 1250 * that is dynamically looked up by JVM. 1251 */ 1252 typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size); 1253 1254 /* 1255 * This structure is used by the launcher to get the default thread 1256 * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a 1257 * version of 1.1. As it is not supported otherwise, it has been removed 1258 * from jni.h 1259 */ 1260 typedef struct JDK1_1InitArgs { 1261 jint version; 1262 1263 char **properties; | 1168 * for the JVM version and capabilities. sun.misc.Version defines 1169 * the methods for getting the VM version and its capabilities. 1170 * 1171 * When a new bit is added, the following should be updated to provide 1172 * access to the new capability: 1173 * HS: JVM_GetVersionInfo and Abstract_VM_Version class 1174 * SDK: Version class 1175 * 1176 * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for 1177 * JVM to query for the JDK version and capabilities. 1178 * 1179 * When a new bit is added, the following should be updated to provide 1180 * access to the new capability: 1181 * HS: JDK_Version class 1182 * SDK: JDK_GetVersionInfo0 1183 * 1184 * ========================================================================== 1185 */ 1186 typedef struct { 1187 /* VM version string: follows the JDK release version naming convention */ 1188 unsigned int jvm_version; 1189 unsigned int update_version : 8; 1190 unsigned int special_update_version : 8; 1191 unsigned int reserved1 : 16; 1192 unsigned int reserved2; 1193 1194 /* The following bits represents JVM supports that JDK has dependency on. 1195 * JDK can use these bits to determine which JVM version 1196 * and support it has to maintain runtime compatibility. 1197 * 1198 * When a new bit is added in a minor or update release, make sure 1199 * the new bit is also added in the main/baseline. 1200 */ 1201 unsigned int is_attachable : 1; 1202 unsigned int : 31; 1203 unsigned int : 32; 1204 unsigned int : 32; 1205 } jvm_version_info; 1206 1207 #define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) 1208 #define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) 1209 #define JVM_VERSION_SECURITY(version) ((version & 0x0000FF00) >> 8) 1210 #define JVM_VERSION_BUILD(version) ((version & 0x000000FF)) 1211 1212 JNIEXPORT void JNICALL 1213 JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size); 1214 1215 typedef struct { 1216 // Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx 1217 unsigned int jdk_version; /* Consists of major, minor, security (n.n.n) */ 1218 /* and build number (xx) */ 1219 unsigned int update_version : 8; /* Update release version (uu) */ 1220 unsigned int special_update_version : 8; /* Special update release version (c)*/ 1221 unsigned int reserved1 : 16; 1222 unsigned int reserved2; 1223 1224 /* The following bits represents new JDK supports that VM has dependency on. 1225 * VM implementation can use these bits to determine which JDK version 1226 * and support it has to maintain runtime compatibility. 1227 * 1228 * When a new bit is added in a minor or update release, make sure 1229 * the new bit is also added in the main/baseline. 1230 */ 1231 unsigned int thread_park_blocker : 1; 1232 unsigned int post_vm_init_hook_enabled : 1; 1233 unsigned int pending_list_uses_discovered_field : 1; 1234 unsigned int : 29; 1235 unsigned int : 32; 1236 unsigned int : 32; 1237 } jdk_version_info; 1238 1239 #define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24) 1240 #define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16) 1241 #define JDK_VERSION_SECURITY(version) ((version & 0x0000FF00) >> 8) 1242 1243 /* Build number is available only for RE build. 1244 * It will be zero for internal builds. 1245 */ 1246 #define JDK_VERSION_BUILD(version) ((version & 0x000000FF)) 1247 1248 /* 1249 * This is the function JDK_GetVersionInfo0 defined in libjava.so 1250 * that is dynamically looked up by JVM. 1251 */ 1252 typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size); 1253 1254 /* 1255 * This structure is used by the launcher to get the default thread 1256 * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a 1257 * version of 1.1. As it is not supported otherwise, it has been removed 1258 * from jni.h 1259 */ 1260 typedef struct JDK1_1InitArgs { 1261 jint version; 1262 1263 char **properties; |