summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2011-01-31 22:28:45 +0100
committerErwan Velu <erwanaliasr1@gmail.com>2011-01-31 22:28:45 +0100
commitd27025ba52145c1b4119a8d5920137ffb35bc5f4 (patch)
tree3d6d5ca4d4a11f070a925de4470800f50726158c
parentb60ffd9cf1ce6ec3ebab01764d8f8e82aa4edd9e (diff)
downloadsyslinux-d27025ba52145c1b4119a8d5920137ffb35bc5f4.tar.gz
ACPI: Adding BOOT support
-rw-r--r--com32/gplinclude/acpi/acpi.h2
-rw-r--r--com32/gplinclude/acpi/boot.h29
-rw-r--r--com32/gpllib/acpi/acpi.c11
3 files changed, 39 insertions, 3 deletions
diff --git a/com32/gplinclude/acpi/acpi.h b/com32/gplinclude/acpi/acpi.h
index 3884762e..94589f35 100644
--- a/com32/gplinclude/acpi/acpi.h
+++ b/com32/gplinclude/acpi/acpi.h
@@ -35,6 +35,7 @@ void dbg_printf(const char *fmt, ...);
#include <acpi/tcpa.h>
#include <acpi/mcfg.h>
#include <acpi/slic.h>
+#include <acpi/boot.h>
enum { ACPI_FOUND = 1, ENO_ACPI = 2 , MADT_FOUND = 3 , ENO_MADT = 4 };
@@ -85,6 +86,7 @@ typedef struct {
s_tcpa tcpa;
s_mcfg mcfg;
s_slic slic;
+ s_boot boot;
} s_acpi;
int parse_acpi(s_acpi * acpi);
diff --git a/com32/gplinclude/acpi/boot.h b/com32/gplinclude/acpi/boot.h
new file mode 100644
index 00000000..a79c0d0f
--- /dev/null
+++ b/com32/gplinclude/acpi/boot.h
@@ -0,0 +1,29 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2009-2011 Erwan Velu - All Rights Reserved
+ *
+ * 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, Inc., 53 Temple Place Ste 330,
+ * Boston MA 02111-1307, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#ifndef BOOT_H
+#define BOOT_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define BOOT "BOOT"
+
+enum { BOOT_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_boot;
+
+#endif
diff --git a/com32/gpllib/acpi/acpi.c b/com32/gpllib/acpi/acpi.c
index 7670d163..8e5ee29c 100644
--- a/com32/gpllib/acpi/acpi.c
+++ b/com32/gpllib/acpi/acpi.c
@@ -228,9 +228,14 @@ bool parse_header(uint64_t *address, s_acpi *acpi) {
s->valid = true;
s->address = address;
memcpy(&s->header, &adh, sizeof(adh));
+ } else if (memcmp(adh.signature, BOOT, sizeof(BOOT) - 1) == 0) {
+ DEBUG_PRINT(("BOOT table found\n"));
+ s_boot *b = &acpi->boot;
+ /* This structure is valid, let's fill it */
+ b->valid = true;
+ b->address = address;
+ memcpy(&b->header, &adh, sizeof(adh));
}
-
-
-
+
return true;
}