[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 07 of 15] hvmloader: make SMBIOS initialisation more general



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306917341 -3600
# Node ID 673d9039cd5972d496fa1dbdb2b783a6696c3fbb
# Parent  4d9116ca460ed18d23f2c04c28ea2b5a67586830
hvmloader: make SMBIOS initialisation more general.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 4d9116ca460e -r 673d9039cd59 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h Wed Jun 01 09:28:29 2011 +0100
+++ b/tools/firmware/hvmloader/config.h Wed Jun 01 09:35:41 2011 +0100
@@ -16,9 +16,6 @@ struct bios_config {
     /* Physical address to load at */
     unsigned int bios_address;
 
-    /* SMBIOS */
-    unsigned int smbios_start, smbios_end;
-
     /* ROMS */
     int load_roms;
     unsigned int optionrom_start, optionrom_end;
@@ -31,6 +28,7 @@ struct bios_config {
 
     void (*acpi_build_tables)(void);
     void (*create_mp_tables)(void);
+    void (*create_smbios_tables)(void);
 };
 
 extern struct bios_config rombios_config;
diff -r 4d9116ca460e -r 673d9039cd59 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 09:28:29 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Wed Jun 01 09:35:41 2011 +0100
@@ -383,7 +383,7 @@ int main(void)
 {
     uint32_t highbios = 0;
     const struct bios_config *bios;
-    int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0, smbios_sz = 0;
+    int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0;
     uint32_t etherboot_phys_addr = 0, option_rom_phys_addr = 0;
 
     /* Initialise hypercall stubs with RET, rendering them no-ops. */
@@ -407,11 +407,9 @@ int main(void)
 
     perform_tests();
 
-    if (bios->smbios_start) {
+    if (bios->create_smbios_tables) {
         printf("Writing SMBIOS tables ...\n");
-        smbios_sz = hvm_write_smbios_tables(SCRATCH_PHYSICAL_ADDRESS,
-                                            bios->smbios_start,
-                                            bios->smbios_end);
+        bios->create_smbios_tables();
     }
 
     printf("Loading %s ...\n", bios->name);
@@ -495,10 +493,6 @@ int main(void)
         printf(" %05x-%05x: PCI Option ROMs\n",
                option_rom_phys_addr,
                option_rom_phys_addr + option_rom_sz - 1);
-    if ( smbios_sz )
-        printf(" %05x-%05x: SMBIOS tables\n",
-               bios->smbios_start,
-               bios->smbios_start + smbios_sz - 1);
     printf(" %05x-%05x: Main BIOS\n",
            bios->bios_address,
            bios->bios_address + bios->image_size - 1);
diff -r 4d9116ca460e -r 673d9039cd59 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Wed Jun 01 09:28:29 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Wed Jun 01 09:35:41 2011 +0100
@@ -136,6 +136,13 @@ static void rombios_create_mp_tables(voi
     reset_bios_checksum();
 }
 
+static void rombios_create_smbios_tables(void)
+{
+    hvm_write_smbios_tables(SCRATCH_PHYSICAL_ADDRESS,
+                            SMBIOS_PHYSICAL_ADDRESS,
+                            SMBIOS_PHYSICAL_END);
+}
+
 //BUILD_BUG_ON(sizeof(rombios) > (0x00100000U - ROMBIOS_PHYSICAL_ADDRESS));
 
 struct bios_config rombios_config =  {
@@ -146,9 +153,6 @@ struct bios_config rombios_config =  {
 
     .bios_address = ROMBIOS_PHYSICAL_ADDRESS,
 
-    .smbios_start = SMBIOS_PHYSICAL_ADDRESS,
-    .smbios_end = SMBIOS_PHYSICAL_END,
-
     .load_roms = 1,
 
     .optionrom_start = OPTIONROM_PHYSICAL_ADDRESS,
@@ -162,6 +166,7 @@ struct bios_config rombios_config =  {
 
     .acpi_build_tables = rombios_acpi_build_tables,
     .create_mp_tables = rombios_create_mp_tables,
+    .create_smbios_tables = rombios_create_smbios_tables,
 };
 
 /*
diff -r 4d9116ca460e -r 673d9039cd59 tools/firmware/hvmloader/seabios.c
--- a/tools/firmware/hvmloader/seabios.c        Wed Jun 01 09:28:29 2011 +0100
+++ b/tools/firmware/hvmloader/seabios.c        Wed Jun 01 09:35:41 2011 +0100
@@ -38,9 +38,6 @@ struct bios_config seabios_config = {
 
     .bios_address = SEABIOS_PHYSICAL_ADDRESS,
 
-    .smbios_start = 0,
-    .smbios_end = 0,
-
     .load_roms = 0,
 
     .optionrom_start = 0,
@@ -53,6 +50,7 @@ struct bios_config seabios_config = {
 
     .acpi_build_tables = NULL,
     .create_mp_tables = NULL,
+    .create_smbios_tables = NULL,
 };
 
 /*

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.