src/os/windows/vm/jvm_windows.h

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef OS_WINDOWS_VM_JVM_WINDOWS_H
aoqi@0 26 #define OS_WINDOWS_VM_JVM_WINDOWS_H
aoqi@0 27
aoqi@0 28 #ifndef _JAVASOFT_JVM_MD_H_
aoqi@0 29 #define _JAVASOFT_JVM_MD_H_
aoqi@0 30
aoqi@0 31 /*
aoqi@0 32 * This file is currently collecting system-specific dregs for the
aoqi@0 33 * JNI conversion, which should be sorted out later.
aoqi@0 34 */
aoqi@0 35
aoqi@0 36 // JDK7 requires VS2010
aoqi@0 37 #if _MSC_VER >= 1600
aoqi@0 38 // JDK7 minimum platform requirement: Windows XP
aoqi@0 39 #if _WIN32_WINNT < 0x0501
aoqi@0 40 #undef _WIN32_WINNT
aoqi@0 41 #define _WIN32_WINNT 0x0501
aoqi@0 42 #endif
aoqi@0 43 #endif
aoqi@0 44
aoqi@0 45 #include <windows.h>
aoqi@0 46
aoqi@0 47 #if _MSC_VER <= 1200
aoqi@0 48 // Psapi.h doesn't come with Visual Studio 6; it can be downloaded as Platform
aoqi@0 49 // SDK from Microsoft. Here are the definitions copied from Psapi.h
aoqi@0 50 typedef struct _MODULEINFO {
aoqi@0 51 LPVOID lpBaseOfDll;
aoqi@0 52 DWORD SizeOfImage;
aoqi@0 53 LPVOID EntryPoint;
aoqi@0 54 } MODULEINFO, *LPMODULEINFO;
aoqi@0 55
aoqi@0 56 #else
aoqi@0 57 #include <Psapi.h>
aoqi@0 58 #endif
aoqi@0 59
aoqi@0 60 #include <Tlhelp32.h>
aoqi@0 61
aoqi@0 62 typedef int socklen_t;
aoqi@0 63
aoqi@0 64 #define JNI_ONLOAD_SYMBOLS {"_JNI_OnLoad@8", "JNI_OnLoad"}
aoqi@0 65 #define JNI_ONUNLOAD_SYMBOLS {"_JNI_OnUnload@8", "JNI_OnUnload"}
aoqi@0 66 #define JVM_ONLOAD_SYMBOLS {"_JVM_OnLoad@12", "JVM_OnLoad"}
aoqi@0 67 #define AGENT_ONLOAD_SYMBOLS {"_Agent_OnLoad@12", "Agent_OnLoad"}
aoqi@0 68 #define AGENT_ONUNLOAD_SYMBOLS {"_Agent_OnUnload@4", "Agent_OnUnload"}
aoqi@0 69 #define AGENT_ONATTACH_SYMBOLS {"_Agent_OnAttach@12", "Agent_OnAttach"}
aoqi@0 70
aoqi@0 71 #define JNI_LIB_PREFIX ""
aoqi@0 72 #define JNI_LIB_SUFFIX ".dll"
aoqi@0 73
aoqi@0 74 struct dirent {
aoqi@0 75 char d_name[MAX_PATH];
aoqi@0 76 };
aoqi@0 77
aoqi@0 78 typedef struct {
aoqi@0 79 struct dirent dirent;
aoqi@0 80 char *path;
aoqi@0 81 HANDLE handle;
aoqi@0 82 WIN32_FIND_DATA find_data;
aoqi@0 83 } DIR;
aoqi@0 84
aoqi@0 85 #include <stdlib.h>
aoqi@0 86
aoqi@0 87 #define JVM_MAXPATHLEN _MAX_PATH
aoqi@0 88
aoqi@0 89 #define JVM_R_OK 4
aoqi@0 90 #define JVM_W_OK 2
aoqi@0 91 #define JVM_X_OK 1
aoqi@0 92 #define JVM_F_OK 0
aoqi@0 93
aoqi@0 94 #ifdef __cplusplus
aoqi@0 95 extern "C" {
aoqi@0 96 #endif
aoqi@0 97
aoqi@0 98 JNIEXPORT void * JNICALL
aoqi@0 99 JVM_GetThreadInterruptEvent();
aoqi@0 100
aoqi@0 101 #ifdef __cplusplus
aoqi@0 102 } /* extern "C" */
aoqi@0 103 #endif /* __cplusplus */
aoqi@0 104
aoqi@0 105 /*
aoqi@0 106 * File I/O
aoqi@0 107 */
aoqi@0 108
aoqi@0 109 #include <sys/stat.h>
aoqi@0 110
aoqi@0 111 /* O Flags */
aoqi@0 112
aoqi@0 113 #define JVM_O_RDONLY O_RDONLY
aoqi@0 114 #define JVM_O_WRONLY O_WRONLY
aoqi@0 115 #define JVM_O_RDWR O_RDWR
aoqi@0 116 #define JVM_O_O_APPEND O_APPEND
aoqi@0 117 #define JVM_O_EXCL O_EXCL
aoqi@0 118 #define JVM_O_CREAT O_CREAT
aoqi@0 119 #define JVM_O_DELETE O_TEMPORARY
aoqi@0 120
aoqi@0 121 /* Signals */
aoqi@0 122
aoqi@0 123 #define JVM_SIGINT SIGINT
aoqi@0 124 #define JVM_SIGTERM SIGTERM
aoqi@0 125
aoqi@0 126 #define SHUTDOWN1_SIGNAL SIGINT /* Shutdown Hooks support. */
aoqi@0 127 #define SHUTDOWN2_SIGNAL SIGTERM
aoqi@0 128
aoqi@0 129 #endif /* !_JAVASOFT_JVM_MD_H_ */
aoqi@0 130
aoqi@0 131 #endif // OS_WINDOWS_VM_JVM_WINDOWS_H

mercurial