Chromium Code Reviews| 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_OS_LINUX) | 6 #if defined(TARGET_OS_LINUX) |
| 7 | 7 |
| 8 #include "vm/cpuinfo.h" | 8 #include "vm/cpuinfo.h" |
| 9 #include "vm/cpuid.h" | 9 #include "vm/cpuid.h" |
| 10 #include "vm/proccpuinfo.h" | 10 #include "vm/proccpuinfo.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 fields_[kCpuInfoFeatures] = "Features"; | 35 fields_[kCpuInfoFeatures] = "Features"; |
| 36 method_ = kCpuInfoSystem; | 36 method_ = kCpuInfoSystem; |
| 37 ProcCpuInfo::InitOnce(); | 37 ProcCpuInfo::InitOnce(); |
| 38 #elif defined(HOST_ARCH_MIPS) | 38 #elif defined(HOST_ARCH_MIPS) |
| 39 fields_[kCpuInfoProcessor] = "system type"; | 39 fields_[kCpuInfoProcessor] = "system type"; |
| 40 fields_[kCpuInfoModel] = "cpu model"; | 40 fields_[kCpuInfoModel] = "cpu model"; |
| 41 fields_[kCpuInfoHardware] = "cpu model"; | 41 fields_[kCpuInfoHardware] = "cpu model"; |
| 42 fields_[kCpuInfoFeatures] = "ASEs implemented"; | 42 fields_[kCpuInfoFeatures] = "ASEs implemented"; |
| 43 method_ = kCpuInfoSystem; | 43 method_ = kCpuInfoSystem; |
| 44 ProcCpuInfo::InitOnce(); | 44 ProcCpuInfo::InitOnce(); |
| 45 #elif defined(HOST_ARCH_ARM64) | |
|
regis
2014/05/27 17:59:57
You could factor this section with HOST_ARCH_ARM (
zra
2014/05/27 18:05:00
Done.
| |
| 46 // TODO(zra): Verify that these field names are correct. | |
| 47 fields_[kCpuInfoProcessor] = "Processor"; | |
| 48 fields_[kCpuInfoModel] = "model name"; | |
| 49 fields_[kCpuInfoHardware] = "Hardware"; | |
| 50 fields_[kCpuInfoFeatures] = "Features"; | |
| 51 method_ = kCpuInfoSystem; | |
| 52 ProcCpuInfo::InitOnce(); | |
| 45 #else | 53 #else |
| 46 #error Unrecognized target architecture | 54 #error Unrecognized target architecture |
| 47 #endif | 55 #endif |
| 48 } | 56 } |
| 49 | 57 |
| 50 | 58 |
| 51 void CpuInfo::Cleanup() { | 59 void CpuInfo::Cleanup() { |
| 52 if (method_ == kCpuInfoCpuId) { | 60 if (method_ == kCpuInfoCpuId) { |
| 53 CpuId::Cleanup(); | 61 CpuId::Cleanup(); |
| 54 } else { | 62 } else { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 (strcmp(field, fields_[kCpuInfoFeatures]) == 0); | 127 (strcmp(field, fields_[kCpuInfoFeatures]) == 0); |
| 120 } else { | 128 } else { |
| 121 ASSERT(method_ == kCpuInfoSystem); | 129 ASSERT(method_ == kCpuInfoSystem); |
| 122 return ProcCpuInfo::HasField(field); | 130 return ProcCpuInfo::HasField(field); |
| 123 } | 131 } |
| 124 } | 132 } |
| 125 | 133 |
| 126 } // namespace dart | 134 } // namespace dart |
| 127 | 135 |
| 128 #endif // defined(TARGET_OS_LINUX) | 136 #endif // defined(TARGET_OS_LINUX) |
| OLD | NEW |