OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
fbarchard
2011/02/15 21:30:11
(c) 2011
| |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_CPU_H_ | 5 #ifndef BASE_CPU_H_ |
6 #define BASE_CPU_H_ | 6 #define BASE_CPU_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | |
10 | |
9 #include <string> | 11 #include <string> |
10 | 12 |
11 namespace base { | 13 namespace base { |
12 | 14 |
13 // Query information about the processor. | 15 // Query information about the processor. |
14 class CPU { | 16 class CPU { |
15 public: | 17 public: |
16 // Constructor | 18 // Constructor |
17 CPU(); | 19 CPU(); |
18 | 20 |
19 // Accessors for CPU information. | 21 // Accessors for CPU information. |
20 const std::string& vendor_name() const { return cpu_vendor_; } | 22 const std::string& vendor_name() const { return cpu_vendor_; } |
21 int stepping() const { return stepping_; } | 23 int stepping() const { return stepping_; } |
22 int model() const { return model_; } | 24 int model() const { return model_; } |
23 int family() const { return family_; } | 25 int family() const { return family_; } |
24 int type() const { return type_; } | 26 int type() const { return type_; } |
25 int extended_model() const { return ext_model_; } | 27 int extended_model() const { return ext_model_; } |
26 int extended_family() const { return ext_family_; } | 28 int extended_family() const { return ext_family_; } |
29 int has_sse2() const { return has_sse2_; } | |
27 | 30 |
28 private: | 31 private: |
29 // Query the processor for CPUID information. | 32 // Query the processor for CPUID information. |
30 void Initialize(); | 33 void Initialize(); |
31 | 34 |
32 int type_; // process type | 35 int type_; // process type |
33 int family_; // family of the processor | 36 int family_; // family of the processor |
34 int model_; // model of processor | 37 int model_; // model of processor |
35 int stepping_; // processor revision number | 38 int stepping_; // processor revision number |
36 int ext_model_; | 39 int ext_model_; |
37 int ext_family_; | 40 int ext_family_; |
41 bool has_sse2_; | |
38 std::string cpu_vendor_; | 42 std::string cpu_vendor_; |
39 }; | 43 }; |
40 | 44 |
41 } // namespace base | 45 } // namespace base |
42 | 46 |
43 #endif // BASE_CPU_H_ | 47 #endif // BASE_CPU_H_ |
OLD | NEW |