OpenCore
1.0.4
OpenCore Bootloader
|
#include <Library/OcCpuLib.h>
Go to the source code of this file.
Data Structures | |
struct | OC_CPU_TSC_SYNC |
Macros | |
#define | OC_CPU_FREQUENCY_TOLERANCE 50000000LL |
Functions | |
UINT32 EFIAPI | AsmReadIntelMicrocodeRevision (VOID) |
VOID EFIAPI | AsmMeasureTicks (IN UINT32 AcpiTicksDuration, IN UINT16 TimerAddr, OUT UINT32 *AcpiTicksDelta, OUT UINT64 *TscTicksDelta) |
UINT8 | InternalDetectAppleMajorType (IN CONST CHAR8 *BrandString) |
UINT16 | InternalDetectAppleProcessorType (IN UINT8 Model, IN UINT8 Stepping, IN UINT8 AppleMajorType, IN UINT16 CoreCount, IN BOOLEAN Is64Bit) |
OC_CPU_GENERATION | InternalDetectIntelProcessorGeneration (IN OC_CPU_INFO *CpuInfo) |
UINTN | InternalGetPmTimerAddr (OUT CONST CHAR8 **Type OPTIONAL) |
UINT64 | InternalCalculateTSCFromPMTimer (IN BOOLEAN Recalculate) |
UINT64 | InternalCalculateTSCFromApplePlatformInfo (OUT UINT64 *FSBFrequency OPTIONAL, IN BOOLEAN Recalculate) |
UINT64 | InternalCalculateARTFrequencyIntel (OUT UINT64 *CPUFrequency, OUT UINT64 *TscAdjustPtr OPTIONAL, IN BOOLEAN Recalculate) |
UINT64 | InternalCalculateVMTFrequency (OUT UINT64 *FSBFrequency OPTIONAL, OUT BOOLEAN *UnderHypervisor OPTIONAL) |
UINT64 | InternalConvertAppleFSBToTSCFrequency (IN UINT64 FSBFrequency) |
UINT32 EFIAPI | AsmIncrementUint32 (IN volatile UINT32 *Value) |
Copyright (C) 2020, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcCpuInternals.h.
#define OC_CPU_FREQUENCY_TOLERANCE 50000000LL |
Definition at line 24 of file OcCpuInternals.h.
UINT32 EFIAPI AsmIncrementUint32 | ( | IN volatile UINT32 * | Value | ) |
Atomically increment 32-bit integer. This is required to be locally implemented as we cannot use SynchronizationLib, which depends on TimerLib, and our TimerLib depends on this library.
[in] | Value | Pointer to 32-bit integer to increment. |
value | after incrementing. |
Definition at line 176 of file UserMisc.c.
VOID EFIAPI AsmMeasureTicks | ( | IN UINT32 | AcpiTicksDuration, |
IN UINT16 | TimerAddr, | ||
OUT UINT32 * | AcpiTicksDelta, | ||
OUT UINT64 * | TscTicksDelta ) |
Measures TSC and ACPI ticks over specified ACPI tick amount.
[in] | AcpiTicksDuration | Number of ACPI ticks for calculation. |
[in] | TimerAddr | ACPI timer address. |
[out] | AcpiTicksDelta | Reported ACPI ticks delta. |
[out] | TscTicksDelta | Reported TSC ticks delta. |
Definition at line 22 of file MeasureTicks.c.
UINT32 EFIAPI AsmReadIntelMicrocodeRevision | ( | VOID | ) |
Returns microcode revision for Intel CPUs.
microcode | revision. |
Definition at line 187 of file UserMisc.c.
UINT64 InternalCalculateARTFrequencyIntel | ( | OUT UINT64 * | CPUFrequency, |
OUT UINT64 *TscAdjustPtr | OPTIONAL, | ||
IN BOOLEAN | Recalculate ) |
Calculate the ART frequency and derieve the CPU frequency for Intel CPUs
[out] | CPUFrequency | The derieved CPU frequency. |
[out] | TscAdjustPtr | Adjustment value for TSC, optional. |
[in] | Recalculate | Do not re-use previously cached information. |
The | calculated ART frequency. |
Definition at line 474 of file FrequencyDetect.c.
UINT64 InternalCalculateTSCFromApplePlatformInfo | ( | OUT UINT64 *FSBFrequency | OPTIONAL, |
IN BOOLEAN | Recalculate ) |
Calculate the TSC frequency via Apple Platform Info
[out] | FSBFrequency | Updated FSB frequency, optional. |
[in] | Recalculate | Do not re-use previously cached information. |
The | calculated TSC frequency. |
Definition at line 345 of file FrequencyDetect.c.
UINT64 InternalCalculateTSCFromPMTimer | ( | IN BOOLEAN | Recalculate | ) |
Calculate the TSC frequency via PM timer
[in] | Recalculate | Do not re-use previously cached information. |
The | calculated TSC frequency. |
Definition at line 173 of file FrequencyDetect.c.
UINT64 InternalCalculateVMTFrequency | ( | OUT UINT64 *FSBFrequency | OPTIONAL, |
OUT BOOLEAN *UnderHypervisor | OPTIONAL ) |
Calculate the CPU frequency via VMT for hypervisors
[out] | FSBFrequency | FSB frequency, optional. |
[out] | UnderHypervisor | Hypervisor status, optional. |
CPU | frequency or 0. |
Definition at line 646 of file FrequencyDetect.c.
UINT64 InternalConvertAppleFSBToTSCFrequency | ( | IN UINT64 | FSBFrequency | ) |
Convert Apple FSB frequency to TSC frequency
[in] | FSBFrequency | Frequency in Apple FSB format. |
Converted | TSC frequency. |
Definition at line 383 of file OcCpuLib.c.
UINT8 InternalDetectAppleMajorType | ( | IN CONST CHAR8 * | BrandString | ) |
Detect Apple CPU major type.
[in] | BrandString | CPU Brand String from CPUID. |
Apple | CPU major type. |
Definition at line 26 of file AppleCpuSupport.c.
UINT16 InternalDetectAppleProcessorType | ( | IN UINT8 | Model, |
IN UINT8 | Stepping, | ||
IN UINT8 | AppleMajorType, | ||
IN UINT16 | CoreCount, | ||
IN BOOLEAN | Is64Bit ) |
Detect Apple CPU type.
[in] | Model | CPU model from CPUID. |
[in] | Stepping | CPU stepping from CPUID. |
[in] | AppleMajorType | Apple CPU major type. |
[in] | CoreCount | Number of physical cores. |
[in] | Is64Bit | CPU supports 64-bit mode. |
Apple | CPU type. |
Definition at line 132 of file AppleCpuSupport.c.
OC_CPU_GENERATION InternalDetectIntelProcessorGeneration | ( | IN OC_CPU_INFO * | CpuInfo | ) |
Obtain Intel CPU generation.
[in] | Model | CPU model from CPUID. |
CPU's | generation (e.g. OcCpuGenerationUnknown). |
Definition at line 1396 of file OcCpuLib.c.
UINTN InternalGetPmTimerAddr | ( | OUT CONST CHAR8 **Type | OPTIONAL | ) |
Obtain ACPI PM timer address for this BSP.
[out] | Type | Address source type, optional. |
ACPI | PM timer address or 0. |
Definition at line 46 of file FrequencyDetect.c.