|
@@ -51,21 +51,21 @@ static unsigned long __initdata end_user_pfn = MAXMEM>>PAGE_SHIFT;
|
|
*/
|
|
*/
|
|
unsigned long __init e820_end_of_ram(void)
|
|
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)
|
|
if (max_pfn_mapped > MAXMEM>>PAGE_SHIFT)
|
|
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);
|
|
printk(KERN_INFO "max_pfn_mapped = %lu\n", max_pfn_mapped);
|
|
- return end_pfn;
|
|
|
|
|
|
+ return last_pfn;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -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.
|
|
* returns its range in ei_startpfn and ei_endpfn for the e820 entry.
|
|
*/
|
|
*/
|
|
static int __init e820_find_active_region(const struct e820entry *ei,
|
|
static int __init e820_find_active_region(const struct e820entry *ei,
|
|
unsigned long start_pfn,
|
|
unsigned long start_pfn,
|
|
- unsigned long end_pfn,
|
|
|
|
|
|
+ unsigned long last_pfn,
|
|
unsigned long *ei_startpfn,
|
|
unsigned long *ei_startpfn,
|
|
unsigned long *ei_endpfn)
|
|
unsigned long *ei_endpfn)
|
|
{
|
|
{
|
|
@@ -146,14 +146,14 @@ static int __init e820_find_active_region(const struct e820entry *ei,
|
|
|
|
|
|
/* Skip if map is outside the node */
|
|
/* Skip if map is outside the node */
|
|
if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
|
|
if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
|
|
- *ei_startpfn >= end_pfn)
|
|
|
|
|
|
+ *ei_startpfn >= last_pfn)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
/* Check for overlaps */
|
|
/* Check for overlaps */
|
|
if (*ei_startpfn < start_pfn)
|
|
if (*ei_startpfn < start_pfn)
|
|
*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 */
|
|
/* Obey end_user_pfn to save on memmap */
|
|
if (*ei_startpfn >= end_user_pfn)
|
|
if (*ei_startpfn >= end_user_pfn)
|
|
@@ -167,7 +167,7 @@ static int __init e820_find_active_region(const struct e820entry *ei,
|
|
/* Walk the e820 map and register active regions within a node */
|
|
/* Walk the e820 map and register active regions within a node */
|
|
void __init
|
|
void __init
|
|
e820_register_active_regions(int nid, unsigned long start_pfn,
|
|
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_startpfn;
|
|
unsigned long ei_endpfn;
|
|
unsigned long ei_endpfn;
|
|
@@ -175,7 +175,7 @@ e820_register_active_regions(int nid, unsigned long start_pfn,
|
|
|
|
|
|
for (i = 0; i < e820.nr_map; i++)
|
|
for (i = 0; i < e820.nr_map; i++)
|
|
if (e820_find_active_region(&e820.map[i],
|
|
if (e820_find_active_region(&e820.map[i],
|
|
- start_pfn, end_pfn,
|
|
|
|
|
|
+ start_pfn, last_pfn,
|
|
&ei_startpfn, &ei_endpfn))
|
|
&ei_startpfn, &ei_endpfn))
|
|
add_active_range(nid, ei_startpfn, ei_endpfn);
|
|
add_active_range(nid, ei_startpfn, ei_endpfn);
|
|
}
|
|
}
|
|
@@ -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 __init e820_hole_size(unsigned long start, unsigned long end)
|
|
{
|
|
{
|
|
unsigned long start_pfn = start >> PAGE_SHIFT;
|
|
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;
|
|
unsigned long ei_startpfn, ei_endpfn, ram = 0;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
for (i = 0; i < e820.nr_map; i++) {
|
|
for (i = 0; i < e820.nr_map; i++) {
|
|
if (e820_find_active_region(&e820.map[i],
|
|
if (e820_find_active_region(&e820.map[i],
|
|
- start_pfn, end_pfn,
|
|
|
|
|
|
+ start_pfn, last_pfn,
|
|
&ei_startpfn, &ei_endpfn))
|
|
&ei_startpfn, &ei_endpfn))
|
|
ram += ei_endpfn - ei_startpfn;
|
|
ram += ei_endpfn - ei_startpfn;
|
|
}
|
|
}
|