From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yinghai Lu Subject: [PATCH 29/50] memblock: Prepare x86 to use memblock to replace early_res Date: Tue, 13 Jul 2010 00:10:23 -0700 Message-ID: <1279005044-24777-30-git-send-email-yinghai@kernel.org> References: <1279005044-24777-1-git-send-email-yinghai@kernel.org> Return-path: In-Reply-To: <1279005044-24777-1-git-send-email-yinghai@kernel.org> Sender: linux-kernel-owner@vger.kernel.org To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , David Miller , Be Cc: Linus Torvalds , Johannes Weiner , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Yinghai Lu List-Id: linux-arch.vger.kernel.org 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 --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcsinet10.oracle.com ([148.87.113.121]:28665 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754100Ab0GMHQY (ORCPT ); Tue, 13 Jul 2010 03:16:24 -0400 From: Yinghai Lu Subject: [PATCH 29/50] memblock: Prepare x86 to use memblock to replace early_res Date: Tue, 13 Jul 2010 00:10:23 -0700 Message-ID: <1279005044-24777-30-git-send-email-yinghai@kernel.org> In-Reply-To: <1279005044-24777-1-git-send-email-yinghai@kernel.org> References: <1279005044-24777-1-git-send-email-yinghai@kernel.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , David Miller , Benjamin Herrenschmidt Cc: Linus Torvalds , Johannes Weiner , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Yinghai Lu Message-ID: <20100713071023.M-O5HahwZANF9Rq9YvLR3pi7szzvnPv3z3vq9xLlvpI@z> 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 --- 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