xref: /freebsd/sys/contrib/edk2/Include/Protocol/AcpiTable.h (revision e985c628a0e4082d9b953897d6f56c81d177cea7)
1 /** @file
2   The file provides the protocol to install or remove an ACPI
3   table from a platform.
4 
5   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8   @par Revision Reference:
9   This Protocol was introduced in UEFI Specification 2.3.
10 
11 **/
12 
13 #ifndef __ACPI_TABLE_H___
14 #define __ACPI_TABLE_H___
15 
16 #define EFI_ACPI_TABLE_PROTOCOL_GUID \
17   { 0xffe06bdd, 0x6107, 0x46a6, { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c }}
18 
19 typedef struct _EFI_ACPI_TABLE_PROTOCOL EFI_ACPI_TABLE_PROTOCOL;
20 
21 /**
22 
23   The InstallAcpiTable() function allows a caller to install an
24   ACPI table. When successful, the table will be linked by the
25   RSDT/XSDT. AcpiTableBuffer specifies the table to be installed.
26   InstallAcpiTable() will make a copy of the table and insert the
27   copy into the RSDT/XSDT. InstallAcpiTable() must insert the new
28   table at the end of the RSDT/XSDT. To prevent namespace
29   collision, ACPI tables may be created using UEFI ACPI table
30   format. If this protocol is used to install a table with a
31   signature already present in the system, the new table will not
32   replace the existing table. It is a platform implementation
33   decision to add a new table with a signature matching an
34   existing table or disallow duplicate table signatures and
35   return EFI_ACCESS_DENIED. On successful output, TableKey is
36   initialized with a unique key. Its value may be used in a
37   subsequent call to UninstallAcpiTable to remove an ACPI table.
38   If an EFI application is running at the time of this call, the
39   relevant EFI_CONFIGURATION_TABLE pointer to the RSDT is no
40   longer considered valid.
41 
42 
43   @param This                 A pointer to a EFI_ACPI_TABLE_PROTOCOL.
44 
45   @param AcpiTableBuffer      A pointer to a buffer containing the
46                               ACPI table to be installed.
47 
48   @param AcpiTableBufferSize  Specifies the size, in bytes, of
49                               the AcpiTableBuffer buffer.
50 
51 
52   @param TableKey             Returns a key to refer to the ACPI table.
53 
54   @retval EFI_SUCCESS           The table was successfully inserted
55 
56   @retval EFI_INVALID_PARAMETER Either AcpiTableBuffer is NULL,
57                                 TableKey is NULL, or
58                                 AcpiTableBufferSize and the size
59                                 field embedded in the ACPI table
60                                 pointed to by AcpiTableBuffer
61                                 are not in sync.
62 
63   @retval EFI_OUT_OF_RESOURCES  Insufficient resources exist to
64                                 complete the request.
65   @retval EFI_ACCESS_DENIED     The table signature matches a table already
66                                 present in the system and platform policy
67                                 does not allow duplicate tables of this type.
68 
69 **/
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE)(
73   IN   EFI_ACPI_TABLE_PROTOCOL       *This,
74   IN   VOID                          *AcpiTableBuffer,
75   IN   UINTN                         AcpiTableBufferSize,
76   OUT  UINTN                         *TableKey
77   );
78 
79 /**
80 
81   The UninstallAcpiTable() function allows a caller to remove an
82   ACPI table. The routine will remove its reference from the
83   RSDT/XSDT. A table is referenced by the TableKey parameter
84   returned from a prior call to InstallAcpiTable(). If an EFI
85   application is running at the time of this call, the relevant
86   EFI_CONFIGURATION_TABLE pointer to the RSDT is no longer
87   considered valid.
88 
89   @param This                   A pointer to a EFI_ACPI_TABLE_PROTOCOL.
90 
91   @param TableKey               Specifies the table to uninstall. The key was
92                                 returned from InstallAcpiTable().
93 
94   @retval EFI_SUCCESS           The table was successfully inserted
95 
96   @retval EFI_NOT_FOUND         TableKey does not refer to a valid key
97                                 for a table entry.
98 
99   @retval EFI_OUT_OF_RESOURCES  Insufficient resources exist to
100                                 complete the request.
101 
102 **/
103 typedef
104 EFI_STATUS
105 (EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE)(
106   IN  EFI_ACPI_TABLE_PROTOCOL       *This,
107   IN  UINTN                         TableKey
108   );
109 
110 ///
111 /// The EFI_ACPI_TABLE_PROTOCOL provides the ability for a component
112 /// to install and uninstall ACPI tables from a platform.
113 ///
114 struct _EFI_ACPI_TABLE_PROTOCOL {
115   EFI_ACPI_TABLE_INSTALL_ACPI_TABLE      InstallAcpiTable;
116   EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE    UninstallAcpiTable;
117 };
118 
119 extern EFI_GUID  gEfiAcpiTableProtocolGuid;
120 
121 #endif
122