aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/mm/contig.c30
-rw-r--r--arch/ia64/mm/discontig.c4
-rw-r--r--arch/ia64/mm/init.c16
-rw-r--r--include/asm-ia64/meminit.h1
4 files changed, 24 insertions, 27 deletions
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c
index fb0f4698f5d0..44ce5ed9444c 100644
--- a/arch/ia64/mm/contig.c
+++ b/arch/ia64/mm/contig.c
@@ -97,26 +97,6 @@ void show_mem(void)
97unsigned long bootmap_start; 97unsigned long bootmap_start;
98 98
99/** 99/**
100 * find_max_pfn - adjust the maximum page number callback
101 * @start: start of range
102 * @end: end of range
103 * @arg: address of pointer to global max_pfn variable
104 *
105 * Passed as a callback function to efi_memmap_walk() to determine the highest
106 * available page frame number in the system.
107 */
108int
109find_max_pfn (unsigned long start, unsigned long end, void *arg)
110{
111 unsigned long *max_pfnp = arg, pfn;
112
113 pfn = (PAGE_ALIGN(end - 1) - PAGE_OFFSET) >> PAGE_SHIFT;
114 if (pfn > *max_pfnp)
115 *max_pfnp = pfn;
116 return 0;
117}
118
119/**
120 * find_bootmap_location - callback to find a memory area for the bootmap 100 * find_bootmap_location - callback to find a memory area for the bootmap
121 * @start: start of region 101 * @start: start of region
122 * @end: end of region 102 * @end: end of region
@@ -177,9 +157,10 @@ find_memory (void)
177 reserve_memory(); 157 reserve_memory();
178 158
179 /* first find highest page frame number */ 159 /* first find highest page frame number */
180 max_pfn = 0; 160 min_low_pfn = ~0UL;
181 efi_memmap_walk(find_max_pfn, &max_pfn); 161 max_low_pfn = 0;
182 162 efi_memmap_walk(find_max_min_low_pfn, NULL);
163 max_pfn = max_low_pfn;
183 /* how many bytes to cover all the pages */ 164 /* how many bytes to cover all the pages */
184 bootmap_size = bootmem_bootmap_pages(max_pfn) << PAGE_SHIFT; 165 bootmap_size = bootmem_bootmap_pages(max_pfn) << PAGE_SHIFT;
185 166
@@ -189,7 +170,8 @@ find_memory (void)
189 if (bootmap_start == ~0UL) 170 if (bootmap_start == ~0UL)
190 panic("Cannot find %ld bytes for bootmap\n", bootmap_size); 171 panic("Cannot find %ld bytes for bootmap\n", bootmap_size);
191 172
192 bootmap_size = init_bootmem(bootmap_start >> PAGE_SHIFT, max_pfn); 173 bootmap_size = init_bootmem_node(NODE_DATA(0),
174 (bootmap_start >> PAGE_SHIFT), 0, max_pfn);
193 175
194 /* Free all available memory, then mark bootmem-map as being in use. */ 176 /* Free all available memory, then mark bootmem-map as being in use. */
195 efi_memmap_walk(filter_rsvd_memory, free_bootmem); 177 efi_memmap_walk(filter_rsvd_memory, free_bootmem);
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index 11a2d8825d89..872da7a2accd 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -88,9 +88,6 @@ static int __init build_node_maps(unsigned long start, unsigned long len,
88 bdp->node_low_pfn = max(epfn, bdp->node_low_pfn); 88 bdp->node_low_pfn = max(epfn, bdp->node_low_pfn);
89 } 89 }
90 90
91 min_low_pfn = min(min_low_pfn, bdp->node_boot_start>>PAGE_SHIFT);
92 max_low_pfn = max(max_low_pfn, bdp->node_low_pfn);
93
94 return 0; 91 return 0;
95} 92}
96 93
@@ -438,6 +435,7 @@ void __init find_memory(void)
438 /* These actually end up getting called by call_pernode_memory() */ 435 /* These actually end up getting called by call_pernode_memory() */
439 efi_memmap_walk(filter_rsvd_memory, build_node_maps); 436 efi_memmap_walk(filter_rsvd_memory, build_node_maps);
440 efi_memmap_walk(filter_rsvd_memory, find_pernode_space); 437 efi_memmap_walk(filter_rsvd_memory, find_pernode_space);
438 efi_memmap_walk(find_max_min_low_pfn, NULL);
441 439
442 for_each_online_node(node) 440 for_each_online_node(node)
443 if (mem_data[node].bootmem_data.node_low_pfn) { 441 if (mem_data[node].bootmem_data.node_low_pfn) {
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index f225dd72968b..c8da621aab17 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -648,6 +648,22 @@ count_reserved_pages (u64 start, u64 end, void *arg)
648 return 0; 648 return 0;
649} 649}
650 650
651int
652find_max_min_low_pfn (unsigned long start, unsigned long end, void *arg)
653{
654 unsigned long pfn_start, pfn_end;
655#ifdef CONFIG_FLATMEM
656 pfn_start = (PAGE_ALIGN(__pa(start))) >> PAGE_SHIFT;
657 pfn_end = (PAGE_ALIGN(__pa(end - 1))) >> PAGE_SHIFT;
658#else
659 pfn_start = GRANULEROUNDDOWN(__pa(start)) >> PAGE_SHIFT;
660 pfn_end = GRANULEROUNDUP(__pa(end - 1)) >> PAGE_SHIFT;
661#endif
662 min_low_pfn = min(min_low_pfn, pfn_start);
663 max_low_pfn = max(max_low_pfn, pfn_end);
664 return 0;
665}
666
651/* 667/*
652 * Boot command-line option "nolwsys" can be used to disable the use of any light-weight 668 * Boot command-line option "nolwsys" can be used to disable the use of any light-weight
653 * system call handler. When this option is in effect, all fsyscalls will end up bubbling 669 * system call handler. When this option is in effect, all fsyscalls will end up bubbling
diff --git a/include/asm-ia64/meminit.h b/include/asm-ia64/meminit.h
index 21ec5f3d23de..3a62878e84f3 100644
--- a/include/asm-ia64/meminit.h
+++ b/include/asm-ia64/meminit.h
@@ -36,6 +36,7 @@ extern void reserve_memory (void);
36extern void find_initrd (void); 36extern void find_initrd (void);
37extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg); 37extern int filter_rsvd_memory (unsigned long start, unsigned long end, void *arg);
38extern void efi_memmap_init(unsigned long *, unsigned long *); 38extern void efi_memmap_init(unsigned long *, unsigned long *);
39extern int find_max_min_low_pfn (unsigned long , unsigned long, void *);
39 40
40extern unsigned long vmcore_find_descriptor_size(unsigned long address); 41extern unsigned long vmcore_find_descriptor_size(unsigned long address);
41extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end); 42extern int reserve_elfcorehdr(unsigned long *start, unsigned long *end);