OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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(HOST_OS_ANDROID) | 6 #if defined(HOST_OS_ANDROID) |
7 | 7 |
8 #include "vm/cpuinfo.h" | 8 #include "vm/cpuinfo.h" |
9 #include "vm/proccpuinfo.h" | 9 #include "vm/proccpuinfo.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 fields_[kCpuInfoProcessor] = "Processor"; | 30 fields_[kCpuInfoProcessor] = "Processor"; |
31 fields_[kCpuInfoModel] = "model name"; | 31 fields_[kCpuInfoModel] = "model name"; |
32 fields_[kCpuInfoHardware] = "Hardware"; | 32 fields_[kCpuInfoHardware] = "Hardware"; |
33 fields_[kCpuInfoFeatures] = "Features"; | 33 fields_[kCpuInfoFeatures] = "Features"; |
34 fields_[kCpuInfoArchitecture] = "CPU architecture"; | 34 fields_[kCpuInfoArchitecture] = "CPU architecture"; |
35 #else | 35 #else |
36 #error Unrecognized target architecture | 36 #error Unrecognized target architecture |
37 #endif | 37 #endif |
38 } | 38 } |
39 | 39 |
40 | |
41 void CpuInfo::Cleanup() { | 40 void CpuInfo::Cleanup() { |
42 ProcCpuInfo::Cleanup(); | 41 ProcCpuInfo::Cleanup(); |
43 } | 42 } |
44 | 43 |
45 | |
46 bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) { | 44 bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) { |
47 ASSERT(method_ != kCpuInfoDefault); | 45 ASSERT(method_ != kCpuInfoDefault); |
48 return ProcCpuInfo::FieldContains(FieldName(idx), search_string); | 46 return ProcCpuInfo::FieldContains(FieldName(idx), search_string); |
49 } | 47 } |
50 | 48 |
51 | |
52 const char* CpuInfo::ExtractField(CpuInfoIndices idx) { | 49 const char* CpuInfo::ExtractField(CpuInfoIndices idx) { |
53 ASSERT(method_ != kCpuInfoDefault); | 50 ASSERT(method_ != kCpuInfoDefault); |
54 return ProcCpuInfo::ExtractField(FieldName(idx)); | 51 return ProcCpuInfo::ExtractField(FieldName(idx)); |
55 } | 52 } |
56 | 53 |
57 | |
58 bool CpuInfo::HasField(const char* field) { | 54 bool CpuInfo::HasField(const char* field) { |
59 ASSERT(method_ != kCpuInfoDefault); | 55 ASSERT(method_ != kCpuInfoDefault); |
60 return ProcCpuInfo::HasField(field); | 56 return ProcCpuInfo::HasField(field); |
61 } | 57 } |
62 | 58 |
63 } // namespace dart | 59 } // namespace dart |
64 | 60 |
65 #endif // defined(HOST_OS_ANDROID) | 61 #endif // defined(HOST_OS_ANDROID) |
OLD | NEW |