VirtualBox

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

Last change on this file since 58466 was 58466, checked in by vboxsync, 9 years ago

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1/** @file
2 ACPI Timer implements one instance of Timer Library.
3
4 Copyright (c) 2013 - 2014, 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// Cached performance counter frequency
21//
22UINT64 mPerformanceCounterFrequency = 0;
23
24/**
25 Internal function to retrieves the 64-bit frequency in Hz.
26
27 Internal function to retrieves the 64-bit frequency in Hz.
28
29 @return The frequency in Hz.
30
31**/
32UINT64
33InternalGetPerformanceCounterFrequency (
34 VOID
35 )
36{
37 BOOLEAN InterruptState;
38 UINT64 Count;
39
40 if (mPerformanceCounterFrequency == 0) {
41 InterruptState = SaveAndDisableInterrupts ();
42 Count = GetPerformanceCounter ();
43 MicroSecondDelay (100);
44 mPerformanceCounterFrequency = MultU64x32 (GetPerformanceCounter () - Count, 10000);
45 SetInterruptState (InterruptState);
46 }
47 return mPerformanceCounterFrequency;
48}
Note: See TracBrowser for help on using the repository browser.

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