Skip to content

Commit

Permalink
x86: e820: user-defined memory maps: remove the range instead of upda…
Browse files Browse the repository at this point in the history
…te it to reserved

also let mem= to print out modified e820 map too

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Bernhard Walle <bwalle@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Jul 11, 2008
1 parent 27cb0a7 commit 69a7704
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,8 @@ static void early_panic(char *msg)
panic(msg);
}

static int userdef __initdata;

/* "mem=nopentium" disables the 4MB page tables. */
static int __init parse_memopt(char *p)
{
Expand All @@ -1180,17 +1182,15 @@ static int __init parse_memopt(char *p)
}
#endif

userdef = 1;
mem_size = memparse(p, &p);
end_user_pfn = mem_size>>PAGE_SHIFT;
e820_update_range(mem_size, ULLONG_MAX - mem_size,
E820_RAM, E820_RESERVED);
e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);

return 0;
}
early_param("mem", parse_memopt);

static int userdef __initdata;

static int __init parse_memmap_opt(char *p)
{
char *oldp;
Expand Down Expand Up @@ -1230,8 +1230,7 @@ static int __init parse_memmap_opt(char *p)
e820_add_region(start_at, mem_size, E820_RESERVED);
} else {
end_user_pfn = (mem_size >> PAGE_SHIFT);
e820_update_range(mem_size, ULLONG_MAX - mem_size,
E820_RAM, E820_RESERVED);
e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
}
return *p == '\0' ? 0 : -EINVAL;
}
Expand Down

0 comments on commit 69a7704

Please sign in to comment.