Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99695
b: refs/heads/master
c: a91eea6
h: refs/heads/master
i:
  99693: c69441c
  99691: 3dbcfcd
  99687: a37114f
  99679: d38995f
v: v3
  • Loading branch information
Thomas Gleixner committed May 25, 2008
1 parent deacfd7 commit 2b7f8d5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 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: 7f028bc0fd119a4fc65aedc07728ce85c8813d33
refs/heads/master: a91eea6df383f26fc4fcbefcbdb5aee8facd17fd
36 changes: 18 additions & 18 deletions trunk/arch/x86/kernel/e820_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ static unsigned long __initdata end_user_pfn = MAXMEM>>PAGE_SHIFT;
*/
unsigned long __init e820_end_of_ram(void)
{
unsigned long end_pfn;
unsigned long last_pfn;

end_pfn = find_max_pfn_with_active_regions();
last_pfn = find_max_pfn_with_active_regions();

if (end_pfn > max_pfn_mapped)
max_pfn_mapped = end_pfn;
if (last_pfn > max_pfn_mapped)
max_pfn_mapped = last_pfn;
if (max_pfn_mapped > MAXMEM>>PAGE_SHIFT)
max_pfn_mapped = MAXMEM>>PAGE_SHIFT;
if (end_pfn > end_user_pfn)
end_pfn = end_user_pfn;
if (end_pfn > max_pfn_mapped)
end_pfn = max_pfn_mapped;
if (last_pfn > end_user_pfn)
last_pfn = end_user_pfn;
if (last_pfn > max_pfn_mapped)
last_pfn = max_pfn_mapped;

printk(KERN_INFO "max_pfn_mapped = %lu\n", max_pfn_mapped);
return end_pfn;
return last_pfn;
}

/*
Expand Down Expand Up @@ -124,12 +124,12 @@ void __init e820_mark_nosave_regions(void)
}

/*
* Finds an active region in the address range from start_pfn to end_pfn and
* Finds an active region in the address range from start_pfn to last_pfn and
* returns its range in ei_startpfn and ei_endpfn for the e820 entry.
*/
static int __init e820_find_active_region(const struct e820entry *ei,
unsigned long start_pfn,
unsigned long end_pfn,
unsigned long last_pfn,
unsigned long *ei_startpfn,
unsigned long *ei_endpfn)
{
Expand All @@ -146,14 +146,14 @@ static int __init e820_find_active_region(const struct e820entry *ei,

/* Skip if map is outside the node */
if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
*ei_startpfn >= end_pfn)
*ei_startpfn >= last_pfn)
return 0;

/* Check for overlaps */
if (*ei_startpfn < start_pfn)
*ei_startpfn = start_pfn;
if (*ei_endpfn > end_pfn)
*ei_endpfn = end_pfn;
if (*ei_endpfn > last_pfn)
*ei_endpfn = last_pfn;

/* Obey end_user_pfn to save on memmap */
if (*ei_startpfn >= end_user_pfn)
Expand All @@ -167,15 +167,15 @@ static int __init e820_find_active_region(const struct e820entry *ei,
/* Walk the e820 map and register active regions within a node */
void __init
e820_register_active_regions(int nid, unsigned long start_pfn,
unsigned long end_pfn)
unsigned long last_pfn)
{
unsigned long ei_startpfn;
unsigned long ei_endpfn;
int i;

for (i = 0; i < e820.nr_map; i++)
if (e820_find_active_region(&e820.map[i],
start_pfn, end_pfn,
start_pfn, last_pfn,
&ei_startpfn, &ei_endpfn))
add_active_range(nid, ei_startpfn, ei_endpfn);
}
Expand All @@ -188,13 +188,13 @@ e820_register_active_regions(int nid, unsigned long start_pfn,
unsigned long __init e820_hole_size(unsigned long start, unsigned long end)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long end_pfn = end >> PAGE_SHIFT;
unsigned long last_pfn = end >> PAGE_SHIFT;
unsigned long ei_startpfn, ei_endpfn, ram = 0;
int i;

for (i = 0; i < e820.nr_map; i++) {
if (e820_find_active_region(&e820.map[i],
start_pfn, end_pfn,
start_pfn, last_pfn,
&ei_startpfn, &ei_endpfn))
ram += ei_endpfn - ei_startpfn;
}
Expand Down

0 comments on commit 2b7f8d5

Please sign in to comment.