|
40 | 40 | #include <linux/acpi.h> |
41 | 41 | #include <linux/kallsyms.h> |
42 | 42 | #include <linux/edd.h> |
| 43 | +#include <linux/mmzone.h> |
| 44 | + |
43 | 45 | #include <asm/mtrr.h> |
44 | 46 | #include <asm/uaccess.h> |
45 | 47 | #include <asm/system.h> |
@@ -378,16 +380,19 @@ static __init void parse_cmdline_early (char ** cmdline_p) |
378 | 380 | } |
379 | 381 |
|
380 | 382 | #ifndef CONFIG_NUMA |
381 | | -static void __init contig_initmem_init(void) |
| 383 | +static void __init |
| 384 | +contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn) |
382 | 385 | { |
383 | | - unsigned long bootmap_size, bootmap; |
384 | | - bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; |
385 | | - bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size); |
386 | | - if (bootmap == -1L) |
387 | | - panic("Cannot find bootmem map of size %ld\n",bootmap_size); |
388 | | - bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, end_pfn); |
389 | | - e820_bootmem_free(NODE_DATA(0), 0, end_pfn << PAGE_SHIFT); |
390 | | - reserve_bootmem(bootmap, bootmap_size); |
| 386 | + unsigned long bootmap_size, bootmap; |
| 387 | + |
| 388 | + memory_present(0, start_pfn, end_pfn); |
| 389 | + bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; |
| 390 | + bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size); |
| 391 | + if (bootmap == -1L) |
| 392 | + panic("Cannot find bootmem map of size %ld\n",bootmap_size); |
| 393 | + bootmap_size = init_bootmem(bootmap >> PAGE_SHIFT, end_pfn); |
| 394 | + e820_bootmem_free(NODE_DATA(0), 0, end_pfn << PAGE_SHIFT); |
| 395 | + reserve_bootmem(bootmap, bootmap_size); |
391 | 396 | } |
392 | 397 | #endif |
393 | 398 |
|
@@ -557,7 +562,7 @@ void __init setup_arch(char **cmdline_p) |
557 | 562 | #ifdef CONFIG_NUMA |
558 | 563 | numa_initmem_init(0, end_pfn); |
559 | 564 | #else |
560 | | - contig_initmem_init(); |
| 565 | + contig_initmem_init(0, end_pfn); |
561 | 566 | #endif |
562 | 567 |
|
563 | 568 | /* Reserve direct mapping */ |
@@ -618,6 +623,8 @@ void __init setup_arch(char **cmdline_p) |
618 | 623 | } |
619 | 624 | } |
620 | 625 | #endif |
| 626 | + |
| 627 | + sparse_init(); |
621 | 628 | paging_init(); |
622 | 629 |
|
623 | 630 | check_ioapic(); |
|
0 commit comments