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

[Xen-changelog] [xen-unstable] hvmloader: smbios: allow the entry point data structure to be located separately.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306943309 -3600
# Node ID 611cc4f187d1891b889e65c955341d9cb4211cd7
# Parent  2f56ad4fc13b2ff29745e5fa2d2e10a65c9d8967
hvmloader: smbios: allow the entry point data structure to be located 
separately.

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


diff -r 2f56ad4fc13b -r 611cc4f187d1 tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Wed Jun 01 16:47:50 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Wed Jun 01 16:48:29 2011 +0100
@@ -24,6 +24,7 @@
 
 #include "../rombios/config.h"
 
+#include "smbios_types.h"
 #include "acpi/acpi2_0.h"
 #include "pci_regs.h"
 #include "util.h"
@@ -155,8 +156,8 @@
 
 static void rombios_create_smbios_tables(void)
 {
-    hvm_write_smbios_tables(scratch_start,
-                            SMBIOS_PHYSICAL_ADDRESS,
+    hvm_write_smbios_tables(SMBIOS_PHYSICAL_ADDRESS,
+                            SMBIOS_PHYSICAL_ADDRESS + sizeof(struct 
smbios_entry_point),
                             SMBIOS_PHYSICAL_END);
 }
 
diff -r 2f56ad4fc13b -r 611cc4f187d1 tools/firmware/hvmloader/smbios.c
--- a/tools/firmware/hvmloader/smbios.c Wed Jun 01 16:47:50 2011 +0100
+++ b/tools/firmware/hvmloader/smbios.c Wed Jun 01 16:48:29 2011 +0100
@@ -28,7 +28,7 @@
 #include "hypercall.h"
 
 static int
-write_smbios_tables(void *start, unsigned long phys,
+write_smbios_tables(void *ep, void *start, unsigned long phys,
                     uint32_t vcpus, uint64_t memsize,
                     uint8_t uuid[16], char *xen_version,
                     uint32_t xen_major_version, uint32_t xen_minor_version);
@@ -85,7 +85,7 @@
 }
 
 static int
-write_smbios_tables(void *start, unsigned long phys,
+write_smbios_tables(void *ep, void *start, unsigned long phys,
                     uint32_t vcpus, uint64_t memsize,
                     uint8_t uuid[16], char *xen_version,
                     uint32_t xen_major_version, uint32_t xen_minor_version)
@@ -97,7 +97,7 @@
 
     get_cpu_manufacturer(cpu_manufacturer, 15);
 
-    p = (char *)start + sizeof(struct smbios_entry_point);
+    p = (char *)start;
 
 #define do_struct(fn) do {                      \
     q = (fn);                                   \
@@ -133,11 +133,9 @@
 
 #undef do_struct
 
-    smbios_entry_point_init(
-        start, max_struct_size,
-        (p - (char *)start) - sizeof(struct smbios_entry_point),
-        phys + sizeof(struct smbios_entry_point),
-        nr_structs);
+    smbios_entry_point_init(ep, max_struct_size,
+                            (p - (char *)start), phys,
+                            nr_structs);
 
     return ((char *)p - (char *)start);
 }
@@ -162,7 +160,7 @@
 }
 
 int
-hvm_write_smbios_tables(unsigned long scratch, unsigned long smbios_start, 
unsigned long smbios_end)
+hvm_write_smbios_tables(unsigned long ep, unsigned long smbios_start, unsigned 
long smbios_end)
 {
     xen_domain_handle_t uuid;
     uint16_t xen_major_version, xen_minor_version;
@@ -221,15 +219,15 @@
 
     xen_version_str[sizeof(xen_version_str)-1] = '\0';
 
-    /* SCRATCH_PHYSICAL_ADDRESS is a safe large memory area for scratch. */
-    len = write_smbios_tables((void *)scratch, smbios_start,
+    /* scratch_start is a safe large memory area for scratch. */
+    len = write_smbios_tables((void *)ep, (void *)scratch_start, smbios_start,
                               hvm_info->nr_vcpus, get_memsize(),
                               uuid, xen_version_str,
                               xen_major_version, xen_minor_version);
     if ( smbios_start + len > smbios_end )
         goto error_out;
     /* Okay, not too large: copy out of scratch to final location. */
-    memcpy((void *)smbios_start, (void *)scratch, len);
+    memcpy((void *)smbios_start, (void *)scratch_start, len);
 
     return len;
 
diff -r 2f56ad4fc13b -r 611cc4f187d1 tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h   Wed Jun 01 16:47:50 2011 +0100
+++ b/tools/firmware/hvmloader/util.h   Wed Jun 01 16:48:29 2011 +0100
@@ -192,7 +192,7 @@
 /* Miscellaneous. */
 void cacheattr_init(void);
 unsigned long create_mp_tables(void *table);
-int hvm_write_smbios_tables(unsigned long scratch,
+int hvm_write_smbios_tables(unsigned long ep,
                            unsigned long smbios_start,
                            unsigned long smbios_end);
 void smp_initialise(void);

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


 


Rackspace

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