]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Include/Library/AcpiLib.h
EmbeddedPkg: Introduced AcpiLib
[mirror_edk2.git] / EmbeddedPkg / Include / Library / AcpiLib.h
1 /** @file
2 Helper Library for ACPI
3
4 Copyright (c) 2014, ARM Ltd. All rights reserved.
5
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_LIB_H__
17 #define __ACPI_LIB_H__
18
19 #include <Uefi.h>
20
21 //
22 // Macros for the Generic Address Space
23 //
24 #define NULL_GAS { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_UNDEFINED, 0L }
25 #define ARM_GAS8(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_BYTE, Address }
26 #define ARM_GAS16(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 16, 0, EFI_ACPI_5_0_WORD, Address }
27 #define ARM_GAS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_DWORD, Address }
28 #define ARM_GASN(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_DWORD, Address }
29
30 //
31 // Macros for the Multiple APIC Description Table (MADT)
32 //
33 #define EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector) \
34 { \
35 EFI_ACPI_5_0_GICD, sizeof (EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
36 GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \
37 }
38
39 // Note the parking protocol is configured by UEFI if required
40 #define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase) \
41 { \
42 EFI_ACPI_5_0_GIC, sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
43 GicId, AcpiCpuId, Flags, 0, PmuIrq, 0, GicBase \
44 }
45
46
47 /**
48 Locate and Install the ACPI tables from the Firmware Volume
49
50 @param AcpiFile Guid of the ACPI file into the Firmware Volume
51
52 @return EFI_SUCCESS The function completed successfully.
53 @return EFI_NOT_FOUND The protocol could not be located.
54 @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol.
55
56 **/
57 EFI_STATUS
58 LocateAndInstallAcpiFromFv (
59 IN CONST EFI_GUID* AcpiFile
60 );
61
62 #endif // __ACPI_LIB_H__