TianoCore EDK2 master
Loading...
Searching...
No Matches
BaseCpuTimerLib.c File Reference
#include <Base.h>
#include <Library/TimerLib.h>
#include <Library/BaseLib.h>

Go to the source code of this file.

Functions

UINT64 CpuidCoreClockCalculateTscFrequency (VOID)
 
UINT64 InternalGetPerformanceCounterFrequency (VOID)
 

Detailed Description

CPUID Leaf 0x15 for Core Crystal Clock frequency instance as Base Timer Library.

Copyright (c) 2019 Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BaseCpuTimerLib.c.

Function Documentation

◆ CpuidCoreClockCalculateTscFrequency()

UINT64 CpuidCoreClockCalculateTscFrequency ( VOID  )

CPUID Leaf 0x15 for Core Crystal Clock Frequency.

The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency in MHz = Core XTAL frequency * EBX/EAX. In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if not supported.

Returns
The number of TSC counts per second.

Definition at line 42 of file CpuTimerLib.c.

◆ InternalGetPerformanceCounterFrequency()

UINT64 InternalGetPerformanceCounterFrequency ( VOID  )

Internal function to retrieves the 64-bit frequency in Hz.

Internal function to retrieves the 64-bit frequency in Hz.

Returns
The frequency in Hz.

Definition at line 35 of file BaseCpuTimerLib.c.