• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 EFI_STATUS
37 EFIAPI
38 InstallAcpiTable (
39   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol,
40   IN   VOID                          *AcpiTableBuffer,
41   IN   UINTN                         AcpiTableBufferSize,
42   OUT  UINTN                         *TableKey
43   );
44 
45 BOOLEAN
46 QemuDetected (
47   VOID
48   );
49 
50 EFI_STATUS
51 EFIAPI
52 QemuInstallAcpiTable (
53   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol,
54   IN   VOID                          *AcpiTableBuffer,
55   IN   UINTN                         AcpiTableBufferSize,
56   OUT  UINTN                         *TableKey
57   );
58 
59 BOOLEAN
60 XenDetected (
61   VOID
62   );
63 
64 EFI_STATUS
65 EFIAPI
66 InstallXenTables (
67   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
68   );
69 
70 EFI_STATUS
71 EFIAPI
72 InstallQemuFwCfgTables (
73   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiProtocol
74   );
75 
76 EFI_STATUS
77 EFIAPI
78 InstallAcpiTables (
79   IN   EFI_ACPI_TABLE_PROTOCOL       *AcpiTable
80   );
81 
82 VOID
83 EnablePciDecoding (
84   OUT ORIGINAL_ATTRIBUTES **OriginalAttributes,
85   OUT UINTN               *Count
86   );
87 
88 VOID
89 RestorePciDecoding (
90   IN ORIGINAL_ATTRIBUTES *OriginalAttributes,
91   IN UINTN               Count
92   );
93 
94 #endif
95 
96