VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c@ 105681

最後變更 在這個檔案從105681是 80721,由 vboxsync 提交於 6 年 前

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

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.2 KB
 
1/** @file
2 ACPI Timer implements one instance of Timer Library.
3
4 Copyright (c) 2013 - 2018, 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 Calculate TSC frequency.
15
16 The TSC counting frequency is determined by comparing how far it counts
17 during a 101.4 us period as determined by the ACPI timer.
18 The ACPI timer is used because it counts at a known frequency.
19 The TSC is sampled, followed by waiting 363 counts of the ACPI timer,
20 or 101.4 us. The TSC is then sampled again. The difference multiplied by
21 9861 is the TSC frequency. There will be a small error because of the
22 overhead of reading the ACPI timer. An attempt is made to determine and
23 compensate for this error.
24
25 @return The number of TSC counts per second.
26
27**/
28UINT64
29InternalCalculateTscFrequency (
30 VOID
31 );
32
33/**
34 Internal function to retrieves the 64-bit frequency in Hz.
35
36 Internal function to retrieves the 64-bit frequency in Hz.
37
38 @return The frequency in Hz.
39
40**/
41UINT64
42InternalGetPerformanceCounterFrequency (
43 VOID
44 )
45{
46 return InternalCalculateTscFrequency ();
47}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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