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