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