Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/ddr/j9ddr.h
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2021 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
#ifndef j9ddr_h
23
#define j9ddr_h
24
25
#include "j9comp.h"
26
27
#ifdef __cplusplus
28
extern "C" {
29
#endif
30
31
struct OMRPortLibrary;
32
typedef struct J9DDRCmdlineOptions {
33
int argc;
34
char** argv;
35
char** envp;
36
struct OMRPortLibrary* portLibrary;
37
BOOLEAN shutdownPortLib;
38
} J9DDRCmdlineOptions;
39
40
typedef struct J9DDRFieldDeclaration {
41
const char* name;
42
const char* type;
43
U_32 offset;
44
} J9DDRFieldDeclaration;
45
46
typedef struct J9DDRConstantDeclaration {
47
U_64 value;
48
const char* name;
49
} J9DDRConstantDeclaration;
50
51
typedef struct J9DDRStructDefinition {
52
const char* name;
53
const char* superName;
54
const struct J9DDRFieldDeclaration* fields;
55
const struct J9DDRConstantDeclaration* constants;
56
U_32 size;
57
} J9DDRStructDefinition;
58
59
#define J9DDRFieldTableBegin(name) static const J9DDRFieldDeclaration J9DDR_##name##_fields [] = {
60
/*((U_32)(UDATA)&(((structName*)1)->fieldName)) - 1 pattern avoids compile warnings on Linux */
61
#define J9DDRFieldTableEntry(structName, fieldName, fieldType) { J9_STR(fieldName), J9_STR(fieldType), ((U_32)(UDATA)&(((structName*)1)->fieldName)) - 1 },
62
#define J9DDRBitFieldTableEntry(fieldName, fieldType) { (fieldName), J9_STR(fieldType), 0 },
63
#define J9DDRFieldTableEnd { 0, 0, 0 } };
64
65
#define J9DDRConstantTableBegin(name) static const J9DDRConstantDeclaration J9DDR_##name##_constants [] = {
66
#define J9DDRConstantTableEntry(constantName) { (U_64) (constantName), J9_STR(constantName) },
67
#define J9DDRConstantTableEntryWithValue(constantName, constantValue) { (U_64) (constantValue), (constantName) },
68
#define J9DDRConstantTableEnd { 0, 0 } };
69
70
#define J9DDRStructTableBegin(name) const J9DDRStructDefinition J9DDR_##name##_structs [] = {
71
#define J9DDRStruct(structName, superStruct) { #structName, (superStruct), J9DDR_##structName##_fields, J9DDR_##structName##_constants, (U_32)sizeof(structName) },
72
#define J9DDRStructWithName(structName, name, superStruct) { #name, (superStruct), J9DDR_##name##_fields, J9DDR_##name##_constants, (U_32)sizeof(structName) },
73
#define J9DDREmptyStruct(structName, superStruct) { #structName, (superStruct), NULL, J9DDR_##structName##_constants, (U_32)0 },
74
#define J9DDRStructTableEnd { 0, 0, 0, 0, 0 } };
75
76
#ifdef __cplusplus
77
}
78
#endif
79
80
#endif /* j9ddr_h */
81
82
83