Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100011
b: refs/heads/master
c: fc9036e
h: refs/heads/master
i:
  100009: d86722f
  100007: 9f63562
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Jul 9, 2008
1 parent a39a4b2 commit be141fa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 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: a0a0becd2da0ba0d7f0204a61d1905926cdb163d
refs/heads/master: fc9036ea1a4b14229788e6df3936b451a6abac98
31 changes: 28 additions & 3 deletions trunk/arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ static int __init append_e820_map(struct e820entry *biosmap, int nr_map)
return __append_e820_map(biosmap, nr_map);
}

u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
unsigned new_type)
static u64 __init e820_update_range_map(struct e820map *e820x, u64 start,
u64 size, unsigned old_type,
unsigned new_type)
{
int i;
u64 real_updated_size = 0;
Expand All @@ -426,7 +427,7 @@ u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
size = ULLONG_MAX - start;

for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
struct e820entry *ei = &e820x->map[i];
u64 final_start, final_end;
if (ei->type != old_type)
continue;
Expand Down Expand Up @@ -454,6 +455,19 @@ u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
return real_updated_size;
}

u64 __init e820_update_range(u64 start, u64 size, unsigned old_type,
unsigned new_type)
{
return e820_update_range_map(&e820, start, size, old_type, new_type);
}

static u64 __init e820_update_range_saved(u64 start, u64 size,
unsigned old_type, unsigned new_type)
{
return e820_update_range_map(&e820_saved, start, size, old_type,
new_type);
}

/* make e820 not cover the range */
u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type,
int checktype)
Expand Down Expand Up @@ -503,6 +517,15 @@ void __init update_e820(void)
printk(KERN_INFO "modified physical RAM map:\n");
e820_print_map("modified");
}
static void __init update_e820_saved(void)
{
int nr_map;

nr_map = e820_saved.nr_map;
if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map))
return;
e820_saved.nr_map = nr_map;
}
#define MAX_GAP_END 0x100000000ull
/*
* Search for a gap in the e820 memory space from start_addr to end_addr.
Expand Down Expand Up @@ -1007,8 +1030,10 @@ u64 __init early_reserve_e820(u64 startt, u64 sizet, u64 align)

addr = round_down(start + size - sizet, align);
e820_update_range(addr, sizet, E820_RAM, E820_RESERVED);
e820_update_range_saved(addr, sizet, E820_RAM, E820_RESERVED);
printk(KERN_INFO "update e820 for early_reserve_e820\n");
update_e820();
update_e820_saved();

return addr;
}
Expand Down

0 comments on commit be141fa

Please sign in to comment.