[PATCH -v2 1/6] x86: Change get_max_mapped() to inline

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Wednesday, December 29, 2010 - 4:45 pm

Move it into head file. to prepare use it in other files.

-v2: hpa pointed out that u64 should not be used here.
     Actually We could unsigned long here. because for 32bit it will under 4g.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/include/asm/page_types.h |    5 +++++
 arch/x86/kernel/setup.c           |    9 ---------
 2 files changed, 5 insertions(+), 9 deletions(-)

Index: linux-2.6/arch/x86/include/asm/page_types.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/page_types.h
+++ linux-2.6/arch/x86/include/asm/page_types.h
@@ -45,6 +45,11 @@ extern int devmem_is_allowed(unsigned lo
 extern unsigned long max_low_pfn_mapped;
 extern unsigned long max_pfn_mapped;
 
+static inline unsigned long get_max_mapped(void)
+{
+	return max_pfn_mapped<<PAGE_SHIFT;
+}
+
 extern unsigned long init_memory_mapping(unsigned long start,
 					 unsigned long end);
 
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -680,15 +680,6 @@ static int __init parse_reservelow(char
 
 early_param("reservelow", parse_reservelow);
 
-static u64 __init get_max_mapped(void)
-{
-	u64 end = max_pfn_mapped;
-
-	end <<= PAGE_SHIFT;
-
-	return end;
-}
-
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3] memblock related top down, Yinghai Lu, (Fri Dec 17, 5:58 pm)
[PATCH 0/6] memblock related further cleanup for x86, Yinghai Lu, (Mon Dec 27, 5:47 pm)
[PATCH 1/6] x86: Change get_max_mapped() to inline, Yinghai Lu, (Mon Dec 27, 5:47 pm)
[PATCH 6/6] x86: Rename e820_table_* to pgt_buf_*, Yinghai Lu, (Mon Dec 27, 5:48 pm)
Re: [PATCH 0/3] memblock related top down, H. Peter Anvin, (Tue Dec 28, 1:21 pm)
Re: [PATCH 0/3] memblock related top down, Yinghai Lu, (Tue Dec 28, 2:36 pm)
Re: [PATCH 0/3] memblock related top down, H. Peter Anvin, (Tue Dec 28, 3:09 pm)
Re: [PATCH 0/3] memblock related top down, Yinghai Lu, (Tue Dec 28, 3:25 pm)
Re: [PATCH 1/6] x86: Change get_max_mapped() to inline, H. Peter Anvin, (Wed Dec 29, 4:05 pm)
Re: [PATCH 1/6] x86: Change get_max_mapped() to inline, H. Peter Anvin, (Wed Dec 29, 4:42 pm)
[PATCH -v2 1/6] x86: Change get_max_mapped() to inline, Yinghai Lu, (Wed Dec 29, 4:45 pm)