diff options
author | Erwan Velu <erwanaliasr1@gmail.com> | 2011-01-31 22:14:16 +0100 |
---|---|---|
committer | Erwan Velu <erwanaliasr1@gmail.com> | 2011-01-31 22:14:16 +0100 |
commit | c6e2eb83837b33c226119f971bee949396356701 (patch) | |
tree | 7147bca8a3ac213cf6227a9d1f9e300f369eb0e2 | |
parent | 09bfdcd4f24440b0a6ec85c64d929214c98bc148 (diff) | |
download | syslinux-c6e2eb83837b33c226119f971bee949396356701.tar.gz |
ACPI: Adding MCFG support
-rw-r--r-- | com32/gplinclude/acpi/acpi.h | 2 | ||||
-rw-r--r-- | com32/gplinclude/acpi/mcfg.h | 29 | ||||
-rw-r--r-- | com32/gpllib/acpi/acpi.c | 7 |
3 files changed, 38 insertions, 0 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/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)); } |