Remove CONFIG_QEMU option - breakout into other options.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 17 Aug 2008 15:03:24 +0000 (11:03 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 17 Aug 2008 15:03:24 +0000 (11:03 -0400)
Define all the required app names in config.h directly.
Control UUID detection via new option - CONFIG_UUID_BACKDOOR.
Don't enable mptable on uniprocessor machines (check use to only be
    done for qemu, but it is needed everywhere).
Also add new option CONFIG_SMBIOS.

src/acpi.c
src/config.h
src/mptable.c
src/smbios.c

index c7d043084107fe9acdef77f4c3280c53b56f91b9..18fc2d559694184fb6934b724eb59a4d7487a057 100644 (file)
@@ -209,15 +209,9 @@ static void acpi_build_table_header(struct acpi_table_header *h,
     memcpy(h->signature, sig, 4);
     h->length = cpu_to_le32(len);
     h->revision = rev;
-    if (CONFIG_QEMU) {
-        memcpy(h->oem_id, "QEMU  ", 6);
-        memcpy(h->oem_table_id, "QEMU", 4);
-        memcpy(h->asl_compiler_id, "QEMU", 4);
-    } else {
-        memcpy(h->oem_id, "BOCHS ", 6);
-        memcpy(h->oem_table_id, "BXPC", 4);
-        memcpy(h->asl_compiler_id, "BXPC", 4);
-    }
+    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_table_id + 4, sig, 4);
     h->oem_revision = cpu_to_le32(1);
     h->asl_compiler_revision = cpu_to_le32(1);
@@ -348,10 +342,7 @@ void acpi_bios_init(void)
     /* RSDP */
     memset(rsdp, 0, sizeof(*rsdp));
     memcpy(rsdp->signature, "RSD PTR ", 8);
-    if (CONFIG_QEMU)
-        memcpy(rsdp->oem_id, "QEMU  ", 6);
-    else
-        memcpy(rsdp->oem_id, "BOCHS ", 6);
+    memcpy(rsdp->oem_id, CONFIG_APPNAME6, 6);
     rsdp->rsdt_physical_address = cpu_to_le32(rsdt_addr);
     rsdp->checksum = -checksum((void *)rsdp, 20);
 
index f7d058c9a308443df5d35bfe36fe0fa70a87b0ce..f877101d4732dea30e017eb5df11845e5af1c58c 100644 (file)
@@ -3,15 +3,14 @@
 
 // Configuration definitions.
 
-/* Dont support QEMU BIOS by default.
- * Change CONFIG_QEMU to 1 to support QEMU. */
-#define CONFIG_QEMU 0
-
-#if (QEMU_SUPPORT == 1)
-#define CONFIG_APPNAME "QEMU"
-#else
-#define CONFIG_APPNAME "Bochs"
-#endif
+//#define CONFIG_APPNAME  "QEMU"
+//#define CONFIG_CPUNAME8 "QEMUCPU "
+//#define CONFIG_APPNAME6 "QEMU  "
+//#define CONFIG_APPNAME4 "QEMU"
+#define CONFIG_APPNAME  "Bochs"
+#define CONFIG_CPUNAME8 "BOCHSCPU"
+#define CONFIG_APPNAME6 "BOCHS "
+#define CONFIG_APPNAME4 "BXPC"
 
 // Configure as a coreboot payload.
 #define CONFIG_COREBOOT 0
 #define CONFIG_PIRTABLE 1
 // Support generation of MPTable (for emulators)
 #define CONFIG_MPTABLE 1
+// Support generation of SM BIOS tables (for emulators)
+#define CONFIG_SMBIOS 1
+// Support finding a UUID (for smbios) via "magic" outl sequence.
+#define CONFIG_UUID_BACKDOOR 1
 // Support generation of ACPI tables (for emulators)
 #define CONFIG_ACPI 1
 // Support bios callbacks specific to via vgabios.
index 5550fd247281dc19f9ce0db123efb45cefb43950..7d853990c6bd2debc85be47d7fb50c451ca64d60 100644 (file)
@@ -57,7 +57,8 @@ mptable_init(void)
     int mp_config_table_size;
 
     int smp_cpus = smp_probe();
-    if (CONFIG_QEMU && smp_cpus <= 1)
+    if (smp_cpus <= 1)
+        // Building an mptable on uniprocessor machines confuses some OSes.
         return;
 
     bios_table_cur_addr = ALIGN(bios_table_cur_addr, 16);
@@ -67,10 +68,7 @@ mptable_init(void)
     putle16(&q, 0); /* table length (patched later) */
     putb(&q, 4); /* spec rev */
     putb(&q, 0); /* checksum (patched later) */
-    if (CONFIG_QEMU)
-        putstr(&q, "QEMUCPU "); /* OEM id */
-    else
-        putstr(&q, "BOCHSCPU");
+    putstr(&q, CONFIG_CPUNAME8); /* OEM id */
     putstr(&q, "0.1         "); /* vendor id */
     putle32(&q, 0); /* OEM table ptr */
     putle16(&q, 0); /* OEM table size */
index 020d7c4c325fecd0d1298c9b24bd2b6e74ea3e2d..80262793dc6adefb839dc41bf62cdd5772b92615 100644 (file)
@@ -20,7 +20,7 @@ uuid_probe(u8 *bios_uuid)
     // Default to UUID not set
     memset(bios_uuid, 0, 16);
 
-    if (! CONFIG_QEMU)
+    if (! CONFIG_UUID_BACKDOOR)
         return;
 
     // check if backdoor port exists
@@ -506,6 +506,9 @@ smbios_type_127_init(void *start)
 void
 smbios_init(void)
 {
+    if (! CONFIG_SMBIOS)
+        return;
+
     unsigned cpu_num, nr_structs = 0, max_struct_size = 0;
     char *start, *p, *q;
     int memsize = GET_EBDA(ram_size) / (1024 * 1024);