Path: blob/master/src/hotspot/share/include/cds.h
40951 views
/*1* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_INCLUDE_CDS_H25#define SHARE_INCLUDE_CDS_H2627// This file declares the CDS data structures that are used by the HotSpot Serviceability Agent28// (see C sources inside src/jdk.hotspot.agent).29//30// We should use only standard C types. Do not use custom types such as bool, intx,31// etc, to avoid introducing unnecessary dependencies to other HotSpot type declarations.32//33// Also, this is a C header file. Do not use C++ here.3435#define NUM_CDS_REGIONS 7 // this must be the same as MetaspaceShared::n_regions36#define CDS_ARCHIVE_MAGIC 0xf00baba237#define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba838#define CURRENT_CDS_ARCHIVE_VERSION 1139#define INVALID_CDS_ARCHIVE_VERSION -14041struct CDSFileMapRegion {42int _crc; // CRC checksum of this region.43int _read_only; // read only region?44int _allow_exec; // executable code in this region?45int _is_heap_region; // Used by SA and debug build.46int _is_bitmap_region; // Relocation bitmap for RO/RW regions (used by SA and debug build).47int _mapped_from_file; // Is this region mapped from a file?48// If false, this region was initialized using os::read().49size_t _file_offset; // Data for this region starts at this offset in the archive file.50size_t _mapping_offset; // This region should be mapped at this offset from the base address51// - for non-heap regions, the base address is SharedBaseAddress52// - for heap regions, the base address is the compressed oop encoding base53size_t _used; // Number of bytes actually used by this region (excluding padding bytes added54// for alignment purposed.55size_t _oopmap_offset; // Bitmap for relocating embedded oops (offset from SharedBaseAddress).56size_t _oopmap_size_in_bits;57char* _mapped_base; // Actually mapped address (NULL if this region is not mapped).58};5960struct CDSFileMapHeaderBase {61unsigned int _magic; // identify file type62int _crc; // header crc checksum63int _version; // must be CURRENT_CDS_ARCHIVE_VERSION64struct CDSFileMapRegion _space[NUM_CDS_REGIONS];65};6667typedef struct CDSFileMapHeaderBase CDSFileMapHeaderBase;6869#endif // SHARE_INCLUDE_CDS_H707172