diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2010-01-21 22:21:05 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-01 19:58:17 -0500 |
commit | 13ca0fcaa33f6b1984c4111b6ec5df42689fea6f (patch) | |
tree | 87fa03206241f2a9bf4c6a2d0b1bc883fba12c07 /arch/x86/mm | |
parent | 1b5576e69a5fe168c08a159685ac366316ac9bbc (diff) |
x86: Use the generic page_is_ram()
The generic resource based page_is_ram() works better with memory
hotplug/hotremove. So switch the x86 e820map based code to it.
CC: Andi Kleen <andi@firstfloor.org>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
LKML-Reference: <20100122033004.470767217@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/ioremap.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 30e068d6462e..1bf9e08ed733 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -24,27 +24,6 @@ | |||
24 | 24 | ||
25 | #include "physaddr.h" | 25 | #include "physaddr.h" |
26 | 26 | ||
27 | int page_is_ram(unsigned long pagenr) | ||
28 | { | ||
29 | resource_size_t addr, end; | ||
30 | int i; | ||
31 | |||
32 | for (i = 0; i < e820.nr_map; i++) { | ||
33 | /* | ||
34 | * Not usable memory: | ||
35 | */ | ||
36 | if (e820.map[i].type != E820_RAM) | ||
37 | continue; | ||
38 | addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT; | ||
39 | end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT; | ||
40 | |||
41 | |||
42 | if ((pagenr >= addr) && (pagenr < end)) | ||
43 | return 1; | ||
44 | } | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | /* | 27 | /* |
49 | * Fix up the linear direct mapping of the kernel to avoid cache attribute | 28 | * Fix up the linear direct mapping of the kernel to avoid cache attribute |
50 | * conflicts. | 29 | * conflicts. |