Skip to content

Commit

Permalink
x86: Use the generic page_is_ram()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wu Fengguang authored and H. Peter Anvin committed Feb 2, 2010
1 parent 1b5576e commit 13ca0fc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
1 change: 0 additions & 1 deletion arch/x86/include/asm/page_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

#ifndef __ASSEMBLY__

extern int page_is_ram(unsigned long pagenr);
extern int devmem_is_allowed(unsigned long pagenr);

extern unsigned long max_low_pfn_mapped;
Expand Down
21 changes: 0 additions & 21 deletions arch/x86/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,6 @@

#include "physaddr.h"

int page_is_ram(unsigned long pagenr)
{
resource_size_t addr, end;
int i;

for (i = 0; i < e820.nr_map; i++) {
/*
* Not usable memory:
*/
if (e820.map[i].type != E820_RAM)
continue;
addr = (e820.map[i].addr + PAGE_SIZE-1) >> PAGE_SHIFT;
end = (e820.map[i].addr + e820.map[i].size) >> PAGE_SHIFT;


if ((pagenr >= addr) && (pagenr < end))
return 1;
}
return 0;
}

/*
* Fix up the linear direct mapping of the kernel to avoid cache attribute
* conflicts.
Expand Down

0 comments on commit 13ca0fc

Please sign in to comment.