|
@@ -580,24 +580,19 @@ static void __init update_e820_saved(void)
|
|
|
}
|
|
|
#define MAX_GAP_END 0x100000000ull
|
|
|
/*
|
|
|
- * Search for a gap in the e820 memory space from start_addr to end_addr.
|
|
|
+ * Search for a gap in the e820 memory space from 0 to MAX_GAP_END.
|
|
|
*/
|
|
|
-__init int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize,
|
|
|
- unsigned long start_addr, unsigned long long end_addr)
|
|
|
+static int __init e820_search_gap(unsigned long *gapstart,
|
|
|
+ unsigned long *gapsize)
|
|
|
{
|
|
|
- unsigned long long last;
|
|
|
+ unsigned long long last = MAX_GAP_END;
|
|
|
int i = e820->nr_map;
|
|
|
int found = 0;
|
|
|
|
|
|
- last = (end_addr && end_addr < MAX_GAP_END) ? end_addr : MAX_GAP_END;
|
|
|
-
|
|
|
while (--i >= 0) {
|
|
|
unsigned long long start = e820->map[i].addr;
|
|
|
unsigned long long end = start + e820->map[i].size;
|
|
|
|
|
|
- if (end < start_addr)
|
|
|
- continue;
|
|
|
-
|
|
|
/*
|
|
|
* Since "last" is at most 4GB, we know we'll
|
|
|
* fit in 32 bits if this condition is true
|
|
@@ -628,9 +623,8 @@ __init void e820_setup_gap(void)
|
|
|
unsigned long gapstart, gapsize;
|
|
|
int found;
|
|
|
|
|
|
- gapstart = 0x10000000;
|
|
|
gapsize = 0x400000;
|
|
|
- found = e820_search_gap(&gapstart, &gapsize, 0, MAX_GAP_END);
|
|
|
+ found = e820_search_gap(&gapstart, &gapsize);
|
|
|
|
|
|
#ifdef CONFIG_X86_64
|
|
|
if (!found) {
|