]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
ShellPkg/for: Fix potential null pointer deference
[mirror_edk2.git] / OvmfPkg / AcpiPlatformDxe / AcpiPlatform.h
CommitLineData
522203de 1/** @file\r
2 Sample ACPI Platform Driver\r
3\r
4 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
96bbdbc8 13**/\r
522203de 14\r
15#ifndef _ACPI_PLATFORM_H_INCLUDED_\r
16#define _ACPI_PLATFORM_H_INCLUDED_\r
17\r
18#include <PiDxe.h>\r
19\r
20#include <Protocol/AcpiTable.h>\r
21#include <Protocol/FirmwareVolume2.h>\r
8f35eb92 22#include <Protocol/PciIo.h>\r
522203de 23\r
24#include <Library/BaseLib.h>\r
25#include <Library/UefiBootServicesTableLib.h>\r
26#include <Library/DebugLib.h>\r
27#include <Library/PcdLib.h>\r
28\r
29#include <IndustryStandard/Acpi.h>\r
30\r
8f35eb92
LE
31typedef struct {\r
32 EFI_PCI_IO_PROTOCOL *PciIo;\r
33 UINT64 PciAttributes;\r
34} ORIGINAL_ATTRIBUTES;\r
35\r
df73df13
LE
36typedef struct S3_CONTEXT S3_CONTEXT;\r
37\r
522203de 38EFI_STATUS\r
39EFIAPI\r
40InstallAcpiTable (\r
41 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol,\r
42 IN VOID *AcpiTableBuffer,\r
43 IN UINTN AcpiTableBufferSize,\r
44 OUT UINTN *TableKey\r
45 );\r
46\r
47BOOLEAN\r
48QemuDetected (\r
49 VOID\r
50 );\r
51\r
52EFI_STATUS\r
53EFIAPI\r
54QemuInstallAcpiTable (\r
55 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol,\r
56 IN VOID *AcpiTableBuffer,\r
57 IN UINTN AcpiTableBufferSize,\r
58 OUT UINTN *TableKey\r
59 );\r
60\r
61BOOLEAN\r
62XenDetected (\r
63 VOID\r
64 );\r
65\r
66EFI_STATUS\r
67EFIAPI\r
377e758c 68InstallXenTables (\r
69 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol\r
522203de 70 );\r
71\r
96bbdbc8
LE
72EFI_STATUS\r
73EFIAPI\r
f186536b 74InstallQemuFwCfgTables (\r
96bbdbc8
LE
75 IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol\r
76 );\r
f186536b 77\r
04951644
LE
78EFI_STATUS\r
79EFIAPI\r
80InstallAcpiTables (\r
81 IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable\r
82 );\r
83\r
8f35eb92
LE
84VOID\r
85EnablePciDecoding (\r
86 OUT ORIGINAL_ATTRIBUTES **OriginalAttributes,\r
87 OUT UINTN *Count\r
88 );\r
89\r
90VOID\r
91RestorePciDecoding (\r
92 IN ORIGINAL_ATTRIBUTES *OriginalAttributes,\r
93 IN UINTN Count\r
94 );\r
95\r
df73df13
LE
96EFI_STATUS\r
97AllocateS3Context (\r
98 OUT S3_CONTEXT **S3Context,\r
99 IN UINTN WritePointerCount\r
100 );\r
101\r
102VOID\r
103ReleaseS3Context (\r
104 IN S3_CONTEXT *S3Context\r
105 );\r
106\r
107EFI_STATUS\r
108SaveCondensedWritePointerToS3Context (\r
109 IN OUT S3_CONTEXT *S3Context,\r
110 IN UINT16 PointerItem,\r
111 IN UINT8 PointerSize,\r
112 IN UINT32 PointerOffset,\r
113 IN UINT64 PointerValue\r
114 );\r
115\r
116EFI_STATUS\r
117TransferS3ContextToBootScript (\r
80576225 118 IN S3_CONTEXT *S3Context\r
df73df13
LE
119 );\r
120\r
522203de 121#endif\r
122\r