src/cpu/x86/vm/vm_version_ext_x86.hpp

Sat, 07 Nov 2020 10:30:02 +0800

author
aoqi
date
Sat, 07 Nov 2020 10:30:02 +0800
changeset 10026
8c95980d0b66
parent 9858
b985cbb00e68
permissions
-rw-r--r--

Added tag mips-jdk8u275-b01 for changeset d3b4d62f391f

apetushkov@9858 1 /*
apetushkov@9858 2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
apetushkov@9858 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
apetushkov@9858 4 *
apetushkov@9858 5 * This code is free software; you can redistribute it and/or modify it
apetushkov@9858 6 * under the terms of the GNU General Public License version 2 only, as
apetushkov@9858 7 * published by the Free Software Foundation.
apetushkov@9858 8 *
apetushkov@9858 9 * This code is distributed in the hope that it will be useful, but WITHOUT
apetushkov@9858 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
apetushkov@9858 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
apetushkov@9858 12 * version 2 for more details (a copy is included in the LICENSE file that
apetushkov@9858 13 * accompanied this code).
apetushkov@9858 14 *
apetushkov@9858 15 * You should have received a copy of the GNU General Public License version
apetushkov@9858 16 * 2 along with this work; if not, write to the Free Software Foundation,
apetushkov@9858 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
apetushkov@9858 18 *
apetushkov@9858 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
apetushkov@9858 20 * or visit www.oracle.com if you need additional information or have any
apetushkov@9858 21 * questions.
apetushkov@9858 22 *
apetushkov@9858 23 */
apetushkov@9858 24
apetushkov@9858 25 #ifndef CPU_X86_VM_VM_VERSION_EXT_X86_HPP
apetushkov@9858 26 #define CPU_X86_VM_VM_VERSION_EXT_X86_HPP
apetushkov@9858 27
apetushkov@9858 28 #include "utilities/macros.hpp"
apetushkov@9858 29 #include "vm_version_x86.hpp"
apetushkov@9858 30
apetushkov@9858 31 class VM_Version_Ext : public VM_Version {
apetushkov@9858 32 private:
apetushkov@9858 33 static const size_t VENDOR_LENGTH;
apetushkov@9858 34 static const size_t CPU_EBS_MAX_LENGTH;
apetushkov@9858 35 static const size_t CPU_TYPE_DESC_BUF_SIZE;
apetushkov@9858 36 static const size_t CPU_DETAILED_DESC_BUF_SIZE;
apetushkov@9858 37
apetushkov@9858 38 static const char* const _family_id_intel[];
apetushkov@9858 39 static const char* const _family_id_amd[];
apetushkov@9858 40 static const char* const _brand_id[];
apetushkov@9858 41 static const char* const _model_id_pentium_pro[];
apetushkov@9858 42
apetushkov@9858 43 static const char* const _feature_edx_id[];
apetushkov@9858 44 static const char* const _feature_extended_edx_id[];
apetushkov@9858 45 static const char* const _feature_ecx_id[];
apetushkov@9858 46 static const char* const _feature_extended_ecx_id[];
apetushkov@9858 47
apetushkov@9858 48 static int _no_of_threads;
apetushkov@9858 49 static int _no_of_cores;
apetushkov@9858 50 static int _no_of_packages;
apetushkov@9858 51 static char* _cpu_brand_string;
apetushkov@9858 52 static jlong _max_qualified_cpu_frequency;
apetushkov@9858 53
apetushkov@9858 54 static const char* cpu_family_description(void);
apetushkov@9858 55 static const char* cpu_model_description(void);
apetushkov@9858 56 static const char* cpu_brand(void);
apetushkov@9858 57 static const char* cpu_brand_string(void);
apetushkov@9858 58
apetushkov@9858 59 static int cpu_type_description(char* const buf, size_t buf_len);
apetushkov@9858 60 static int cpu_detailed_description(char* const buf, size_t buf_len);
apetushkov@9858 61 static int cpu_extended_brand_string(char* const buf, size_t buf_len);
apetushkov@9858 62
apetushkov@9858 63 static bool cpu_is_em64t(void);
apetushkov@9858 64 static bool is_netburst(void);
apetushkov@9858 65
apetushkov@9858 66 // Returns bytes written excluding termninating null byte.
apetushkov@9858 67 static size_t cpu_write_support_string(char* const buf, size_t buf_len);
apetushkov@9858 68 static void resolve_cpu_information_details(void);
apetushkov@9858 69 static jlong max_qualified_cpu_freq_from_brand_string(void);
apetushkov@9858 70
apetushkov@9858 71 public:
apetushkov@9858 72 // Offsets for cpuid asm stub brand string
apetushkov@9858 73 static ByteSize proc_name_0_offset() { return byte_offset_of(CpuidInfo, proc_name_0); }
apetushkov@9858 74 static ByteSize proc_name_1_offset() { return byte_offset_of(CpuidInfo, proc_name_1); }
apetushkov@9858 75 static ByteSize proc_name_2_offset() { return byte_offset_of(CpuidInfo, proc_name_2); }
apetushkov@9858 76 static ByteSize proc_name_3_offset() { return byte_offset_of(CpuidInfo, proc_name_3); }
apetushkov@9858 77 static ByteSize proc_name_4_offset() { return byte_offset_of(CpuidInfo, proc_name_4); }
apetushkov@9858 78 static ByteSize proc_name_5_offset() { return byte_offset_of(CpuidInfo, proc_name_5); }
apetushkov@9858 79 static ByteSize proc_name_6_offset() { return byte_offset_of(CpuidInfo, proc_name_6); }
apetushkov@9858 80 static ByteSize proc_name_7_offset() { return byte_offset_of(CpuidInfo, proc_name_7); }
apetushkov@9858 81 static ByteSize proc_name_8_offset() { return byte_offset_of(CpuidInfo, proc_name_8); }
apetushkov@9858 82 static ByteSize proc_name_9_offset() { return byte_offset_of(CpuidInfo, proc_name_9); }
apetushkov@9858 83 static ByteSize proc_name_10_offset() { return byte_offset_of(CpuidInfo, proc_name_10); }
apetushkov@9858 84 static ByteSize proc_name_11_offset() { return byte_offset_of(CpuidInfo, proc_name_11); }
apetushkov@9858 85
apetushkov@9858 86 static int number_of_threads(void);
apetushkov@9858 87 static int number_of_cores(void);
apetushkov@9858 88 static int number_of_sockets(void);
apetushkov@9858 89
apetushkov@9858 90 static jlong maximum_qualified_cpu_frequency(void);
apetushkov@9858 91
apetushkov@9858 92 static bool supports_tscinv_ext(void);
apetushkov@9858 93
apetushkov@9858 94 static const char* cpu_name(void);
apetushkov@9858 95 static const char* cpu_description(void);
apetushkov@9858 96
apetushkov@9858 97 static void initialize();
apetushkov@9858 98 };
apetushkov@9858 99
apetushkov@9858 100 #endif // CPU_X86_VM_VM_VERSION_EXT_X86_HPP

mercurial