]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c
MdeModulePkg/FaultTolerantWriteDxe: implement standalone MM version
[mirror_edk2.git] / IntelFrameworkPkg / Library / FrameworkUefiLib / Acpi.c
CommitLineData
c1a00d09
SZ
1/** @file\r
2 This module provides help function for finding ACPI table.\r
3\r
4 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>\r
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "UefiLibInternal.h"\r
16#include <IndustryStandard/Acpi.h>\r
17\r
18/**\r
19 This function locates next ACPI table in XSDT/RSDT based on Signature and\r
20 previous returned Table.\r
21\r
22 If PreviousTable is NULL:\r
23 This function will locate the first ACPI table in XSDT/RSDT based on\r
24 Signature in gEfiAcpi20TableGuid system configuration table first, and then\r
25 gEfiAcpi10TableGuid system configuration table.\r
26 This function will locate in XSDT first, and then RSDT.\r
27 For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in\r
28 FADT.\r
29 For FACS, this function will locate XFirmwareCtrl in FADT first, and then\r
30 FirmwareCtrl in FADT.\r
31\r
32 If PreviousTable is not NULL:\r
33 1. If it could be located in XSDT in gEfiAcpi20TableGuid system configuration\r
34 table, then this function will just locate next table in XSDT in\r
35 gEfiAcpi20TableGuid system configuration table.\r
36 2. If it could be located in RSDT in gEfiAcpi20TableGuid system configuration\r
37 table, then this function will just locate next table in RSDT in\r
38 gEfiAcpi20TableGuid system configuration table.\r
39 3. If it could be located in RSDT in gEfiAcpi10TableGuid system configuration\r
40 table, then this function will just locate next table in RSDT in\r
41 gEfiAcpi10TableGuid system configuration table.\r
42\r
43 It's not supported that PreviousTable is not NULL but PreviousTable->Signature\r
44 is not same with Signature, NULL will be returned.\r
45\r
46 @param Signature ACPI table signature.\r
47 @param PreviousTable Pointer to previous returned table to locate next\r
48 table, or NULL to locate first table.\r
49\r
50 @return Next ACPI table or NULL if not found.\r
51\r
52**/\r
53EFI_ACPI_COMMON_HEADER *\r
54EFIAPI\r
55EfiLocateNextAcpiTable (\r
56 IN UINT32 Signature,\r
57 IN EFI_ACPI_COMMON_HEADER *PreviousTable OPTIONAL\r
58 )\r
59{\r
60 ASSERT (FALSE);\r
61 return NULL;\r
62}\r
63\r
64/**\r
65 This function locates first ACPI table in XSDT/RSDT based on Signature.\r
66\r
67 This function will locate the first ACPI table in XSDT/RSDT based on\r
68 Signature in gEfiAcpi20TableGuid system configuration table first, and then\r
69 gEfiAcpi10TableGuid system configuration table.\r
70 This function will locate in XSDT first, and then RSDT.\r
71 For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in\r
72 FADT.\r
73 For FACS, this function will locate XFirmwareCtrl in FADT first, and then\r
74 FirmwareCtrl in FADT.\r
75\r
76 @param Signature ACPI table signature.\r
77\r
78 @return First ACPI table or NULL if not found.\r
79\r
80**/\r
81EFI_ACPI_COMMON_HEADER *\r
82EFIAPI\r
83EfiLocateFirstAcpiTable (\r
84 IN UINT32 Signature\r
85 )\r
86{\r
87 return EfiLocateNextAcpiTable (Signature, NULL);\r
88}\r