OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 #else | 221 #else |
222 NOTREACHED(); | 222 NOTREACHED(); |
223 return 0; | 223 return 0; |
224 #endif | 224 #endif |
225 } | 225 } |
226 | 226 |
227 uint32_t SystemSnapshotMac::CPUX86Leaf7Features() const { | 227 uint32_t SystemSnapshotMac::CPUX86Leaf7Features() const { |
228 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 228 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
229 | 229 |
230 #if defined(ARCH_CPU_X86_FAMILY) | 230 #if defined(ARCH_CPU_X86_FAMILY) |
231 // The machdep.cpu.leaf7_feature_bits sysctl isn’t supported prior to Mac OS X | 231 // The machdep.cpu.leaf7_feature_bits sysctl isn’t supported prior to OS X |
232 // 10.7, so read this by calling cpuid directly. | 232 // 10.7, so read this by calling cpuid directly. |
233 // | 233 // |
234 // machdep.cpu.max_basic could be used to check whether to read the leaf, but | 234 // machdep.cpu.max_basic could be used to check whether to read the leaf, but |
235 // that sysctl isn’t supported prior to Mac OS X 10.6, so read the maximum | 235 // that sysctl isn’t supported prior to Mac OS X 10.6, so read the maximum |
236 // basic leaf by calling cpuid directly as well. All CPUs that Apple is known | 236 // basic leaf by calling cpuid directly as well. All CPUs that Apple is known |
237 // to have shipped should support a maximum basic leaf value of at least 0xa. | 237 // to have shipped should support a maximum basic leaf value of at least 0xa. |
238 uint32_t eax, ebx, ecx, edx; | 238 uint32_t eax, ebx, ecx, edx; |
239 CallCPUID(0, &eax, &ebx, &ecx, &edx); | 239 CallCPUID(0, &eax, &ebx, &ecx, &edx); |
240 if (eax < 7) { | 240 if (eax < 7) { |
241 return 0; | 241 return 0; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } else { | 390 } else { |
391 *daylight_name = tzname[0]; | 391 *daylight_name = tzname[0]; |
392 *dst_status = kDoesNotObserveDaylightSavingTime; | 392 *dst_status = kDoesNotObserveDaylightSavingTime; |
393 *standard_offset_seconds = local.tm_gmtoff; | 393 *standard_offset_seconds = local.tm_gmtoff; |
394 *daylight_offset_seconds = local.tm_gmtoff; | 394 *daylight_offset_seconds = local.tm_gmtoff; |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 } // namespace internal | 398 } // namespace internal |
399 } // namespace crashpad | 399 } // namespace crashpad |
OLD | NEW |