| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/cpuinfo.h" | 10 #include "vm/cpuinfo.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 #if defined(HOST_ARCH_ARM) | 78 #if defined(HOST_ARCH_ARM) |
| 79 void HostCPUFeatures::InitOnce() { | 79 void HostCPUFeatures::InitOnce() { |
| 80 CpuInfo::InitOnce(); | 80 CpuInfo::InitOnce(); |
| 81 hardware_ = CpuInfo::GetCpuModel(); | 81 hardware_ = CpuInfo::GetCpuModel(); |
| 82 | 82 |
| 83 // Has floating point unit. | 83 // Has floating point unit. |
| 84 vfp_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") && | 84 vfp_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") && |
| 85 FLAG_use_vfp; | 85 FLAG_use_vfp; |
| 86 | 86 |
| 87 // Check for ARMv5, ARMv6 or ARMv7. It can be in either the Processor or | 87 // Check for ARMv5TE, ARMv6 or ARMv7. It can be in either the Processor or |
| 88 // Model information fields. | 88 // Model information fields. |
| 89 if (CpuInfo::FieldContains(kCpuInfoProcessor, "ARM926EJ-S") || | 89 if (CpuInfo::FieldContains(kCpuInfoProcessor, "ARM926EJ-S") || |
| 90 CpuInfo::FieldContains(kCpuInfoModel, "ARM926EJ-S")) { | 90 CpuInfo::FieldContains(kCpuInfoModel, "ARM926EJ-S")) { |
| 91 // Lego Mindstorm EV3. | 91 // Lego Mindstorm EV3. |
| 92 arm_version_ = ARMv5TE; | 92 arm_version_ = ARMv5TE; |
| 93 // On ARMv5, the PC read offset in an STR or STM instruction is either 8 or | 93 // On ARMv5, the PC read offset in an STR or STM instruction is either 8 or |
| 94 // 12 bytes depending on the implementation. On the Mindstorm EV3 it is 12 | 94 // 12 bytes depending on the implementation. On the Mindstorm EV3 it is 12 |
| 95 // bytes. | 95 // bytes. |
| 96 store_pc_read_offset_ = 12; | 96 store_pc_read_offset_ = 12; |
| 97 } else if (CpuInfo::FieldContains(kCpuInfoProcessor, "Feroceon 88FR131") || |
| 98 CpuInfo::FieldContains(kCpuInfoModel, "Feroceon 88FR131")) { |
| 99 // This is for the DGBox. For the time-being, assume it is similar to the |
| 100 // Lego Mindstorm. |
| 101 arm_version_ = ARMv5TE; |
| 102 // TODO(zra): Verify with DGLogik that this is correct. |
| 103 store_pc_read_offset_ = 12; |
| 97 } else if (CpuInfo::FieldContains(kCpuInfoProcessor, "ARMv6") || | 104 } else if (CpuInfo::FieldContains(kCpuInfoProcessor, "ARMv6") || |
| 98 CpuInfo::FieldContains(kCpuInfoModel, "ARMv6")) { | 105 CpuInfo::FieldContains(kCpuInfoModel, "ARMv6")) { |
| 99 // Raspberry Pi, etc. | 106 // Raspberry Pi, etc. |
| 100 arm_version_ = ARMv6; | 107 arm_version_ = ARMv6; |
| 101 } else { | 108 } else { |
| 102 ASSERT(CpuInfo::FieldContains(kCpuInfoProcessor, "ARMv7") || | 109 ASSERT(CpuInfo::FieldContains(kCpuInfoProcessor, "ARMv7") || |
| 103 CpuInfo::FieldContains(kCpuInfoModel, "ARMv7")); | 110 CpuInfo::FieldContains(kCpuInfoModel, "ARMv7")); |
| 104 arm_version_ = ARMv7; | 111 arm_version_ = ARMv7; |
| 105 } | 112 } |
| 106 | 113 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 ASSERT(hardware_ != NULL); | 180 ASSERT(hardware_ != NULL); |
| 174 free(const_cast<char*>(hardware_)); | 181 free(const_cast<char*>(hardware_)); |
| 175 hardware_ = NULL; | 182 hardware_ = NULL; |
| 176 CpuInfo::Cleanup(); | 183 CpuInfo::Cleanup(); |
| 177 } | 184 } |
| 178 #endif // defined(HOST_ARCH_ARM) | 185 #endif // defined(HOST_ARCH_ARM) |
| 179 | 186 |
| 180 } // namespace dart | 187 } // namespace dart |
| 181 | 188 |
| 182 #endif // defined TARGET_ARCH_ARM | 189 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |