diff options
author | Erwan Velu <erwanaliasr1@gmail.com> | 2011-01-31 22:01:26 +0100 |
---|---|---|
committer | Erwan Velu <erwanaliasr1@gmail.com> | 2011-01-31 22:02:30 +0100 |
commit | b55c988dcca34d43ffba87adb604925a91f20496 (patch) | |
tree | 3b40a714778622c6de7da88c2a584969b41a128c | |
parent | 19d91695375b21bba897b19ac6eadeba04dce047 (diff) | |
download | syslinux-b55c988dcca34d43ffba87adb604925a91f20496.tar.gz |
ACPI: Adding TCPA support
-rw-r--r-- | com32/gplinclude/acpi/acpi.h | 2 | ||||
-rw-r--r-- | com32/gplinclude/acpi/tcpa.h | 29 | ||||
-rw-r--r-- | com32/gpllib/acpi/acpi.c | 8 |
3 files changed, 39 insertions, 0 deletions
diff --git a/com32/gplinclude/acpi/acpi.h b/com32/gplinclude/acpi/acpi.h index 490fbca8..8b9bec4b 100644 --- a/com32/gplinclude/acpi/acpi.h +++ b/com32/gplinclude/acpi/acpi.h @@ -32,6 +32,7 @@ void dbg_printf(const char *fmt, ...); #include <acpi/ecdt.h> #include <acpi/facs.h> #include <acpi/hpet.h> +#include <acpi/tcpa.h> enum { ACPI_FOUND = 1, ENO_ACPI = 2 , MADT_FOUND = 3 , ENO_MADT = 4 }; @@ -78,6 +79,7 @@ typedef struct { s_ecdt ecdt; s_facs facs; s_hpet hpet; + s_tcpa tcpa; } s_acpi; int parse_acpi(s_acpi * acpi); diff --git a/com32/gplinclude/acpi/tcpa.h b/com32/gplinclude/acpi/tcpa.h new file mode 100644 index 00000000..a7ec376c --- /dev/null +++ b/com32/gplinclude/acpi/tcpa.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 TCPA_H +#define TCPA_H +#include <inttypes.h> +#include <stdbool.h> + +#define HPET "HPET" + +enum { TCPA_TABLE_FOUND = 1 }; + +typedef struct { + uint64_t *address; + s_acpi_description_header header; + /* What's inside ? */ + bool valid; +} s_tcpa; + +#endif diff --git a/com32/gpllib/acpi/acpi.c b/com32/gpllib/acpi/acpi.c index 68af84af..ba532396 100644 --- a/com32/gpllib/acpi/acpi.c +++ b/com32/gpllib/acpi/acpi.c @@ -207,7 +207,15 @@ bool parse_header(uint64_t *address, s_acpi *acpi) { h->valid = true; h->address = address; memcpy(&h->header, &adh, sizeof(adh)); + } else if (memcmp(adh.signature, TCPA, sizeof(TCPA) - 1) == 0) { + DEBUG_PRINT(("TCPA table found\n")); + s_tcpa *t = &acpi->tcpa; + /* This structure is valid, let's fill it */ + t->valid = true; + t->address = address; + memcpy(&t->header, &adh, sizeof(adh)); } + return true; } |