aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorBernhard Walle <bwalle@suse.de>2008-02-07 03:15:17 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:25 -0500
commit72a7fe3967dbf86cb34e24fbf1d957fe24d2f246 (patch)
treec19f7d0b530577359840e959cce204939caf0649 /arch/parisc
parent25fad945a7f7ff2cf06e437381c6a1121784dbd9 (diff)
Introduce flags for reserve_bootmem()
This patchset adds a flags variable to reserve_bootmem() and uses the BOOTMEM_EXCLUSIVE flag in crashkernel reservation code to detect collisions between crashkernel area and already used memory. This patch: Change the reserve_bootmem() function to accept a new flag BOOTMEM_EXCLUSIVE. If that flag is set, the function returns with -EBUSY if the memory already has been reserved in the past. This is to avoid conflicts. Because that code runs before SMP initialisation, there's no race condition inside reserve_bootmem_core(). [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: fix powerpc build] Signed-off-by: Bernhard Walle <bwalle@suse.de> Cc: <linux-arch@vger.kernel.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/mm/init.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index aa875fa43488..eb80f5e33d7d 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -315,11 +315,13 @@ static void __init setup_bootmem(void)
315#define PDC_CONSOLE_IO_IODC_SIZE 32768 315#define PDC_CONSOLE_IO_IODC_SIZE 32768
316 316
317 reserve_bootmem_node(NODE_DATA(0), 0UL, 317 reserve_bootmem_node(NODE_DATA(0), 0UL,
318 (unsigned long)(PAGE0->mem_free + PDC_CONSOLE_IO_IODC_SIZE)); 318 (unsigned long)(PAGE0->mem_free +
319 PDC_CONSOLE_IO_IODC_SIZE), BOOTMEM_DEFAULT);
319 reserve_bootmem_node(NODE_DATA(0), __pa((unsigned long)_text), 320 reserve_bootmem_node(NODE_DATA(0), __pa((unsigned long)_text),
320 (unsigned long)(_end - _text)); 321 (unsigned long)(_end - _text), BOOTMEM_DEFAULT);
321 reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT), 322 reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT),
322 ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT)); 323 ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT),
324 BOOTMEM_DEFAULT);
323 325
324#ifndef CONFIG_DISCONTIGMEM 326#ifndef CONFIG_DISCONTIGMEM
325 327
@@ -328,7 +330,8 @@ static void __init setup_bootmem(void)
328 for (i = 0; i < npmem_holes; i++) { 330 for (i = 0; i < npmem_holes; i++) {
329 reserve_bootmem_node(NODE_DATA(0), 331 reserve_bootmem_node(NODE_DATA(0),
330 (pmem_holes[i].start_pfn << PAGE_SHIFT), 332 (pmem_holes[i].start_pfn << PAGE_SHIFT),
331 (pmem_holes[i].pages << PAGE_SHIFT)); 333 (pmem_holes[i].pages << PAGE_SHIFT),
334 BOOTMEM_DEFAULT);
332 } 335 }
333#endif 336#endif
334 337
@@ -346,7 +349,8 @@ static void __init setup_bootmem(void)
346 initrd_below_start_ok = 1; 349 initrd_below_start_ok = 1;
347 printk(KERN_INFO "initrd: reserving %08lx-%08lx (mem_max %08lx)\n", __pa(initrd_start), __pa(initrd_start) + initrd_reserve, mem_max); 350 printk(KERN_INFO "initrd: reserving %08lx-%08lx (mem_max %08lx)\n", __pa(initrd_start), __pa(initrd_start) + initrd_reserve, mem_max);
348 351
349 reserve_bootmem_node(NODE_DATA(0),__pa(initrd_start), initrd_reserve); 352 reserve_bootmem_node(NODE_DATA(0), __pa(initrd_start),
353 initrd_reserve, BOOTMEM_DEFAULT);
350 } 354 }
351 } 355 }
352#endif 356#endif