[syslinux:master] acpi: Adding dsdt
syslinux-bot for Erwan Velu
erwan.velu at free.fr
Sun Feb 6 14:06:52 PST 2011
Commit-ID: b054981837d082d3bd97ad6127816a82c8ad7278
Gitweb: http://syslinux.zytor.com/commit/b054981837d082d3bd97ad6127816a82c8ad7278
Author: Erwan Velu <erwan.velu at free.fr>
AuthorDate: Wed, 2 Dec 2009 15:56:17 +0100
Committer: Erwan Velu <erwan.velu at free.fr>
CommitDate: Fri, 4 Dec 2009 10:19:01 +0100
acpi: Adding dsdt
Impact: Adding dsdt
Adding DSDT
---
com32/gplinclude/acpi/acpi.h | 4 +++-
com32/gplinclude/acpi/{xsdt.h => dsdt.h} | 13 +++++--------
com32/gplinclude/acpi/madt.h | 3 +--
com32/gpllib/acpi/xsdt.c | 10 +++++++++-
4 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/com32/gplinclude/acpi/acpi.h b/com32/gplinclude/acpi/acpi.h
index d95976a..d5c1249 100644
--- a/com32/gplinclude/acpi/acpi.h
+++ b/com32/gplinclude/acpi/acpi.h
@@ -17,9 +17,10 @@
#include <acpi/structs.h>
#include <acpi/rsdp.h>
#include <acpi/rsdt.h>
-#include <acpi/madt.h>
#include <acpi/xsdt.h>
#include <acpi/fadt.h>
+#include <acpi/madt.h>
+#include <acpi/dsdt.h>
enum { ACPI_FOUND, ENO_ACPI, MADT_FOUND, ENO_MADT };
@@ -34,6 +35,7 @@ typedef struct {
s_xsdt xsdt;
s_fadt fadt;
s_madt madt;
+ s_dsdt dsdt;
} s_acpi;
int parse_acpi(s_acpi * acpi);
diff --git a/com32/gplinclude/acpi/xsdt.h b/com32/gplinclude/acpi/dsdt.h
similarity index 83%
copy from com32/gplinclude/acpi/xsdt.h
copy to com32/gplinclude/acpi/dsdt.h
index 7a08dbf..abcbdf8 100644
--- a/com32/gplinclude/acpi/xsdt.h
+++ b/com32/gplinclude/acpi/dsdt.h
@@ -10,19 +10,16 @@
*
* ----------------------------------------------------------------------- */
-#ifndef XSDT_H
-#define XSDT_H
+#ifndef DSDT_H
+#define DSDT_H
#include <inttypes.h>
#include <stdbool.h>
-enum { XSDT_TABLE_FOUND };
-
typedef struct {
- uint32_t address;
+ uint64_t address;
s_acpi_description_header header;
- uint64_t entry[255];
- uint8_t entry_count;
+ uint8_t *definition_block;
bool valid;
-} s_xsdt;
+} s_dsdt;
#endif
diff --git a/com32/gplinclude/acpi/madt.h b/com32/gplinclude/acpi/madt.h
index c7a63c5..3815bbe 100644
--- a/com32/gplinclude/acpi/madt.h
+++ b/com32/gplinclude/acpi/madt.h
@@ -14,7 +14,6 @@
#define MADT_H
#include <inttypes.h>
#include <stdbool.h>
-#include <acpi/acpi.h>
enum {
PROCESSOR_LOCAL_APIC = 0,
@@ -38,7 +37,7 @@ typedef struct {
} s_processor_local_apic;
typedef struct {
- uint32_t address;
+ uint64_t address;
s_acpi_description_header header;
uint32_t local_apic_address;
uint32_t flags;
diff --git a/com32/gpllib/acpi/xsdt.c b/com32/gpllib/acpi/xsdt.c
index dc68801..c75fd56 100644
--- a/com32/gpllib/acpi/xsdt.c
+++ b/com32/gpllib/acpi/xsdt.c
@@ -70,7 +70,15 @@ int parse_xsdt(s_acpi * acpi)
m->address=*p;
memcpy(&m->header,&adh,sizeof(adh));
parse_madt(acpi);
- } else {
+ } else if (memcmp(adh.signature, "DSDT", 4) == 0) {
+ s_dsdt *d = &acpi->dsdt;
+ uint32_t definition_block_size=adh.length-ACPI_HEADER_SIZE;
+ d->valid=true;
+ d->address=*p;
+ memcpy(&d->header,&adh,sizeof(adh));
+ if ((d->definition_block=malloc(definition_block_size)) != NULL) {
+ memcpy(d->definition_block,(uint64_t *)(d->address+ACPI_HEADER_SIZE),definition_block_size);
+ }
}
x->entry_count++;
}
More information about the Syslinux-commits
mailing list