[SeaBIOS] [PATCH 1/2] acpi: allow header strings be configured on config.h

Eduardo Habkost ehabkost at redhat.com
Fri Jun 18 22:19:48 CEST 2010


Instead of using CONFIG_APPNAME for everything, let CONFIG_OEM_* defines to be
set on config.h.

The current CONFIG_APPNAME* defaults are kept, but it will allow build-time
fine-tuned configuration on config.h.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 src/acpi.c   |    8 ++++----
 src/config.h |    5 +++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/acpi.c b/src/acpi.c
index 0559443..0c78883 100644
--- a/src/acpi.c
+++ b/src/acpi.c
@@ -286,9 +286,9 @@ build_header(struct acpi_table_header *h, u32 sig, int len, u8 rev)
     h->signature = sig;
     h->length = cpu_to_le32(len);
     h->revision = rev;
-    memcpy(h->oem_id, CONFIG_APPNAME6, 6);
-    memcpy(h->oem_table_id, CONFIG_APPNAME4, 4);
-    memcpy(h->asl_compiler_id, CONFIG_APPNAME4, 4);
+    memcpy(h->oem_id, CONFIG_OEM_ID_6, 6);
+    memcpy(h->oem_table_id, CONFIG_OEM_TABLE_ID_4, 4);
+    memcpy(h->asl_compiler_id, CONFIG_ASL_COMPILER_ID_4, 4);
     memcpy(h->oem_table_id + 4, (void*)&sig, 4);
     h->oem_revision = cpu_to_le32(1);
     h->asl_compiler_revision = cpu_to_le32(1);
@@ -672,7 +672,7 @@ acpi_bios_init(void)
     // Build rsdp pointer table
     memset(rsdp, 0, sizeof(*rsdp));
     rsdp->signature = RSDP_SIGNATURE;
-    memcpy(rsdp->oem_id, CONFIG_APPNAME6, 6);
+    memcpy(rsdp->oem_id, CONFIG_OEM_ID_6, 6);
     rsdp->rsdt_physical_address = cpu_to_le32((u32)rsdt);
     rsdp->checksum -= checksum(rsdp, 20);
     RsdpAddr = rsdp;
diff --git a/src/config.h b/src/config.h
index ad569c6..92a02aa 100644
--- a/src/config.h
+++ b/src/config.h
@@ -12,6 +12,11 @@
 #define CONFIG_APPNAME6 "BOCHS "
 #define CONFIG_APPNAME4 "BXPC"
 
+/* ACPI header fields */
+#define CONFIG_OEM_ID_6           CONFIG_APPNAME6
+#define CONFIG_OEM_TABLE_ID_4     CONFIG_APPNAME4
+#define CONFIG_ASL_COMPILER_ID_4  CONFIG_APPNAME4
+
 // Configure as a coreboot payload.
 #define CONFIG_COREBOOT 0
 
-- 
1.7.0.3




More information about the SeaBIOS mailing list