1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/os/windows/vm/jvm_windows.h Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,131 @@ 1.4 +/* 1.5 + * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#ifndef OS_WINDOWS_VM_JVM_WINDOWS_H 1.29 +#define OS_WINDOWS_VM_JVM_WINDOWS_H 1.30 + 1.31 +#ifndef _JAVASOFT_JVM_MD_H_ 1.32 +#define _JAVASOFT_JVM_MD_H_ 1.33 + 1.34 +/* 1.35 + * This file is currently collecting system-specific dregs for the 1.36 + * JNI conversion, which should be sorted out later. 1.37 + */ 1.38 + 1.39 +// JDK7 requires VS2010 1.40 +#if _MSC_VER >= 1600 1.41 +// JDK7 minimum platform requirement: Windows XP 1.42 +#if _WIN32_WINNT < 0x0501 1.43 +#undef _WIN32_WINNT 1.44 +#define _WIN32_WINNT 0x0501 1.45 +#endif 1.46 +#endif 1.47 + 1.48 +#include <windows.h> 1.49 + 1.50 +#if _MSC_VER <= 1200 1.51 +// Psapi.h doesn't come with Visual Studio 6; it can be downloaded as Platform 1.52 +// SDK from Microsoft. Here are the definitions copied from Psapi.h 1.53 +typedef struct _MODULEINFO { 1.54 + LPVOID lpBaseOfDll; 1.55 + DWORD SizeOfImage; 1.56 + LPVOID EntryPoint; 1.57 +} MODULEINFO, *LPMODULEINFO; 1.58 + 1.59 +#else 1.60 +#include <Psapi.h> 1.61 +#endif 1.62 + 1.63 +#include <Tlhelp32.h> 1.64 + 1.65 +typedef int socklen_t; 1.66 + 1.67 +#define JNI_ONLOAD_SYMBOLS {"_JNI_OnLoad@8", "JNI_OnLoad"} 1.68 +#define JNI_ONUNLOAD_SYMBOLS {"_JNI_OnUnload@8", "JNI_OnUnload"} 1.69 +#define JVM_ONLOAD_SYMBOLS {"_JVM_OnLoad@12", "JVM_OnLoad"} 1.70 +#define AGENT_ONLOAD_SYMBOLS {"_Agent_OnLoad@12", "Agent_OnLoad"} 1.71 +#define AGENT_ONUNLOAD_SYMBOLS {"_Agent_OnUnload@4", "Agent_OnUnload"} 1.72 +#define AGENT_ONATTACH_SYMBOLS {"_Agent_OnAttach@12", "Agent_OnAttach"} 1.73 + 1.74 +#define JNI_LIB_PREFIX "" 1.75 +#define JNI_LIB_SUFFIX ".dll" 1.76 + 1.77 +struct dirent { 1.78 + char d_name[MAX_PATH]; 1.79 +}; 1.80 + 1.81 +typedef struct { 1.82 + struct dirent dirent; 1.83 + char *path; 1.84 + HANDLE handle; 1.85 + WIN32_FIND_DATA find_data; 1.86 +} DIR; 1.87 + 1.88 +#include <stdlib.h> 1.89 + 1.90 +#define JVM_MAXPATHLEN _MAX_PATH 1.91 + 1.92 +#define JVM_R_OK 4 1.93 +#define JVM_W_OK 2 1.94 +#define JVM_X_OK 1 1.95 +#define JVM_F_OK 0 1.96 + 1.97 +#ifdef __cplusplus 1.98 +extern "C" { 1.99 +#endif 1.100 + 1.101 +JNIEXPORT void * JNICALL 1.102 +JVM_GetThreadInterruptEvent(); 1.103 + 1.104 +#ifdef __cplusplus 1.105 +} /* extern "C" */ 1.106 +#endif /* __cplusplus */ 1.107 + 1.108 +/* 1.109 + * File I/O 1.110 + */ 1.111 + 1.112 +#include <sys/stat.h> 1.113 + 1.114 +/* O Flags */ 1.115 + 1.116 +#define JVM_O_RDONLY O_RDONLY 1.117 +#define JVM_O_WRONLY O_WRONLY 1.118 +#define JVM_O_RDWR O_RDWR 1.119 +#define JVM_O_O_APPEND O_APPEND 1.120 +#define JVM_O_EXCL O_EXCL 1.121 +#define JVM_O_CREAT O_CREAT 1.122 +#define JVM_O_DELETE O_TEMPORARY 1.123 + 1.124 +/* Signals */ 1.125 + 1.126 +#define JVM_SIGINT SIGINT 1.127 +#define JVM_SIGTERM SIGTERM 1.128 + 1.129 +#define SHUTDOWN1_SIGNAL SIGINT /* Shutdown Hooks support. */ 1.130 +#define SHUTDOWN2_SIGNAL SIGTERM 1.131 + 1.132 +#endif /* !_JAVASOFT_JVM_MD_H_ */ 1.133 + 1.134 +#endif // OS_WINDOWS_VM_JVM_WINDOWS_H