]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Library/FrameworkUefiLib/Acpi.c
IntelFrameworkPkg FrameworkUefiLib: Add new EfiLocateXXXAcpiTable APIs
[mirror_edk2.git] / IntelFrameworkPkg / Library / FrameworkUefiLib / Acpi.c
1 /** @file
2 This module provides help function for finding ACPI table.
3
4 Copyright (c) 2018, Intel Corporation. All rights reserved.<BR>
5 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 **/
14
15 #include "UefiLibInternal.h"
16 #include <IndustryStandard/Acpi.h>
17
18 /**
19 This function locates next ACPI table in XSDT/RSDT based on Signature and
20 previous returned Table.
21
22 If PreviousTable is NULL:
23 This function will locate the first ACPI table in XSDT/RSDT based on
24 Signature in gEfiAcpi20TableGuid system configuration table first, and then
25 gEfiAcpi10TableGuid system configuration table.
26 This function will locate in XSDT first, and then RSDT.
27 For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in
28 FADT.
29 For FACS, this function will locate XFirmwareCtrl in FADT first, and then
30 FirmwareCtrl in FADT.
31
32 If PreviousTable is not NULL:
33 1. If it could be located in XSDT in gEfiAcpi20TableGuid system configuration
34 table, then this function will just locate next table in XSDT in
35 gEfiAcpi20TableGuid system configuration table.
36 2. If it could be located in RSDT in gEfiAcpi20TableGuid system configuration
37 table, then this function will just locate next table in RSDT in
38 gEfiAcpi20TableGuid system configuration table.
39 3. If it could be located in RSDT in gEfiAcpi10TableGuid system configuration
40 table, then this function will just locate next table in RSDT in
41 gEfiAcpi10TableGuid system configuration table.
42
43 It's not supported that PreviousTable is not NULL but PreviousTable->Signature
44 is not same with Signature, NULL will be returned.
45
46 @param Signature ACPI table signature.
47 @param PreviousTable Pointer to previous returned table to locate next
48 table, or NULL to locate first table.
49
50 @return Next ACPI table or NULL if not found.
51
52 **/
53 EFI_ACPI_COMMON_HEADER *
54 EFIAPI
55 EfiLocateNextAcpiTable (
56 IN UINT32 Signature,
57 IN EFI_ACPI_COMMON_HEADER *PreviousTable OPTIONAL
58 )
59 {
60 ASSERT (FALSE);
61 return NULL;
62 }
63
64 /**
65 This function locates first ACPI table in XSDT/RSDT based on Signature.
66
67 This function will locate the first ACPI table in XSDT/RSDT based on
68 Signature in gEfiAcpi20TableGuid system configuration table first, and then
69 gEfiAcpi10TableGuid system configuration table.
70 This function will locate in XSDT first, and then RSDT.
71 For DSDT, this function will locate XDsdt in FADT first, and then Dsdt in
72 FADT.
73 For FACS, this function will locate XFirmwareCtrl in FADT first, and then
74 FirmwareCtrl in FADT.
75
76 @param Signature ACPI table signature.
77
78 @return First ACPI table or NULL if not found.
79
80 **/
81 EFI_ACPI_COMMON_HEADER *
82 EFIAPI
83 EfiLocateFirstAcpiTable (
84 IN UINT32 Signature
85 )
86 {
87 return EfiLocateNextAcpiTable (Signature, NULL);
88 }