aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2010-10-06 18:52:29 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-10-11 18:59:01 -0400
commit236260b90dd94516982ad67aa6f5449c4c37db7b (patch)
tree45fc2bc1053e41630f88a1a4c4757bba817f34e8 /mm
parent153db80f8cf74e8700cac96305b6c0b92918f17c (diff)
memblock: Allow memblock_init to be called early
The Xen setup code needs to call memblock_x86_reserve_range() very early, so allow it to initialize the memblock subsystem before doing so. The second memblock_init() is ignored. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> LKML-Reference: <4CACFDAD.3090900@goop.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 9ad39690a2bd..ae8b06c828c7 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -752,6 +752,12 @@ void __init memblock_analyze(void)
752 752
753void __init memblock_init(void) 753void __init memblock_init(void)
754{ 754{
755 static int init_done __initdata = 0;
756
757 if (init_done)
758 return;
759 init_done = 1;
760
755 /* Hookup the initial arrays */ 761 /* Hookup the initial arrays */
756 memblock.memory.regions = memblock_memory_init_regions; 762 memblock.memory.regions = memblock_memory_init_regions;
757 memblock.memory.max = INIT_MEMBLOCK_REGIONS; 763 memblock.memory.max = INIT_MEMBLOCK_REGIONS;