iPXE
efi_acpi.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 *
19 * You can also choose to distribute this program under the terms of
20 * the Unmodified Binary Distribution Licence (as given in the file
21 * COPYING.UBDL), provided that you have satisfied its requirements.
22 */
23
24FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
25FILE_SECBOOT ( PERMITTED );
26
27/**
28 * @file
29 *
30 * iPXE ACPI API for EFI
31 *
32 */
33
34#include <ipxe/acpi.h>
35#include <ipxe/uaccess.h>
36#include <ipxe/efi/efi.h>
37#include <ipxe/efi/Guid/Acpi.h>
38#include <ipxe/efi/efi_acpi.h>
39
40/** ACPI configuration table */
42EFI_USE_TABLE ( ACPI_10_TABLE, &rsdp, 0 );
43
44/**
45 * Locate ACPI root system description table
46 *
47 * @ret rsdt ACPI root system description table, or NULL
48 */
49static const struct acpi_rsdt * efi_find_rsdt ( void ) {
50
51 /* Locate RSDT via ACPI configuration table, if available */
52 if ( rsdp )
53 return phys_to_virt ( rsdp->RsdtAddress );
54
55 return NULL;
56}
57
GUIDs used for ACPI entries in the EFI system table.
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
static EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER * rsdp
ACPI configuration table.
Definition efi_acpi.c:41
static const struct acpi_rsdt * efi_find_rsdt(void)
Locate ACPI root system description table.
Definition efi_acpi.c:49
iPXE ACPI API for EFI
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
ACPI data structures.
const struct acpi_rsdt * acpi_find_rsdt(void)
Locate ACPI root system description table.
#define PROVIDE_ACPI(_subsys, _api_func, _func)
Provide an ACPI API implementation.
Definition acpi.h:363
#define PROVIDE_ACPI_INLINE(_subsys, _api_func)
Provide a static inline ACPI API implementation.
Definition acpi.h:372
EFI API.
#define EFI_USE_TABLE(_table, _ptr, _required)
Declare an EFI configuration table to be used by iPXE.
Definition efi.h:154
Access to external ("user") memory.
static acpi_find(uint32_t signature, unsigned int index)
Locate ACPI table.
Definition rsdp.h:27
Root System Description Pointer Structure.
Definition Acpi10.h:404
ACPI Root System Description Table (RSDT)
Definition acpi.h:250