]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLibBhyve.c
OvmfPkg: Add bhyve support into AcpiTimerLib
[mirror_edk2.git] / OvmfPkg / Library / AcpiTimerLib / BaseAcpiTimerLibBhyve.c
CommitLineData
91dee771
RC
1/** @file\r
2 Provide InternalAcpiGetTimerTick for the bhyve instance of the\r
3 Base ACPI Timer Library\r
4\r
5 Copyright (C) 2020, Rebecca Cran <rebecca@bsdio.com>\r
6 Copyright (C) 2014, Gabriel L. Somlo <somlo@cmu.edu>\r
7\r
8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
9**/\r
10\r
11#include <Library/IoLib.h>\r
12#include <OvmfPlatforms.h>\r
13\r
14/**\r
15 Internal function to read the current tick counter of ACPI.\r
16\r
17 Read the current ACPI tick counter using the counter address cached\r
18 by this instance's constructor.\r
19\r
20 @return The tick counter read.\r
21\r
22**/\r
23UINT32\r
24InternalAcpiGetTimerTick (\r
25 VOID\r
26 )\r
27{\r
28 //\r
29 // Return the current ACPI timer value.\r
30 //\r
31 return IoRead32 (BHYVE_ACPI_TIMER_IO_ADDR);\r
32}\r