1 /** @file
2   bhyve ACPI Platform Driver
3 
4   Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
5   Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 
10 #ifndef _ACPI_PLATFORM_H_INCLUDED_
11 #define _ACPI_PLATFORM_H_INCLUDED_
12 
13 #include <PiDxe.h>
14 #include <Protocol/AcpiTable.h>
15 #include <Protocol/FirmwareVolume2.h>
16 #include <Protocol/PciIo.h>
17 #include <Library/BaseLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/PcdLib.h>
20 #include <Library/UefiBootServicesTableLib.h>
21 #include <Library/XenPlatformLib.h>
22 #include <IndustryStandard/Acpi.h>
23 
24 typedef struct {
25   EFI_PCI_IO_PROTOCOL *PciIo;
26   UINT64              PciAttributes;
27 } ORIGINAL_ATTRIBUTES;
28 
29 typedef struct S3_CONTEXT S3_CONTEXT;
30 
31 EFI_STATUS
32 EFIAPI
33 InstallAcpiTable (
34   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol,
35   IN   VOID                          *AcpiTableBuffer,
36   IN   UINTN                         AcpiTableBufferSize,
37   OUT  UINTN                         *TableKey
38   );
39 
40 EFI_STATUS
41 EFIAPI
42 BhyveInstallAcpiTable(
43   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol,
44   IN   VOID                          *AcpiTableBuffer,
45   IN   UINTN                         AcpiTableBufferSize,
46   OUT  UINTN                         *TableKey
47   );
48 
49 EFI_STATUS
50 EFIAPI
51 InstallXenTables (
52   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
53   );
54 
55 EFI_STATUS
56 EFIAPI
57 InstallAcpiTables (
58   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiTable
59   );
60 
61 VOID
62 EnablePciDecoding (
63   OUT ORIGINAL_ATTRIBUTES **OriginalAttributes,
64   OUT UINTN               *Count
65   );
66 
67 VOID
68 RestorePciDecoding (
69   IN ORIGINAL_ATTRIBUTES *OriginalAttributes,
70   IN UINTN               Count
71   );
72 
73 #endif /* _ACPI_PLATFORM_H_INCLUDED_ */
74