Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/j9vm/j9vm_internal.h
5985 views
1
/*******************************************************************************
2
* Copyright (c) 2002, 2018 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#ifndef j9vm_internal_h
24
#define j9vm_internal_h
25
26
27
#ifdef WIN32
28
#include <tchar.h>
29
#include <io.h>
30
#if !defined(O_SYNC)
31
#define O_SYNC 0x0800
32
#endif
33
#if !defined(O_DSYNC)
34
#define O_DSYNC 0x2000
35
#endif
36
#define JVM_DEFAULT_ERROR_BUFFER_SIZE 256
37
#endif /* WIN32 */
38
39
#if defined(LINUX)
40
#if !defined(_GNU_SOURCE)
41
/* defining _GNU_SOURCE allows the use of dladdr() in dlfcn.h */
42
#define _GNU_SOURCE
43
#endif /* !defined(_GNU_SOURCE) */
44
#include <dlfcn.h>
45
#endif
46
47
/* We need to do this to get the system includes to give xlC what it only wants to give GCC but not give xlC the things which it doesn't understand */
48
#if defined(LINUXPPC)
49
#include <features.h>
50
#undef __USE_GNU
51
#include <sys/socket.h>
52
#define __USE_GNU 1
53
#endif
54
55
/* Avoid renaming malloc/free */
56
#define LAUNCHERS
57
#include "jvm.h"
58
59
#if defined(J9UNIX)
60
#include <sys/socket.h>
61
#include <dlfcn.h>
62
#include <sys/ioctl.h>
63
#include <setjmp.h>
64
#include <sys/time.h>
65
66
/* On OSX, fstat64 is deprecated. So, fstat is used on OSX. */
67
#if defined(J9ZTPF) || defined(OSX)
68
#define J9FSTAT fstat
69
#else /* defined(J9ZTPF) || defined(OSX) */
70
#define J9FSTAT fstat64
71
#endif /* defined(J9ZTPF) || defined(OSX) */
72
#endif /* defined(J9UNIX) */
73
74
75
/* required for poll support on some Unix platforms (called in JVM_Available) */
76
#if defined(LINUX) || defined(OSX) || defined(AIXPPC) || defined(J9ZOS390)
77
#include <sys/types.h>
78
#include <sys/stat.h>
79
#include <fcntl.h>
80
#if defined(LINUX) || defined(OSX)
81
#include <poll.h>
82
#elif defined(AIXPPC)
83
#include <sys/poll.h>
84
#elif defined(J9ZOS390)
85
#include <poll.h>
86
#else
87
#error No poll.h location on this platform
88
#endif
89
#endif
90
91
#ifdef RS6000
92
#include <sys/ldr.h>
93
#include <load.h>
94
#endif
95
96
#if defined(J9ZOS390)
97
#include <assert.h>
98
#include <sys/time.h>
99
#include <sys/socket.h>
100
#include <dll.h>
101
#include <sys/ioctl.h>
102
#include "atoe.h"
103
#include <unistd.h>
104
#define dlsym dllqueryfn
105
#define dlopen(a,b) dllload(a)
106
#define dlclose dllfree
107
#define J9FSTAT fstat
108
#endif
109
110
#include "omrthread.h"
111
112
/**
113
* Initializes the VM-interface from the supplied JNIEnv.
114
*/
115
void initializeVMI(void);
116
117
jclass
118
jvmDefineClassHelper(JNIEnv *env, jobject classLoaderObject,
119
jstring className, jbyte * classBytes, jint offset, jint length, jobject protectionDomain, UDATA options);
120
121
#endif /* j9vm_internal_h */
122
123