Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154758
b: refs/heads/master
c: 7c5371c
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Linus Torvalds committed Jul 2, 2009
1 parent 090f8af commit 9535995
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 43644679a1e80f53e6e0155ab75b1093ba3c0365
refs/heads/master: 7c5371c403abb29f01bc6cff6c5096abdf2dc524
16 changes: 10 additions & 6 deletions trunk/arch/x86/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,8 @@ static unsigned long ram_alignment(resource_size_t pos)
return 32*1024*1024;
}

#define MAX_RESOURCE_SIZE ((resource_size_t)-1)

void __init e820_reserve_resources_late(void)
{
int i;
Expand All @@ -1400,17 +1402,19 @@ void __init e820_reserve_resources_late(void)
* avoid stolen RAM:
*/
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *entry = &e820_saved.map[i];
resource_size_t start, end;
struct e820entry *entry = &e820.map[i];
u64 start, end;

if (entry->type != E820_RAM)
continue;
start = entry->addr + entry->size;
end = round_up(start, ram_alignment(start));
if (start == end)
end = round_up(start, ram_alignment(start)) - 1;
if (end > MAX_RESOURCE_SIZE)
end = MAX_RESOURCE_SIZE;
if (start >= end)
continue;
reserve_region_with_split(&iomem_resource, start,
end - 1, "RAM buffer");
reserve_region_with_split(&iomem_resource, start, end,
"RAM buffer");
}
}

Expand Down

0 comments on commit 9535995

Please sign in to comment.