VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.c@ 85788

Last change on this file since 85788 was 80721, checked in by vboxsync, 6 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 946 bytes
Line 
1/** @file
2 CPUID Leaf 0x15 for Core Crystal Clock frequency instance as Base Timer Library.
3
4 Copyright (c) 2019 Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include <Base.h>
10#include <Library/TimerLib.h>
11#include <Library/BaseLib.h>
12
13/**
14 CPUID Leaf 0x15 for Core Crystal Clock Frequency.
15
16 The TSC counting frequency is determined by using CPUID leaf 0x15. Frequency in MHz = Core XTAL frequency * EBX/EAX.
17 In newer flavors of the CPU, core xtal frequency is returned in ECX or 0 if not supported.
18 @return The number of TSC counts per second.
19
20**/
21UINT64
22CpuidCoreClockCalculateTscFrequency (
23 VOID
24 );
25
26/**
27 Internal function to retrieves the 64-bit frequency in Hz.
28
29 Internal function to retrieves the 64-bit frequency in Hz.
30
31 @return The frequency in Hz.
32
33**/
34UINT64
35InternalGetPerformanceCounterFrequency (
36 VOID
37 )
38{
39 return CpuidCoreClockCalculateTscFrequency ();
40}
41
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette