aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-06-07 20:02:27 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-06-07 20:02:27 +0100
commit85ac4d9f2c1d55f70d7450a9e50467305aedbcc2 (patch)
treeb685c51b7bc091b94944f8c5c62cc9faa8ebac76
parent45542203a2930a1fe77a9d3a6ab8f3461434d01b (diff)
downloadxen-85ac4d9f2c1d55f70d7450a9e50467305aedbcc2.tar.gz
xen-85ac4d9f2c1d55f70d7450a9e50467305aedbcc2.tar.bz2
xen-85ac4d9f2c1d55f70d7450a9e50467305aedbcc2.zip
x86: Print source of e820 memory map during boot. Fix Xen-e801 memmap
parsing. Get rid of unneeded e820_raw variable -- map straight onto boot-trampoline e820 array. Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r--xen/arch/x86/boot/mem.S2
-rw-r--r--xen/arch/x86/e820.c5
-rw-r--r--xen/arch/x86/setup.c21
-rw-r--r--xen/include/asm-x86/e820.h7
4 files changed, 20 insertions, 15 deletions
diff --git a/xen/arch/x86/boot/mem.S b/xen/arch/x86/boot/mem.S
index ec4169540d..646462053d 100644
--- a/xen/arch/x86/boot/mem.S
+++ b/xen/arch/x86/boot/mem.S
@@ -71,7 +71,7 @@ get_memory_map:
e820map:
.fill E820MAX*20,1,0
e820nr:
- .byte 0
+ .long 0
lowmem_kb:
.long 0
highmem_kb:
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index 95daf54302..652d4e0042 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -412,10 +412,11 @@ static void __init machine_specific_memory_setup(
clip_mem();
}
-unsigned long __init init_e820(struct e820entry *raw, int *raw_nr)
+unsigned long __init init_e820(
+ const char *str, struct e820entry *raw, int *raw_nr)
{
machine_specific_memory_setup(raw, raw_nr);
- printk(KERN_INFO "Physical RAM map:\n");
+ printk(KERN_INFO "%s RAM map:\n", str);
print_e820_memory_map(e820.map, e820.nr_map);
return find_max_pfn();
}
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 938388d267..cf3d5250dc 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -162,8 +162,6 @@ static void __init do_initcalls(void)
for ( ; ; ) __asm__ __volatile__ ( "hlt" ); \
} while (0)
-static struct e820entry __initdata e820_raw[E820MAX];
-
static unsigned long __initdata initial_images_start, initial_images_end;
unsigned long __init initial_images_nrpages(void)
@@ -338,6 +336,7 @@ void init_done(void)
void __init __start_xen(multiboot_info_t *mbi)
{
+ char *memmap_type = NULL;
char __cmdline[] = "", *cmdline = __cmdline;
unsigned long _initrd_start = 0, _initrd_len = 0;
unsigned int initrdidx = 1;
@@ -345,7 +344,7 @@ void __init __start_xen(multiboot_info_t *mbi)
unsigned long _policy_len = 0;
module_t *mod = (module_t *)__va(mbi->mods_addr);
unsigned long nr_pages, modules_length;
- int i, e820_warn = 0, e820_raw_nr = 0, bytes = 0;
+ int i, e820_warn = 0, bytes = 0;
struct ns16550_defaults ns16550 = {
.data_bits = 8,
.parity = 'n',
@@ -395,23 +394,24 @@ void __init __start_xen(multiboot_info_t *mbi)
if ( opt_xenheap_megabytes > 2048 )
opt_xenheap_megabytes = 2048;
- if ( bootsym(e820nr) != 0 )
+ if ( e820_raw_nr != 0 )
{
- e820_raw_nr = bootsym(e820nr);
- memcpy(e820_raw, bootsym(e820map), e820_raw_nr * sizeof(e820_raw[0]));
+ memmap_type = "Xen-e820";
}
- else if ( lowmem_kb )
+ else if ( bootsym(lowmem_kb) )
{
+ memmap_type = "Xen-e801";
e820_raw[0].addr = 0;
- e820_raw[0].size = lowmem_kb << 10;
+ e820_raw[0].size = bootsym(lowmem_kb) << 10;
e820_raw[0].type = E820_RAM;
e820_raw[1].addr = 0x100000;
- e820_raw[1].size = highmem_kb << 10;
+ e820_raw[1].size = bootsym(highmem_kb) << 10;
e820_raw[1].type = E820_RAM;
e820_raw_nr = 2;
}
else if ( mbi->flags & MBI_MEMMAP )
{
+ memmap_type = "Multiboot-e820";
while ( bytes < mbi->mmap_length )
{
memory_map_t *map = __va(mbi->mmap_addr + bytes);
@@ -449,6 +449,7 @@ void __init __start_xen(multiboot_info_t *mbi)
}
else if ( mbi->flags & MBI_MEMLIMITS )
{
+ memmap_type = "Multiboot-e801";
e820_raw[0].addr = 0;
e820_raw[0].size = mbi->mem_lower << 10;
e820_raw[0].type = E820_RAM;
@@ -480,7 +481,7 @@ void __init __start_xen(multiboot_info_t *mbi)
}
/* Sanitise the raw E820 map to produce a final clean version. */
- max_page = init_e820(e820_raw, &e820_raw_nr);
+ max_page = init_e820(memmap_type, e820_raw, &e820_raw_nr);
/*
* Create a temporary copy of the E820 map. Truncate it to above 16MB
diff --git a/xen/include/asm-x86/e820.h b/xen/include/asm-x86/e820.h
index 19ef49eff2..094aafce82 100644
--- a/xen/include/asm-x86/e820.h
+++ b/xen/include/asm-x86/e820.h
@@ -10,12 +10,15 @@ struct e820map {
struct e820entry map[E820MAX];
};
-extern unsigned long init_e820(struct e820entry *, int *);
+extern unsigned long init_e820(const char *, struct e820entry *, int *);
extern struct e820map e820;
/* These symbols live in the boot trampoline. */
extern struct e820entry e820map[];
-extern unsigned char e820nr;
+extern int e820nr;
extern unsigned int lowmem_kb, highmem_kb;
+#define e820_raw bootsym(e820map)
+#define e820_raw_nr bootsym(e820nr)
+
#endif /*__E820_HEADER*/