]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/XenAcpiPlatformDxe/AcpiPlatform.h
OvmfPkg/XenAcpiPlatformDxe: create from AcpiPlatformDxe
[mirror_edk2.git] / OvmfPkg / XenAcpiPlatformDxe / AcpiPlatform.h
1 /** @file
2 OVMF ACPI Platform Driver for Xen guests
3
4 Copyright (C) 2021, Red Hat, Inc.
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_
11 #define ACPI_PLATFORM_H_
12
13 #include <Protocol/AcpiTable.h> // EFI_ACPI_TABLE_PROTOCOL
14 #include <Protocol/PciIo.h> // EFI_PCI_IO_PROTOCOL
15
16 typedef struct {
17 EFI_PCI_IO_PROTOCOL *PciIo;
18 UINT64 PciAttributes;
19 } ORIGINAL_ATTRIBUTES;
20
21 typedef struct S3_CONTEXT S3_CONTEXT;
22
23 EFI_STATUS
24 EFIAPI
25 InstallAcpiTable (
26 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol,
27 IN VOID *AcpiTableBuffer,
28 IN UINTN AcpiTableBufferSize,
29 OUT UINTN *TableKey
30 );
31
32 BOOLEAN
33 QemuDetected (
34 VOID
35 );
36
37 EFI_STATUS
38 EFIAPI
39 QemuInstallAcpiTable (
40 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol,
41 IN VOID *AcpiTableBuffer,
42 IN UINTN AcpiTableBufferSize,
43 OUT UINTN *TableKey
44 );
45
46 EFI_STATUS
47 EFIAPI
48 InstallXenTables (
49 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol
50 );
51
52 EFI_STATUS
53 EFIAPI
54 InstallQemuFwCfgTables (
55 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol
56 );
57
58 EFI_STATUS
59 EFIAPI
60 InstallAcpiTables (
61 IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable
62 );
63
64 VOID
65 EnablePciDecoding (
66 OUT ORIGINAL_ATTRIBUTES **OriginalAttributes,
67 OUT UINTN *Count
68 );
69
70 VOID
71 RestorePciDecoding (
72 IN ORIGINAL_ATTRIBUTES *OriginalAttributes,
73 IN UINTN Count
74 );
75
76 EFI_STATUS
77 AllocateS3Context (
78 OUT S3_CONTEXT **S3Context,
79 IN UINTN WritePointerCount
80 );
81
82 VOID
83 ReleaseS3Context (
84 IN S3_CONTEXT *S3Context
85 );
86
87 EFI_STATUS
88 SaveCondensedWritePointerToS3Context (
89 IN OUT S3_CONTEXT *S3Context,
90 IN UINT16 PointerItem,
91 IN UINT8 PointerSize,
92 IN UINT32 PointerOffset,
93 IN UINT64 PointerValue
94 );
95
96 EFI_STATUS
97 TransferS3ContextToBootScript (
98 IN S3_CONTEXT *S3Context
99 );
100
101 #endif
102