Path: blob/master/runtime/gc_modron_startup/mmparse.h
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2020 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* 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 and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*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-exception21*******************************************************************************/2223/**24* @file25* @ingroup GC_Modron_Startup26*/2728#if !defined(MMPARSE_H_)29#define MMPARSE_H_3031class MM_GCExtensions;3233/**34* All GC Memory Parameters35*/36typedef enum {37opt_Xmx = 0,38opt_Xmca,39opt_Xmco,40opt_Xmcrs,41opt_Xmn,42opt_Xmns,43opt_Xmnx,44opt_Xmo,45opt_Xmos,46opt_Xmox,47opt_Xms,48opt_Xmoi,49opt_Xmrx,50opt_Xmr,51opt_Xmdx,52opt_Xsoftmx,53opt_maxRAMPercent,54opt_initialRAMPercent,55opt_none56} gcMemoryParameters;5758/* When displaying, maximum number of characters required, plus the "-" i.e. -Xmox */59#define MAXIMUM_GC_MEMORY_PARAMETER_LENGTH 8 /* -Xsoftmx is longer than the others (length 5) */6061/**62* Manipulate GC memory parameters.63*64* GC memory parameters can either be provided by the user, or calculated based65* on a memoryParameter value stored in GCExtensions (Xmdx/Xmx/Xms).66* This structure contains the information required to manipulate a non user provided value.67* @ingroup GC_Modron_Startup68*/69struct J9GcMemoryParameter {70UDATA MM_GCExtensions::*fieldOffset;71gcMemoryParameters optionName;72UDATA valueMax;73UDATA valueMin;74UDATA MM_GCExtensions::*valueBaseOffset;75UDATA scaleNumerator;76UDATA scaleDenominator;77UDATA valueRound;78};7980#ifdef __cplusplus81extern "C" {82#endif8384jint gcParseCommandLineAndInitializeWithValues(J9JavaVM *vm, IDATA *memoryParameters);85bool gcParseTGCCommandLine(J9JavaVM *vm);8687jint gcParseXgcArguments(J9JavaVM *vm, char *optArg);88jint gcParseXXgcArguments(J9JavaVM *vm, char *optArg);89bool scan_udata_helper(J9JavaVM *javaVM, char **cursor, UDATA *value, const char *argName);90bool scan_u32_helper(J9JavaVM *javaVM, char **cursor, U_32 *value, const char *argName);91bool scan_u64_helper(J9JavaVM *javaVM, char **cursor, U_64 *value, const char *argName);92bool scan_udata_memory_size_helper(J9JavaVM *javaVM, char **cursor, uintptr_t *value, const char *argName);93bool scan_u64_memory_size_helper(J9JavaVM *javaVM, char **cursor, uint64_t *value, const char *argName);94bool scan_hex_helper(J9JavaVM *javaVM, char **cursor, UDATA *value, const char *argName);95void gcParseXgcpolicy(MM_GCExtensions *extensions);9697#ifdef __cplusplus98} /* extern "C" { */99#endif100101#endif /* MMPARSE_H_ */102103104