VirtualBox

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

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

EFI: First step in UDK2018 merge. Does not build yet.

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.5 KB
 
1/** @file
2 ACPI Timer implements one instance of Timer Library.
3
4 Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#include <Base.h>
16#include <Library/TimerLib.h>
17#include <Library/BaseLib.h>
18
19/**
20 Calculate TSC frequency.
21
22 The TSC counting frequency is determined by comparing how far it counts
23 during a 101.4 us period as determined by the ACPI timer.
24 The ACPI timer is used because it counts at a known frequency.
25 The TSC is sampled, followed by waiting 363 counts of the ACPI timer,
26 or 101.4 us. The TSC is then sampled again. The difference multiplied by
27 9861 is the TSC frequency. There will be a small error because of the
28 overhead of reading the ACPI timer. An attempt is made to determine and
29 compensate for this error.
30
31 @return The number of TSC counts per second.
32
33**/
34UINT64
35InternalCalculateTscFrequency (
36 VOID
37 );
38
39/**
40 Internal function to retrieves the 64-bit frequency in Hz.
41
42 Internal function to retrieves the 64-bit frequency in Hz.
43
44 @return The frequency in Hz.
45
46**/
47UINT64
48InternalGetPerformanceCounterFrequency (
49 VOID
50 )
51{
52 return InternalCalculateTscFrequency ();
53}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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