1 /* |
1 /* |
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright (c) 2016, 2017 SAP SE. All rights reserved. |
3 * Copyright (c) 2016, 2018 SAP SE. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
8 * published by the Free Software Foundation. |
8 * published by the Free Software Foundation. |
34 #include "vm_version_s390.hpp" |
34 #include "vm_version_s390.hpp" |
35 |
35 |
36 # include <sys/sysinfo.h> |
36 # include <sys/sysinfo.h> |
37 |
37 |
38 bool VM_Version::_is_determine_features_test_running = false; |
38 bool VM_Version::_is_determine_features_test_running = false; |
|
39 const char* VM_Version::_model_string; |
39 |
40 |
40 unsigned long VM_Version::_features[_features_buffer_len] = {0, 0, 0, 0}; |
41 unsigned long VM_Version::_features[_features_buffer_len] = {0, 0, 0, 0}; |
41 unsigned long VM_Version::_cipher_features[_features_buffer_len] = {0, 0, 0, 0}; |
42 unsigned long VM_Version::_cipher_features[_features_buffer_len] = {0, 0, 0, 0}; |
42 unsigned long VM_Version::_msgdigest_features[_features_buffer_len] = {0, 0, 0, 0}; |
43 unsigned long VM_Version::_msgdigest_features[_features_buffer_len] = {0, 0, 0, 0}; |
43 unsigned int VM_Version::_nfeatures = 0; |
44 unsigned int VM_Version::_nfeatures = 0; |
246 |
247 |
247 |
248 |
248 void VM_Version::set_features_string() { |
249 void VM_Version::set_features_string() { |
249 |
250 |
250 unsigned int ambiguity = 0; |
251 unsigned int ambiguity = 0; |
|
252 _model_string = z_name[0]; |
251 if (is_z13()) { |
253 if (is_z13()) { |
252 _features_string = "System z G7-z13 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update, TxM, VectorInstr)"; |
254 _features_string = "System z G7-z13 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update, TxM, VectorInstr)"; |
|
255 _model_string = z_name[7]; |
253 ambiguity++; |
256 ambiguity++; |
254 } |
257 } |
255 if (is_ec12()) { |
258 if (is_ec12()) { |
256 _features_string = "System z G6-EC12 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update, TxM)"; |
259 _features_string = "System z G6-EC12 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update, TxM)"; |
|
260 _model_string = z_name[6]; |
257 ambiguity++; |
261 ambiguity++; |
258 } |
262 } |
259 if (is_z196()) { |
263 if (is_z196()) { |
260 _features_string = "System z G5-z196 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update)"; |
264 _features_string = "System z G5-z196 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update)"; |
|
265 _model_string = z_name[5]; |
261 ambiguity++; |
266 ambiguity++; |
262 } |
267 } |
263 if (is_z10()) { |
268 if (is_z10()) { |
264 _features_string = "System z G4-z10 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB)"; |
269 _features_string = "System z G4-z10 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB)"; |
|
270 _model_string = z_name[4]; |
265 ambiguity++; |
271 ambiguity++; |
266 } |
272 } |
267 if (is_z9()) { |
273 if (is_z9()) { |
268 _features_string = "System z G3-z9 (LDISP_fast, ExtImm), out-of-support as of 2016-04-01"; |
274 _features_string = "System z G3-z9 (LDISP_fast, ExtImm), out-of-support as of 2016-04-01"; |
|
275 _model_string = z_name[3]; |
269 ambiguity++; |
276 ambiguity++; |
270 } |
277 } |
271 if (is_z990()) { |
278 if (is_z990()) { |
272 _features_string = "System z G2-z990 (LDISP_fast), out-of-support as of 2014-07-01"; |
279 _features_string = "System z G2-z990 (LDISP_fast), out-of-support as of 2014-07-01"; |
|
280 _model_string = z_name[2]; |
273 ambiguity++; |
281 ambiguity++; |
274 } |
282 } |
275 if (is_z900()) { |
283 if (is_z900()) { |
276 _features_string = "System z G1-z900 (LDISP), out-of-support as of 2014-07-01"; |
284 _features_string = "System z G1-z900 (LDISP), out-of-support as of 2014-07-01"; |
|
285 _model_string = z_name[1]; |
277 ambiguity++; |
286 ambiguity++; |
278 } |
287 } |
279 |
288 |
280 if (ambiguity == 0) { |
289 if (ambiguity == 0) { |
281 _features_string = "z/Architecture (unknown generation)"; |
290 _features_string = "z/Architecture (unknown generation)"; |