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