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>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-06-07 20:02:27 +01:00
1 parent 45542203a2
commit 85ac4d9f2c
4 files changed
+20 -15

No files matched your search

+1 -1
View File
@@ -71,7 +71,7 @@ get_memory_map:
e820map:
.fill E820MAX*20,1,0
e820nr:
.byte 0
.long 0
lowmem_kb:
.long 0
highmem_kb:
+3 -2
View File
@@ -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();
}
+11 -10
View File
@@ -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
+5 -2
View File
@@ -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*/
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.