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

[Xen-devel] [PATCH 12 of 15] hvmloader: smbios: allow the entry point data structure to be located separately



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1306917734 -3600
# Node ID 644a9208e3bb34e533ffeaf7001c48355e05a084
# Parent  5357077295f21154b076925d1d4687b076de6bfc
hvmloader: smbios: allow the entry point data structure to be located 
separately.

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

diff -r 5357077295f2 -r 644a9208e3bb tools/firmware/hvmloader/rombios.c
--- a/tools/firmware/hvmloader/rombios.c        Wed Jun 01 09:41:49 2011 +0100
+++ b/tools/firmware/hvmloader/rombios.c        Wed Jun 01 09:42:14 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_mp_tables(voi
 
 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 5357077295f2 -r 644a9208e3bb tools/firmware/hvmloader/smbios.c
--- a/tools/firmware/hvmloader/smbios.c Wed Jun 01 09:41:49 2011 +0100
+++ b/tools/firmware/hvmloader/smbios.c Wed Jun 01 09:42:14 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 @@ get_cpu_manufacturer(char *buf, int len)
 }
 
 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 @@ write_smbios_tables(void *start, unsigne
 
     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 @@ write_smbios_tables(void *start, unsigne
 
 #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 @@ get_memsize(void)
 }
 
 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 @@ hvm_write_smbios_tables(unsigned long sc
 
     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 5357077295f2 -r 644a9208e3bb tools/firmware/hvmloader/util.h
--- a/tools/firmware/hvmloader/util.h   Wed Jun 01 09:41:49 2011 +0100
+++ b/tools/firmware/hvmloader/util.h   Wed Jun 01 09:42:14 2011 +0100
@@ -192,7 +192,7 @@ uint32_t rombios_highbios_setup(void);
 /* 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-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®.