summaryrefslogtreecommitdiffstats
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown2017-05-23 19:32:31 +0200
committerMichael Brown2017-05-23 19:48:02 +0200
commit993fd2b45140d071d7837ff502df771e87f14127 (patch)
treeccae8dca9af4937e3b9092ef0706e97dbf188f37 /src/interface
parent[acpi] Make acpi_find_rsdt() a per-platform method (diff)
downloadipxe-993fd2b45140d071d7837ff502df771e87f14127.tar.gz
ipxe-993fd2b45140d071d7837ff502df771e87f14127.tar.xz
ipxe-993fd2b45140d071d7837ff502df771e87f14127.zip
[efi] Provide access to ACPI tables
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/efi/efi_acpi.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/interface/efi/efi_acpi.c b/src/interface/efi/efi_acpi.c
new file mode 100644
index 00000000..a347eaf3
--- /dev/null
+++ b/src/interface/efi/efi_acpi.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2017 Michael Brown <mbrown@fensystems.co.uk>.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * You can also choose to distribute this program under the terms of
+ * the Unmodified Binary Distribution Licence (as given in the file
+ * COPYING.UBDL), provided that you have satisfied its requirements.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+/**
+ * @file
+ *
+ * iPXE ACPI API for EFI
+ *
+ */
+
+#include <ipxe/acpi.h>
+#include <ipxe/efi/efi.h>
+#include <ipxe/efi/Guid/Acpi.h>
+#include <ipxe/efi/efi_acpi.h>
+
+/** ACPI configuration table */
+static EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER *rsdp;
+EFI_USE_TABLE ( ACPI_10_TABLE, &rsdp, 0 );
+
+/**
+ * Locate ACPI root system description table
+ *
+ * @ret rsdt ACPI root system description table, or UNULL
+ */
+static userptr_t efi_find_rsdt ( void ) {
+
+ /* Locate RSDT via ACPI configuration table, if available */
+ if ( rsdp )
+ return phys_to_user ( rsdp->RsdtAddress );
+
+ return UNULL;
+}
+
+PROVIDE_ACPI ( efi, acpi_find_rsdt, efi_find_rsdt );