[syslinux:master] ACPI: Adding HPET support
syslinux-bot for Erwan Velu
erwanaliasr1 at gmail.com
Sun Feb 6 14:07:51 PST 2011
Commit-ID: 7c9a76021519d03f2c6816692b25985509192ddf
Gitweb: http://syslinux.zytor.com/commit/7c9a76021519d03f2c6816692b25985509192ddf
Author: Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Mon, 31 Jan 2011 21:24:07 +0100
Committer: Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Mon, 31 Jan 2011 21:24:07 +0100
ACPI: Adding HPET support
---
com32/gplinclude/acpi/acpi.h | 2 ++
com32/gplinclude/acpi/{ssdt.h => hpet.h} | 13 +++++++------
com32/gpllib/acpi/acpi.c | 8 ++++++++
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/com32/gplinclude/acpi/acpi.h b/com32/gplinclude/acpi/acpi.h
index 1d9a5a0..490fbca 100644
--- a/com32/gplinclude/acpi/acpi.h
+++ b/com32/gplinclude/acpi/acpi.h
@@ -31,6 +31,7 @@ void dbg_printf(const char *fmt, ...);
#include <acpi/sbst.h>
#include <acpi/ecdt.h>
#include <acpi/facs.h>
+#include <acpi/hpet.h>
enum { ACPI_FOUND = 1, ENO_ACPI = 2 , MADT_FOUND = 3 , ENO_MADT = 4 };
@@ -76,6 +77,7 @@ typedef struct {
s_sbst sbst;
s_ecdt ecdt;
s_facs facs;
+ s_hpet hpet;
} s_acpi;
int parse_acpi(s_acpi * acpi);
diff --git a/com32/gplinclude/acpi/ssdt.h b/com32/gplinclude/acpi/hpet.h
similarity index 86%
copy from com32/gplinclude/acpi/ssdt.h
copy to com32/gplinclude/acpi/hpet.h
index af74dce..99dea6a 100644
--- a/com32/gplinclude/acpi/ssdt.h
+++ b/com32/gplinclude/acpi/hpet.h
@@ -10,19 +10,20 @@
*
* ----------------------------------------------------------------------- */
-#ifndef SSDT_H
-#define SSDT_H
+#ifndef HPET_H
+#define HPET_H
#include <inttypes.h>
#include <stdbool.h>
-#define SSDT "SSDT"
-#define PSDT "PSDT"
+#define HPET "HPET"
+
+enum { HPET_TABLE_FOUND = 1 };
typedef struct {
uint64_t *address;
s_acpi_description_header header;
- uint8_t *definition_block;
+ /* What's inside ? */
bool valid;
-} s_ssdt;
+} s_hpet;
#endif
diff --git a/com32/gpllib/acpi/acpi.c b/com32/gpllib/acpi/acpi.c
index b763e0b..68af84a 100644
--- a/com32/gpllib/acpi/acpi.c
+++ b/com32/gpllib/acpi/acpi.c
@@ -200,6 +200,14 @@ bool parse_header(uint64_t *address, s_acpi *acpi) {
e->address = address;
memcpy(&e->header, &adh, sizeof(adh));
parse_ecdt(e);
+ } else if (memcmp(adh.signature, HPET, sizeof(HPET) - 1) == 0) {
+ DEBUG_PRINT(("HPET table found\n"));
+ s_hpet *h = &acpi->hpet;
+ /* This structure is valid, let's fill it */
+ h->valid = true;
+ h->address = address;
+ memcpy(&h->header, &adh, sizeof(adh));
}
+
return true;
}
More information about the Syslinux-commits
mailing list