diff options
Diffstat (limited to 'arch/sh/mm/numa.c')
-rw-r--r-- | arch/sh/mm/numa.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/sh/mm/numa.c b/arch/sh/mm/numa.c index 6c524446c0f6..422e92721878 100644 --- a/arch/sh/mm/numa.c +++ b/arch/sh/mm/numa.c | |||
@@ -28,7 +28,7 @@ void __init setup_memory(void) | |||
28 | { | 28 | { |
29 | unsigned long free_pfn = PFN_UP(__pa(_end)); | 29 | unsigned long free_pfn = PFN_UP(__pa(_end)); |
30 | u64 base = min_low_pfn << PAGE_SHIFT; | 30 | u64 base = min_low_pfn << PAGE_SHIFT; |
31 | u64 size = (max_low_pfn << PAGE_SHIFT) - min_low_pfn; | 31 | u64 size = (max_low_pfn << PAGE_SHIFT) - base; |
32 | 32 | ||
33 | lmb_add(base, size); | 33 | lmb_add(base, size); |
34 | 34 | ||
@@ -38,6 +38,15 @@ void __init setup_memory(void) | |||
38 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); | 38 | (__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET)); |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET. | ||
42 | */ | ||
43 | if (CONFIG_ZERO_PAGE_OFFSET != 0) | ||
44 | lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET); | ||
45 | |||
46 | lmb_analyze(); | ||
47 | lmb_dump_all(); | ||
48 | |||
49 | /* | ||
41 | * Node 0 sets up its pgdat at the first available pfn, | 50 | * Node 0 sets up its pgdat at the first available pfn, |
42 | * and bumps it up before setting up the bootmem allocator. | 51 | * and bumps it up before setting up the bootmem allocator. |
43 | */ | 52 | */ |
@@ -71,7 +80,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
71 | 80 | ||
72 | /* Node-local pgdat */ | 81 | /* Node-local pgdat */ |
73 | NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data), | 82 | NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data), |
74 | SMP_CACHE_BYTES, end_pfn)); | 83 | SMP_CACHE_BYTES, end)); |
75 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); | 84 | memset(NODE_DATA(nid), 0, sizeof(struct pglist_data)); |
76 | 85 | ||
77 | NODE_DATA(nid)->bdata = &bootmem_node_data[nid]; | 86 | NODE_DATA(nid)->bdata = &bootmem_node_data[nid]; |
@@ -81,7 +90,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end) | |||
81 | /* Node-local bootmap */ | 90 | /* Node-local bootmap */ |
82 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); | 91 | bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); |
83 | bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT, | 92 | bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT, |
84 | PAGE_SIZE, end_pfn); | 93 | PAGE_SIZE, end); |
85 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, | 94 | init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, |
86 | start_pfn, end_pfn); | 95 | start_pfn, end_pfn); |
87 | 96 | ||