[syslinux:master] acpi: Adding SBST

syslinux-bot for Erwan Velu erwan.velu at free.fr
Sun Feb 6 14:06:58 PST 2011


Commit-ID:  e680227c469e46d72692200d0e4492714f7e9828
Gitweb:     http://syslinux.zytor.com/commit/e680227c469e46d72692200d0e4492714f7e9828
Author:     Erwan Velu <erwan.velu at free.fr>
AuthorDate: Thu, 3 Dec 2009 10:14:01 +0100
Committer:  Erwan Velu <erwan.velu at free.fr>
CommitDate: Fri, 4 Dec 2009 10:19:01 +0100

acpi: Adding SBST

Impact: Adding SBST

Adding SBST


---
 com32/gplinclude/acpi/acpi.h             |    2 ++
 com32/gplinclude/acpi/{dsdt.h => sbst.h} |   13 ++++++++-----
 com32/gpllib/acpi/{fadt.c => sbst.c}     |   13 +++++--------
 com32/gpllib/acpi/xsdt.c                 |    7 +++++++
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/com32/gplinclude/acpi/acpi.h b/com32/gplinclude/acpi/acpi.h
index 02c19e3..5ded220 100644
--- a/com32/gplinclude/acpi/acpi.h
+++ b/com32/gplinclude/acpi/acpi.h
@@ -22,6 +22,7 @@
 #include <acpi/madt.h>
 #include <acpi/dsdt.h>
 #include <acpi/ssdt.h>
+#include <acpi/sbst.h>
 
 enum { ACPI_FOUND, ENO_ACPI, MADT_FOUND, ENO_MADT };
 
@@ -65,6 +66,7 @@ typedef struct {
     s_madt madt;
     s_dsdt dsdt;
     s_ssdt *ssdt[MAX_SSDT];
+    s_sbst sbst;
     uint8_t ssdt_count;
 } s_acpi;
 
diff --git a/com32/gplinclude/acpi/dsdt.h b/com32/gplinclude/acpi/sbst.h
similarity index 78%
copy from com32/gplinclude/acpi/dsdt.h
copy to com32/gplinclude/acpi/sbst.h
index 219cb1e..6e3aa10 100644
--- a/com32/gplinclude/acpi/dsdt.h
+++ b/com32/gplinclude/acpi/sbst.h
@@ -10,18 +10,21 @@
  *
  * ----------------------------------------------------------------------- */
 
-#ifndef DSDT_H
-#define DSDT_H
+#ifndef SBST_H
+#define SBST_H
 #include <inttypes.h>
 #include <stdbool.h>
 
-#define DSDT "DSDT"
+#define SBST "SBST"
 
 typedef struct {
     uint64_t address;
     s_acpi_description_header header;
-    uint8_t *definition_block;
     bool valid;
-} s_dsdt;
+    uint32_t warning_energy_level;
+    uint32_t low_energy_level;
+    uint32_t critical_energy_level;
+} s_sbst;
 
+void parse_sbst(s_sbst * sbst);
 #endif
diff --git a/com32/gpllib/acpi/fadt.c b/com32/gpllib/acpi/sbst.c
similarity index 84%
copy from com32/gpllib/acpi/fadt.c
copy to com32/gpllib/acpi/sbst.c
index a37149c..6a41168 100644
--- a/com32/gpllib/acpi/fadt.c
+++ b/com32/gpllib/acpi/sbst.c
@@ -32,16 +32,13 @@
 #include <dprintf.h>
 #include "acpi/acpi.h"
 
-void parse_fadt(s_fadt * f)
+void parse_sbst(s_sbst * s)
 {
-    /* Let's seach for FADT table */
     uint8_t *q;
+    q = (uint64_t *) (s->address+ACPI_HEADER_SIZE);
 
-    /* Fixing table name */
-    memcpy(f->header.signature,FADT,sizeof(FADT));
-    
     /* Copying remaining structs */
-    q = (uint64_t *) (f->address+ACPI_HEADER_SIZE);
-    cp_struct(&f->firmware_ctrl);
-    cp_struct(&f->dsdt_address);
+    cp_struct(&s->warning_energy_level);
+    cp_struct(&s->low_energy_level);
+    cp_struct(&s->critical_energy_level);
 }
diff --git a/com32/gpllib/acpi/xsdt.c b/com32/gpllib/acpi/xsdt.c
index a0513d2..916695b 100644
--- a/com32/gpllib/acpi/xsdt.c
+++ b/com32/gpllib/acpi/xsdt.c
@@ -105,6 +105,13 @@ int parse_xsdt(s_acpi * acpi)
 		    }
 		    /* Increment the number of ssdt we have */
 		    acpi->ssdt_count++;
+	    } else if (memcmp(adh.signature, SBST, sizeof(SBST)-1) == 0) {
+		    s_sbst *s = &acpi->sbst;
+		    /* This structure is valid, let's fill it */
+		    s->valid=true;
+		    s->address=*p;
+		    memcpy(&s->header,&adh,sizeof(adh));
+		    parse_sbst(s);
 	    }
 
 	    x->entry_count++;



More information about the Syslinux-commits mailing list