equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved. |
3 * Copyright (c) 2014, 2019, Red Hat Inc. 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. |
38 static int _model; |
38 static int _model; |
39 static int _model2; |
39 static int _model2; |
40 static int _variant; |
40 static int _variant; |
41 static int _revision; |
41 static int _revision; |
42 static int _stepping; |
42 static int _stepping; |
43 |
43 static bool _dcpop; |
44 struct PsrInfo { |
44 struct PsrInfo { |
45 uint32_t dczid_el0; |
45 uint32_t dczid_el0; |
46 uint32_t ctr_el0; |
46 uint32_t ctr_el0; |
47 }; |
47 }; |
48 static PsrInfo _psr_info; |
48 static PsrInfo _psr_info; |
104 static int cpu_family() { return _cpu; } |
104 static int cpu_family() { return _cpu; } |
105 static int cpu_model() { return _model; } |
105 static int cpu_model() { return _model; } |
106 static int cpu_model2() { return _model2; } |
106 static int cpu_model2() { return _model2; } |
107 static int cpu_variant() { return _variant; } |
107 static int cpu_variant() { return _variant; } |
108 static int cpu_revision() { return _revision; } |
108 static int cpu_revision() { return _revision; } |
|
109 static bool supports_dcpop() { return _dcpop; } |
109 static ByteSize dczid_el0_offset() { return byte_offset_of(PsrInfo, dczid_el0); } |
110 static ByteSize dczid_el0_offset() { return byte_offset_of(PsrInfo, dczid_el0); } |
110 static ByteSize ctr_el0_offset() { return byte_offset_of(PsrInfo, ctr_el0); } |
111 static ByteSize ctr_el0_offset() { return byte_offset_of(PsrInfo, ctr_el0); } |
111 static bool is_zva_enabled() { |
112 static bool is_zva_enabled() { |
112 // Check the DZP bit (bit 4) of dczid_el0 is zero |
113 // Check the DZP bit (bit 4) of dczid_el0 is zero |
113 // and block size (bit 0~3) is not zero. |
114 // and block size (bit 0~3) is not zero. |
122 return (1 << (_psr_info.ctr_el0 & 0x0f)) * 4; |
123 return (1 << (_psr_info.ctr_el0 & 0x0f)) * 4; |
123 } |
124 } |
124 static int dcache_line_size() { |
125 static int dcache_line_size() { |
125 return (1 << ((_psr_info.ctr_el0 >> 16) & 0x0f)) * 4; |
126 return (1 << ((_psr_info.ctr_el0 >> 16) & 0x0f)) * 4; |
126 } |
127 } |
|
128 static bool supports_fast_class_init_checks() { return true; } |
127 }; |
129 }; |
128 |
130 |
129 #endif // CPU_AARCH64_VM_VERSION_AARCH64_HPP |
131 #endif // CPU_AARCH64_VM_VERSION_AARCH64_HPP |