aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
Diffstat (limited to 'com32')
-rw-r--r--com32/gplinclude/acpi/acpi.h2
-rw-r--r--com32/gplinclude/acpi/mcfg.h29
-rw-r--r--com32/gplinclude/acpi/tcpa.h2
-rw-r--r--com32/gpllib/acpi/acpi.c7
-rw-r--r--com32/hdt/hdt-cli-acpi.c3
-rw-r--r--com32/hdt/hdt-menu-acpi.c11
6 files changed, 53 insertions, 1 deletions
diff --git a/com32/gplinclude/acpi/acpi.h b/com32/gplinclude/acpi/acpi.h
index 8b9bec4b..81268097 100644
--- a/com32/gplinclude/acpi/acpi.h
+++ b/com32/gplinclude/acpi/acpi.h
@@ -33,6 +33,7 @@ void dbg_printf(const char *fmt, ...);
#include <acpi/facs.h>
#include <acpi/hpet.h>
#include <acpi/tcpa.h>
+#include <acpi/mcfg.h>
enum { ACPI_FOUND = 1, ENO_ACPI = 2 , MADT_FOUND = 3 , ENO_MADT = 4 };
@@ -80,6 +81,7 @@ typedef struct {
s_facs facs;
s_hpet hpet;
s_tcpa tcpa;
+ s_mcfg mcfg;
} s_acpi;
int parse_acpi(s_acpi * acpi);
diff --git a/com32/gplinclude/acpi/mcfg.h b/com32/gplinclude/acpi/mcfg.h
new file mode 100644
index 00000000..8c673153
--- /dev/null
+++ b/com32/gplinclude/acpi/mcfg.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 MCFG_H
+#define MCFG_H
+#include <inttypes.h>
+#include <stdbool.h>
+
+#define MCFG "MCFG"
+
+enum { MCFG_TABLE_FOUND = 1 };
+
+typedef struct {
+ uint64_t *address;
+ s_acpi_description_header header;
+ /* What's inside ? */
+ bool valid;
+} s_mcfg;
+
+#endif
diff --git a/com32/gplinclude/acpi/tcpa.h b/com32/gplinclude/acpi/tcpa.h
index a7ec376c..82b28799 100644
--- a/com32/gplinclude/acpi/tcpa.h
+++ b/com32/gplinclude/acpi/tcpa.h
@@ -15,7 +15,7 @@
#include <inttypes.h>
#include <stdbool.h>
-#define HPET "HPET"
+#define TCPA "TCPA"
enum { TCPA_TABLE_FOUND = 1 };
diff --git a/com32/gpllib/acpi/acpi.c b/com32/gpllib/acpi/acpi.c
index ba532396..55c6d1a1 100644
--- a/com32/gpllib/acpi/acpi.c
+++ b/com32/gpllib/acpi/acpi.c
@@ -214,6 +214,13 @@ bool parse_header(uint64_t *address, s_acpi *acpi) {
t->valid = true;
t->address = address;
memcpy(&t->header, &adh, sizeof(adh));
+ } else if (memcmp(adh.signature, MCFG, sizeof(MCFG) - 1) == 0) {
+ DEBUG_PRINT(("MCFG table found\n"));
+ s_mcfg *m = &acpi->mcfg;
+ /* This structure is valid, let's fill it */
+ m->valid = true;
+ m->address = address;
+ memcpy(&m->header, &adh, sizeof(adh));
}
diff --git a/com32/hdt/hdt-cli-acpi.c b/com32/hdt/hdt-cli-acpi.c
index cbabbbae..46f2d4ed 100644
--- a/com32/hdt/hdt-cli-acpi.c
+++ b/com32/hdt/hdt-cli-acpi.c
@@ -112,6 +112,9 @@ void main_show_acpi(int argc __unused, char **argv __unused,
if (hardware->acpi.tcpa.valid)
show_header(hardware->acpi.tcpa.address, &hardware->acpi.tcpa.header);
+ if (hardware->acpi.mcfg.valid)
+ show_header(hardware->acpi.mcfg.address, &hardware->acpi.mcfg.header);
+
/* FACS isn't having the same headers, let's use a dedicated rendering */
if (hardware->acpi.facs.valid) {
s_facs *fa = &hardware->acpi.facs;
diff --git a/com32/hdt/hdt-menu-acpi.c b/com32/hdt/hdt-menu-acpi.c
index 46ecb67a..3cd8e37b 100644
--- a/com32/hdt/hdt-menu-acpi.c
+++ b/com32/hdt/hdt-menu-acpi.c
@@ -92,8 +92,19 @@ static void compute_acpi_tables(struct s_my_menu *menu,
if (hardware->acpi.tcpa.valid)
compute_table(menu,hardware->acpi.tcpa.address, &hardware->acpi.tcpa.header);
+ if (hardware->acpi.mcfg.valid)
+ compute_table(menu,hardware->acpi.mcfg.address, &hardware->acpi.mcfg.header);
+
/* FACS isn't having the same headers, let's use a dedicated rendering */
if (hardware->acpi.facs.valid) {
+ s_facs *fa = &hardware->acpi.facs;
+ char buffer[SUBMENULEN + 1] = { 0 };
+ char statbuffer[STATLEN + 1] = { 0 };
+
+ snprintf(buffer, sizeof buffer, "%-4s", fa->signature);
+ snprintf(statbuffer, sizeof statbuffer, "%-4s @ 0x%p", fa->signature, fa->address);
+ add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
+ menu->items_count++;
}
if (hardware->acpi.madt.valid)