Kaynağa Gözat

[efi] Add EFI_ACPI_TABLE_PROTOCOL header and GUID definition

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 yıl önce
ebeveyn
işleme
553f485734

+ 129
- 0
src/include/ipxe/efi/Protocol/AcpiTable.h Dosyayı Görüntüle

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

+ 1
- 0
src/include/ipxe/efi/efi.h Dosyayı Görüntüle

@@ -157,6 +157,7 @@ struct efi_config_table {
157 157
 #define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc )
158 158
 
159 159
 extern EFI_GUID efi_absolute_pointer_protocol_guid;
160
+extern EFI_GUID efi_acpi_table_protocol_guid;
160 161
 extern EFI_GUID efi_apple_net_boot_protocol_guid;
161 162
 extern EFI_GUID efi_arp_protocol_guid;
162 163
 extern EFI_GUID efi_arp_service_binding_protocol_guid;

+ 2
- 0
src/interface/efi/efi_debug.c Dosyayı Görüntüle

@@ -71,6 +71,8 @@ struct efi_well_known_guid {
71 71
 static struct efi_well_known_guid efi_well_known_guids[] = {
72 72
 	{ &efi_absolute_pointer_protocol_guid,
73 73
 	  "AbsolutePointer" },
74
+	{ &efi_acpi_table_protocol_guid,
75
+	  "AcpiTable" },
74 76
 	{ &efi_apple_net_boot_protocol_guid,
75 77
 	  "AppleNetBoot" },
76 78
 	{ &efi_arp_protocol_guid,

+ 5
- 0
src/interface/efi/efi_guid.c Dosyayı Görüntüle

@@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25 25
 
26 26
 #include <ipxe/efi/efi.h>
27 27
 #include <ipxe/efi/Protocol/AbsolutePointer.h>
28
+#include <ipxe/efi/Protocol/AcpiTable.h>
28 29
 #include <ipxe/efi/Protocol/AppleNetBoot.h>
29 30
 #include <ipxe/efi/Protocol/Arp.h>
30 31
 #include <ipxe/efi/Protocol/BlockIo.h>
@@ -86,6 +87,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
86 87
 EFI_GUID efi_absolute_pointer_protocol_guid
87 88
 	= EFI_ABSOLUTE_POINTER_PROTOCOL_GUID;
88 89
 
90
+/** ACPI table protocol GUID */
91
+EFI_GUID efi_acpi_table_protocl_guid
92
+	= EFI_ACPI_TABLE_PROTOCOL_GUID;
93
+
89 94
 /** Apple NetBoot protocol GUID */
90 95
 EFI_GUID efi_apple_net_boot_protocol_guid
91 96
 	= EFI_APPLE_NET_BOOT_PROTOCOL_GUID;

Loading…
İptal
Kaydet