1 /** @file
2   This protocol provides some basic services to support publishing ACPI system tables. The
3   services handle many of the more mundane tasks that are required to publish a set of tables. The
4   services will:
5         - Generate common tables.
6 	- Update the table links.
7 	- Ensure that tables are properly aligned and use correct types of memory.
8 	- Update checksum values and IDs.
9 	- Complete the final installation of the tables.
10 
11 Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
12 This program and the accompanying materials are licensed and made available under
13 the terms and conditions of the BSD License that accompanies this distribution.
14 The full text of the license may be found at
15 http://opensource.org/licenses/bsd-license.php.
16 
17 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
18 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 
20   @par Revision Reference:
21   This Protocol is defined in Framework ACPI Specification.
22   Version 0.9.
23 
24 **/
25 
26 #ifndef _ACPI_SUPPORT_PROTOCOL_H_
27 #define _ACPI_SUPPORT_PROTOCOL_H_
28 
29 #include <Protocol/AcpiSystemDescriptionTable.h>
30 
31 typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;
32 
33 //
34 // ACPI Support Protocol GUID
35 //
36 #define EFI_ACPI_SUPPORT_GUID \
37   { \
38     0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \
39   }
40 
41 
42 //
43 // Protocol Member Functions
44 //
45 
46 /**
47   Returns a requested ACPI table.
48 
49   @param  This                  A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
50   @param  Index                 The zero-based index of the table to retrieve.
51   @param  Table                 The pointer for returning the table buffer.
52   @param  Version               Updated with the ACPI versions to which this table belongs.
53   @param  Handle                The pointer for identifying the table.
54 
55   @retval EFI_SUCCESS           The function completed successfully.
56   @retval EFI_NOT_FOUND         The requested index is too large and a table was not found.
57 
58 **/
59 typedef
60 EFI_STATUS
61 (EFIAPI *EFI_ACPI_GET_ACPI_TABLE)(
62   IN EFI_ACPI_SUPPORT_PROTOCOL            *This,
63   IN INTN                                 Index,
64   OUT VOID                                **Table,
65   OUT EFI_ACPI_TABLE_VERSION              *Version,
66   OUT UINTN                               *Handle
67   );
68 
69 /**
70   Used to add, remove, or update ACPI tables.
71 
72   @param  This                  A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
73   @param  Table                 The pointer to the new table to add or update.
74   @param  Checksum              If TRUE, indicates that the checksum should be
75                                 calculated for this table.
76   @param  Version               Indicates to which version(s) of ACPI the table should be added.
77   @param  Handle                The pointer to the handle of the table to remove or update.
78 
79   @retval EFI_SUCCESS           The function completed successfully.
80   @retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.
81   @retval EFI_ABORTED           Could not complete the desired action.
82 
83 **/
84 typedef
85 EFI_STATUS
86 (EFIAPI *EFI_ACPI_SET_ACPI_TABLE)(
87   IN EFI_ACPI_SUPPORT_PROTOCOL            *This,
88   IN VOID                                 *Table OPTIONAL,
89   IN BOOLEAN                              Checksum,
90   IN EFI_ACPI_TABLE_VERSION               Version,
91   IN OUT UINTN                            *Handle
92   );
93 
94 /**
95   Causes one or more versions of the ACPI tables to be published in
96   the EFI system configuration tables.
97 
98   The PublishTables() function installs the ACPI tables for the versions that are specified in
99   Version. No tables are published for Version equal to EFI_ACPI_VERSION_NONE. Once
100   published, tables will continue to be updated as tables are modified with
101   EFI_ACPI_SUPPORT_PROTOCOL.SetAcpiTable().
102 
103   @param  This                  A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
104   @param  Version               Indicates to which version(s) of ACPI the table should be published.
105 
106   @retval EFI_SUCCESS           The function completed successfully.
107   @retval EFI_ABORTED           An error occurred and the function could not complete successfully.
108 
109 **/
110 typedef
111 EFI_STATUS
112 (EFIAPI *EFI_ACPI_PUBLISH_TABLES)(
113   IN EFI_ACPI_SUPPORT_PROTOCOL            *This,
114   IN EFI_ACPI_TABLE_VERSION               Version
115   );
116 
117 //
118 // ACPI Support Protocol
119 //
120 /**
121   This protocol provides some basic services to support publishing ACPI system
122   tables. The services handle many of the more mundane tasks that are required
123   to publish a set of tables.
124 **/
125 struct _EFI_ACPI_SUPPORT_PROTOCOL {
126   ///
127   /// Returns a table specified by an index if it exists.
128   ///
129   EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;
130 
131   ///
132   /// Adds, removes, or updates ACPI tables.
133   ///
134   EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;
135 
136   ///
137   /// Publishes the ACPI tables.
138   ///
139   EFI_ACPI_PUBLISH_TABLES PublishTables;
140 };
141 
142 //
143 // Extern the GUID for protocol users.
144 //
145 extern EFI_GUID gEfiAcpiSupportProtocolGuid;
146 
147 #endif
148 
149