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-changelog

[Xen-changelog] [xen-unstable] x86: Relocate Multiboot module command-li

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Relocate Multiboot module command-line strings.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 05 Feb 2009 08:00:24 -0800
Delivery-date: Thu, 05 Feb 2009 08:00:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1233754037 0
# Node ID faf20eb0b69e338668ecbb9f4714b70eba841ce6
# Parent  7a3124098155e710147420047538dc2ef785633d
x86: Relocate Multiboot module command-line strings.

Missed this in the original patch.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/boot/reloc.c |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff -r 7a3124098155 -r faf20eb0b69e xen/arch/x86/boot/reloc.c
--- a/xen/arch/x86/boot/reloc.c Wed Feb 04 12:43:11 2009 +0000
+++ b/xen/arch/x86/boot/reloc.c Wed Feb 04 13:27:17 2009 +0000
@@ -48,22 +48,31 @@ static void *reloc_mbi_struct(void *old,
     return memcpy(alloc, old, bytes);
 }
 
+static char *reloc_mbi_string(char *old)
+{
+    char *p;
+    for ( p = old; *p != '\0'; p++ )
+        continue;
+    return reloc_mbi_struct(old, p - old + 1);
+}
+
 multiboot_info_t *reloc(multiboot_info_t *mbi_old)
 {
     multiboot_info_t *mbi = reloc_mbi_struct(mbi_old, sizeof(*mbi));
+    int i;
 
     if ( mbi->flags & MBI_CMDLINE )
-    {
-        char *cmdline_old, *p;
-        cmdline_old = (char *)mbi->cmdline;
-        for ( p = cmdline_old; *p != '\0'; p++ )
-            continue;
-        mbi->cmdline = (u32)reloc_mbi_struct(cmdline_old, p - cmdline_old + 1);
-    }
+        mbi->cmdline = (u32)reloc_mbi_string((char *)mbi->cmdline);
 
     if ( mbi->flags & MBI_MODULES )
-        mbi->mods_addr = (u32)reloc_mbi_struct(
+    {
+        module_t *mods = reloc_mbi_struct(
             (module_t *)mbi->mods_addr, mbi->mods_count * sizeof(module_t));
+        mbi->mods_addr = (u32)mods;
+        for ( i = 0; i < mbi->mods_count; i++ )
+            if ( mods[i].string )
+                mods[i].string = (u32)reloc_mbi_string((char *)mods[i].string);
+    }
 
     if ( mbi->flags & MBI_MEMMAP )
         mbi->mmap_addr = (u32)reloc_mbi_struct(

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Relocate Multiboot module command-line strings., Xen patchbot-unstable <=