[PATCH 28/49] memblock: Prepare x86 to use memblock to replace early_res

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Monday, July 19, 2010 - 4:56 pm

1. expose memblock_debug
2. expose memblock_reserved_init_regions

-v2: drop memblock_add_region() and MEMBLOCK_ERROR export
-v3: seperate wrong return of memblock_fin_base to another patch
-v4: expose memblock_can_resize to handle x86 EFI that could have more than
      128 entries
-v5: add memblock_dbg, so we can spare some if (memblock_debug) suggested by Ingo.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 include/linux/memblock.h |    6 ++++++
 mm/memblock.c            |    5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 08a12cf..70bc467 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -39,6 +39,12 @@ struct memblock {
 };
 
 extern struct memblock memblock;
+extern int memblock_debug;
+extern int memblock_can_resize;
+extern struct memblock_region memblock_reserved_init_regions[];
+
+#define memblock_dbg(fmt, ...) \
+	if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
 
 extern void __init memblock_init(void);
 extern void __init memblock_analyze(void);
diff --git a/mm/memblock.c b/mm/memblock.c
index b5eb901..c16d4c6 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -22,9 +22,10 @@
 
 struct memblock memblock;
 
-static int memblock_debug, memblock_can_resize;
+int memblock_debug;
+int memblock_can_resize;
 static struct memblock_region memblock_memory_init_regions[INIT_MEMBLOCK_REGIONS + 1];
-static struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS + 1];
+struct memblock_region memblock_reserved_init_regions[INIT_MEMBLOCK_REGIONS + 1];
 
 #define MEMBLOCK_ERROR	(~(phys_addr_t)0)
 
-- 
1.6.4.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -v25 00/49] Use memblock with x86, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 02/49] x86,mm: fix 32bit numa sparsemem, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 28/49] memblock: Prepare x86 to use memblock to rep ..., Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 33/49] memblock: Add memblock_find_in_range(), Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 40/49] memblock: Add find_memory_core_early(), Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 45/49] x86: Use memblock to replace early_res, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 47/49] x86: Remove not used early_res code, Yinghai Lu, (Mon Jul 19, 4:56 pm)
[PATCH 49/49] x86: remove old bootmem code, Yinghai Lu, (Mon Jul 19, 4:56 pm)
Re: [PATCH -v25 00/49] Use memblock with x86, Linus Torvalds, (Mon Jul 19, 5:14 pm)
Re: [PATCH -v25 00/49] Use memblock with x86, Yinghai Lu, (Mon Jul 19, 5:35 pm)
Re: [PATCH -v25 00/49] Use memblock with x86, H. Peter Anvin, (Tue Jul 20, 11:29 am)