author | anoll |
Wed, 13 Aug 2014 10:44:50 +0200 | |
changeset 26168 | 0011f98755e3 |
parent 24953 | 9680119572be |
child 26175 | d8a4e0741439 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
2 |
* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2255
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2255
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2255
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "runtime/os.hpp" |
|
27 |
#include "vm_version_sparc.hpp" |
|
1 | 28 |
|
2253
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
29 |
# include <sys/auxv.h> |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
30 |
# include <sys/auxv_SPARC.h> |
1 | 31 |
# include <sys/systeminfo.h> |
7704 | 32 |
# include <kstat.h> |
1 | 33 |
|
2253
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
34 |
// We need to keep these here as long as we have to build on Solaris |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
35 |
// versions before 10. |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
36 |
#ifndef SI_ARCHITECTURE_32 |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
37 |
#define SI_ARCHITECTURE_32 516 /* basic 32-bit SI_ARCHITECTURE */ |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
38 |
#endif |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
39 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
40 |
#ifndef SI_ARCHITECTURE_64 |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
41 |
#define SI_ARCHITECTURE_64 517 /* basic 64-bit SI_ARCHITECTURE */ |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
42 |
#endif |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
43 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
44 |
static void do_sysinfo(int si, const char* string, int* features, int mask) { |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
45 |
char tmp; |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
46 |
size_t bufsize = sysinfo(si, &tmp, 1); |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
47 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
48 |
// All SI defines used below must be supported. |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
49 |
guarantee(bufsize != -1, "must be supported"); |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
50 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
51 |
char* buf = (char*) malloc(bufsize); |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
52 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
53 |
if (buf == NULL) |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
54 |
return; |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
55 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
56 |
if (sysinfo(si, buf, bufsize) == bufsize) { |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
57 |
// Compare the string. |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
58 |
if (strcmp(buf, string) == 0) { |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
59 |
*features |= mask; |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
60 |
} |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
61 |
} |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
62 |
|
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
63 |
free(buf); |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
64 |
} |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
65 |
|
1 | 66 |
int VM_Version::platform_features(int features) { |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
67 |
assert(os::Solaris::supports_getisax(), "getisax() must be available"); |
1 | 68 |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
69 |
// Check 32-bit architecture. |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
70 |
do_sysinfo(SI_ARCHITECTURE_32, "sparc", &features, v8_instructions_m); |
2253
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
71 |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
72 |
// Check 64-bit architecture. |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
73 |
do_sysinfo(SI_ARCHITECTURE_64, "sparcv9", &features, generic_v9_m); |
2253
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
74 |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
75 |
// Extract valid instruction set extensions. |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
76 |
uint_t avs[2]; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
77 |
uint_t avn = os::Solaris::getisax(avs, 2); |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
78 |
assert(avn <= 2, "should return two or less av's"); |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
79 |
uint_t av = avs[0]; |
1 | 80 |
|
7115
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
81 |
#ifndef PRODUCT |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
82 |
if (PrintMiscellaneous && Verbose) { |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
83 |
tty->print("getisax(2) returned: " PTR32_FORMAT, av); |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
84 |
if (avn > 1) { |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
85 |
tty->print(", " PTR32_FORMAT, avs[1]); |
22554
a19b9cf9ffa8
8031290: Adjust call to getisax() for additional words returned
jmasa
parents:
22505
diff
changeset
|
86 |
} |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
87 |
tty->cr(); |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
88 |
} |
7115
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
89 |
#endif |
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
90 |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
91 |
if (av & AV_SPARC_MUL32) features |= hardware_mul32_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
92 |
if (av & AV_SPARC_DIV32) features |= hardware_div32_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
93 |
if (av & AV_SPARC_FSMULD) features |= hardware_fsmuld_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
94 |
if (av & AV_SPARC_V8PLUS) features |= v9_instructions_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
95 |
if (av & AV_SPARC_POPC) features |= hardware_popc_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
96 |
if (av & AV_SPARC_VIS) features |= vis1_instructions_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
97 |
if (av & AV_SPARC_VIS2) features |= vis2_instructions_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
98 |
if (avn > 1) { |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
99 |
uint_t av2 = avs[1]; |
22554
a19b9cf9ffa8
8031290: Adjust call to getisax() for additional words returned
jmasa
parents:
22505
diff
changeset
|
100 |
#ifndef AV2_SPARC_SPARC5 |
a19b9cf9ffa8
8031290: Adjust call to getisax() for additional words returned
jmasa
parents:
22505
diff
changeset
|
101 |
#define AV2_SPARC_SPARC5 0x00000008 /* The 29 new fp and sub instructions */ |
a19b9cf9ffa8
8031290: Adjust call to getisax() for additional words returned
jmasa
parents:
22505
diff
changeset
|
102 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
103 |
if (av2 & AV2_SPARC_SPARC5) features |= sparc5_instructions_m; |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
104 |
} |
7115
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
105 |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
106 |
// We only build on Solaris 10 and up, but some of the values below |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
107 |
// are not defined on all versions of Solaris 10, so we define them, |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
108 |
// if necessary. |
7115
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
109 |
#ifndef AV_SPARC_ASI_BLK_INIT |
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
110 |
#define AV_SPARC_ASI_BLK_INIT 0x0080 /* ASI_BLK_INIT_xxx ASI */ |
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
111 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
112 |
if (av & AV_SPARC_ASI_BLK_INIT) features |= blk_init_instructions_m; |
7704 | 113 |
|
7115
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
114 |
#ifndef AV_SPARC_FMAF |
7704 | 115 |
#define AV_SPARC_FMAF 0x0100 /* Fused Multiply-Add */ |
7115
32300e243300
6987135: Performance regression on Intel platform with 32-bits edition between 6u13 and 6u14.
kvn
parents:
5547
diff
changeset
|
116 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
117 |
if (av & AV_SPARC_FMAF) features |= fmaf_instructions_m; |
7704 | 118 |
|
119 |
#ifndef AV_SPARC_FMAU |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
120 |
#define AV_SPARC_FMAU 0x0200 /* Unfused Multiply-Add */ |
7704 | 121 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
122 |
if (av & AV_SPARC_FMAU) features |= fmau_instructions_m; |
7704 | 123 |
|
124 |
#ifndef AV_SPARC_VIS3 |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
125 |
#define AV_SPARC_VIS3 0x0400 /* VIS3 instruction set extensions */ |
7704 | 126 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
127 |
if (av & AV_SPARC_VIS3) features |= vis3_instructions_m; |
7704 | 128 |
|
10252 | 129 |
#ifndef AV_SPARC_CBCOND |
130 |
#define AV_SPARC_CBCOND 0x10000000 /* compare and branch instrs supported */ |
|
131 |
#endif |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
132 |
if (av & AV_SPARC_CBCOND) features |= cbcond_instructions_m; |
10252 | 133 |
|
22505 | 134 |
#ifndef AV_SPARC_AES |
135 |
#define AV_SPARC_AES 0x00020000 /* aes instrs supported */ |
|
136 |
#endif |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
137 |
if (av & AV_SPARC_AES) features |= aes_instructions_m; |
22505 | 138 |
|
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
139 |
#ifndef AV_SPARC_SHA1 |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
140 |
#define AV_SPARC_SHA1 0x00400000 /* sha1 instruction supported */ |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
141 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
142 |
if (av & AV_SPARC_SHA1) features |= sha1_instruction_m; |
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
143 |
|
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
144 |
#ifndef AV_SPARC_SHA256 |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
145 |
#define AV_SPARC_SHA256 0x00800000 /* sha256 instruction supported */ |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
146 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
147 |
if (av & AV_SPARC_SHA256) features |= sha256_instruction_m; |
24953
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
148 |
|
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
149 |
#ifndef AV_SPARC_SHA512 |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
150 |
#define AV_SPARC_SHA512 0x01000000 /* sha512 instruction supported */ |
9680119572be
8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents:
22554
diff
changeset
|
151 |
#endif |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
152 |
if (av & AV_SPARC_SHA512) features |= sha512_instruction_m; |
1 | 153 |
|
2253
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
154 |
// Determine the machine type. |
30268d00878e
6812587: Use auxv to determine SPARC hardware features on Solaris
twisti
parents:
1
diff
changeset
|
155 |
do_sysinfo(SI_MACHINE, "sun4v", &features, sun4v_m); |
1 | 156 |
|
7704 | 157 |
{ |
158 |
// Using kstat to determine the machine type. |
|
159 |
kstat_ctl_t* kc = kstat_open(); |
|
160 |
kstat_t* ksp = kstat_lookup(kc, (char*)"cpu_info", -1, NULL); |
|
161 |
const char* implementation = "UNKNOWN"; |
|
162 |
if (ksp != NULL) { |
|
163 |
if (kstat_read(kc, ksp, NULL) != -1 && ksp->ks_data != NULL) { |
|
164 |
kstat_named_t* knm = (kstat_named_t *)ksp->ks_data; |
|
165 |
for (int i = 0; i < ksp->ks_ndata; i++) { |
|
166 |
if (strcmp((const char*)&(knm[i].name),"implementation") == 0) { |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
167 |
implementation = KSTAT_NAMED_STR_PTR(&knm[i]); |
7704 | 168 |
#ifndef PRODUCT |
169 |
if (PrintMiscellaneous && Verbose) { |
|
170 |
tty->print_cr("cpu_info.implementation: %s", implementation); |
|
171 |
} |
|
172 |
#endif |
|
8317
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
173 |
// Convert to UPPER case before compare. |
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
174 |
char* impl = strdup(implementation); |
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
175 |
|
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
176 |
for (int i = 0; impl[i] != 0; i++) |
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
177 |
impl[i] = (char)toupper((uint)impl[i]); |
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
178 |
|
8317
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
179 |
if (strstr(impl, "SPARC64") != NULL) { |
7704 | 180 |
features |= sparc64_family_m; |
13394 | 181 |
} else if (strstr(impl, "SPARC-M") != NULL) { |
182 |
// M-series SPARC is based on T-series. |
|
183 |
features |= (M_family_m | T_family_m); |
|
8317
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
184 |
} else if (strstr(impl, "SPARC-T") != NULL) { |
7704 | 185 |
features |= T_family_m; |
8317
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
186 |
if (strstr(impl, "SPARC-T1") != NULL) { |
7704 | 187 |
features |= T1_model_m; |
188 |
} |
|
8317
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
189 |
} else { |
13394 | 190 |
if (strstr(impl, "SPARC") == NULL) { |
191 |
#ifndef PRODUCT |
|
192 |
// kstat on Solaris 8 virtual machines (branded zones) |
|
26168
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
193 |
// returns "(unsupported)" implementation. Solaris 8 is not |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
194 |
// supported anymore, but include this check to be on the |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
195 |
// safe side. |
0011f98755e3
8043913: remove legacy code in SPARC's VM_Version::platform_features
anoll
parents:
24953
diff
changeset
|
196 |
warning("kstat cpu_info implementation = '%s', assume generic SPARC", impl); |
13394 | 197 |
#endif |
198 |
implementation = "SPARC"; |
|
199 |
} |
|
7704 | 200 |
} |
8317
34de38f6de90
7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series
kvn
parents:
7704
diff
changeset
|
201 |
free((void*)impl); |
7704 | 202 |
break; |
203 |
} |
|
204 |
} // for( |
|
205 |
} |
|
206 |
} |
|
207 |
assert(strcmp(implementation, "UNKNOWN") != 0, |
|
208 |
"unknown cpu info (changed kstat interface?)"); |
|
209 |
kstat_close(kc); |
|
210 |
} |
|
211 |
||
1 | 212 |
return features; |
213 |
} |