8602b67f85822671cf6113e0c7a7a6b53ed9155b
[mirror_edk2.git] / MdePkg / Include / Protocol / AcpiSupport.h
1 /** @file
2 Definition of the ACPI Support protocol.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. 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 Module Name: AcpiSupport.h
14
15 @par Revision Reference:
16 This is defined in the ACPI Specification 0.9.
17
18 **/
19
20 #ifndef _ACPI_SUPPORT_PROTOCOL_H_
21 #define _ACPI_SUPPORT_PROTOCOL_H_
22
23 typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;
24
25 //
26 // ACPI Support Protocol GUID
27 //
28 #define EFI_ACPI_SUPPORT_GUID \
29 { \
30 0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \
31 }
32
33 //
34 // Protocol Data Definitions
35 //
36 //
37 // ACPI Version bitmap definition:
38 //
39 // EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b
40 // EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0
41 // EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0
42 // EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions. This might be used
43 // to create memory-based operation regions or other information
44 // that is not part of the ACPI "tree" but must still be found
45 // in ACPI memory space and/or managed by the core ACPI driver.
46 //
47 // Note that EFI provides discrete GUIDs for each version of ACPI
48 // that is supported. It is expected that each EFI GUIDed
49 // version of ACPI will also have a corresponding bitmap
50 // definition. This allows maintenance of separate ACPI trees
51 // for each distinctly different version of ACPI.
52 //
53 #define EFI_ACPI_TABLE_VERSION UINT32
54
55 #define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
56 #define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
57 #define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
58 #define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
59
60 //
61 // Protocol Member Functions
62 //
63
64 /**
65 Returns a requested ACPI table.
66
67 @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
68
69 @param Index The zero-based index of the table to retrieve.
70
71 @param Table Pointer for returning the table buffer.
72
73 @param Version Updated with the ACPI versions to which this table belongs.
74
75 @param Handle Pointer for identifying the table.
76
77 @retval EFI_SUCCESS The function completed successfully.
78
79 @retval EFI_NOT_FOUND The requested index is too large and a table was not found.
80
81 **/
82 typedef
83 EFI_STATUS
84 (EFIAPI *EFI_ACPI_GET_ACPI_TABLE) (
85 IN EFI_ACPI_SUPPORT_PROTOCOL *This,
86 IN INTN Index,
87 OUT VOID **Table,
88 OUT EFI_ACPI_TABLE_VERSION *Version,
89 OUT UINTN *Handle
90 );
91
92 /**
93 Used to add, remove, or update ACPI tables.
94
95 @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
96
97 @param Table Pointer to the new table to add or update.
98
99 @param Checksum If TRUE, indicates that the checksum should be
100 calculated for this table.
101
102 @param Version Indicates to which version(s) of ACPI the table should be added.
103
104 @param Pointer to the handle of the table to remove or update.
105
106 @retval EFI_SUCCESS The function completed successfully.
107
108 @retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.
109
110 @retval EFI_ABORTED Could not complete the desired action.
111
112 **/
113 typedef
114 EFI_STATUS
115 (EFIAPI *EFI_ACPI_SET_ACPI_TABLE) (
116 IN EFI_ACPI_SUPPORT_PROTOCOL *This,
117 IN VOID *Table OPTIONAL,
118 IN BOOLEAN Checksum,
119 IN EFI_ACPI_TABLE_VERSION Version,
120 IN OUT UINTN *Handle
121 );
122
123 /**
124 Causes one or more versions of the ACPI tables to be published in
125 the EFI system configuration tables.
126
127 @param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
128
129 @param Version Indicates to which version(s) of ACPI that the table should be published.
130
131 @retval EFI_SUCCESS The function completed successfully.
132
133 @retval EFI_ABORTED An error occurred and the function could not complete successfully.
134
135 **/
136 typedef
137 EFI_STATUS
138 (EFIAPI *EFI_ACPI_PUBLISH_TABLES) (
139 IN EFI_ACPI_SUPPORT_PROTOCOL *This,
140 IN EFI_ACPI_TABLE_VERSION Version
141 );
142
143 //
144 // ACPI Support Protocol
145 //
146 /**
147 @par Protocol Description:
148 This protocol provides some basic services to support publishing ACPI system
149 tables. The services handle many of the more mundane tasks that are required
150 to publish a set of tables.
151
152 @param GetAcpiTable
153 Returns a table specified by an index if it exists.
154
155 @param SetAcpiTable
156 Adds, removes, or updates ACPI tables
157
158 @param PublishTables
159 Publishes the ACPI tables.
160
161 **/
162 struct _EFI_ACPI_SUPPORT_PROTOCOL {
163 EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;
164 EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;
165 EFI_ACPI_PUBLISH_TABLES PublishTables;
166 };
167
168 //
169 // Extern the GUID for protocol users.
170 //
171 extern EFI_GUID gEfiAcpiSupportGuid;
172
173 #endif