Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99689
b: refs/heads/master
c: 6e9bcc7
h: refs/heads/master
i:
  99687: a37114f
v: v3
  • Loading branch information
Paul Jackson authored and Thomas Gleixner committed May 25, 2008
1 parent 0f6b7f0 commit d9bb5a0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 028b785888c523baccdf27af0cdbf1deb92edec0
refs/heads/master: 6e9bcc796b120d17b08dde7ab958b82ddb899889
5 changes: 3 additions & 2 deletions trunk/arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void __init e820_print_map(char *who)
*
*/
int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
char *pnr_map)
int *pnr_map)
{
struct change_member {
struct e820entry *pbios; /* pointer to original bios entry */
Expand Down Expand Up @@ -204,6 +204,7 @@ static struct e820entry new_bios[E820_X_MAX] __initdata;
return -1;

old_nr = *pnr_map;
BUG_ON(old_nr > max_nr_map);

/* bail out if we find any unreasonable addresses in bios map */
for (i = 0; i < old_nr; i++)
Expand Down Expand Up @@ -401,7 +402,7 @@ u64 __init update_memory_range(u64 start, u64 size, unsigned old_type,

void __init update_e820(void)
{
u8 nr_map;
int nr_map;

nr_map = e820.nr_map;
if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map))
Expand Down
7 changes: 5 additions & 2 deletions trunk/arch/x86/kernel/e820_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,18 @@ static void early_panic(char *msg)
char *__init machine_specific_memory_setup(void)
{
char *who = "BIOS-e820";
int new_nr;
/*
* Try to copy the BIOS-supplied E820-map.
*
* Otherwise fake a memory map; one section from 0k->640k,
* the next section from 1mb->appropriate_mem_k
*/
new_nr = boot_params.e820_entries;
sanitize_e820_map(boot_params.e820_map,
ARRAY_SIZE(boot_params.e820_map),
&boot_params.e820_entries);
&new_nr);
boot_params.e820_entries = new_nr;
if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0)
early_panic("Cannot find a valid memory map");
printk(KERN_INFO "BIOS-provided physical RAM map:\n");
Expand Down Expand Up @@ -484,7 +487,7 @@ early_param("memmap", parse_memmap_opt);
void __init finish_e820_parsing(void)
{
if (userdef) {
char nr = e820.nr_map;
int nr = e820.nr_map;

if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0)
early_panic("Invalid user supplied memory map");
Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/x86/mach-default/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ late_initcall(print_ipi_mode);
char * __init machine_specific_memory_setup(void)
{
char *who;
int new_nr;


who = "BIOS-e820";
Expand All @@ -163,9 +164,11 @@ char * __init machine_specific_memory_setup(void)
* Otherwise fake a memory map; one section from 0k->640k,
* the next section from 1mb->appropriate_mem_k
*/
new_nr = boot_params.e820_entries;
sanitize_e820_map(boot_params.e820_map,
ARRAY_SIZE(boot_params.e820_map),
&boot_params.e820_entries);
&new_nr);
boot_params.e820_entries = new_nr;
if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries)
< 0) {
unsigned long mem_size;
Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/x86/mach-voyager/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ void __init time_init_hook(void)
char *__init machine_specific_memory_setup(void)
{
char *who;
int new_nr;

who = "NOT VOYAGER";

Expand Down Expand Up @@ -111,9 +112,11 @@ char *__init machine_specific_memory_setup(void)
* Otherwise fake a memory map; one section from 0k->640k,
* the next section from 1mb->appropriate_mem_k
*/
new_nr = boot_params.e820_entries;
sanitize_e820_map(boot_params.e820_map,
ARRAY_SIZE(boot_params.e820_map),
&boot_params.e820_entries);
&new_nr);
boot_params.e820_entries = new_nr;
if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries)
< 0) {
unsigned long mem_size;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-x86/e820.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extern int e820_all_mapped(u64 start, u64 end, unsigned type);
extern void add_memory_region(u64 start, u64 size, int type);
extern void e820_print_map(char *who);
extern int
sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, char *pnr_map);
sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, int *pnr_map);
extern int copy_e820_map(struct e820entry *biosmap, int nr_map);
extern u64 update_memory_range(u64 start, u64 size, unsigned old_type,
unsigned new_type);
Expand Down

0 comments on commit d9bb5a0

Please sign in to comment.