WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 12 of 15] hvmloader: smbios: allow the entry point da

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 12 of 15] hvmloader: smbios: allow the entry point data structure to be located separately
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Wed, 1 Jun 2011 10:40:07 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Wed, 01 Jun 2011 03:00:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1306921195@xxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1306921195@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# 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