memblock: Option for the architecture to put memblock into the .init section

Arch code can define ARCH_DISCARD_MEMBLOCK in asm/memblock.h,
which in turns causes memblock code and data to go respectively
into the .init and .initdata sections. This will be used by the
x86 architecture.

If ARCH_DISCARD_MEMBLOCK is defined, the debugfs files to inspect
the memblock arrays after boot are not created.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Yinghai Lu 2010-07-28 15:43:02 +10:00 committed by Benjamin Herrenschmidt
parent f0b37fad9a
commit 10d0643988
2 changed files with 32 additions and 24 deletions

View file

@ -149,6 +149,14 @@ static inline unsigned long memblock_region_pages(const struct memblock_region *
region++)
#ifdef ARCH_DISCARD_MEMBLOCK
#define __init_memblock __init
#define __initdata_memblock __initdata
#else
#define __init_memblock
#define __initdata_memblock
#endif
#endif /* CONFIG_HAVE_MEMBLOCK */
#endif /* __KERNEL__ */