diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-02-04 13:27:17 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-02-04 13:27:17 +0000 |
commit | 38ab03b7633329a4f3a4628ad7644c0d31aaeeeb (patch) | |
tree | 6531ebb01ebcfa8172813bd3b4750212fa893a96 /xen/arch/x86/boot | |
parent | 149748770bf72c2c6b51d2d1b56ec8d140dd9c7c (diff) | |
download | xen-38ab03b7633329a4f3a4628ad7644c0d31aaeeeb.tar.gz xen-38ab03b7633329a4f3a4628ad7644c0d31aaeeeb.tar.bz2 xen-38ab03b7633329a4f3a4628ad7644c0d31aaeeeb.zip |
x86: Relocate Multiboot module command-line strings.
Missed this in the original patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/boot')
-rw-r--r-- | xen/arch/x86/boot/reloc.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c index d0ae7dc9fc..e3333d36b8 100644 --- a/xen/arch/x86/boot/reloc.c +++ b/xen/arch/x86/boot/reloc.c @@ -48,22 +48,31 @@ static void *reloc_mbi_struct(void *old, unsigned int bytes) 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( |