Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=266b9f8727976769e2ed2dad77ac9295f37e321e Commit: 266b9f8727976769e2ed2dad77ac9295f37e321e Parent: 950f9d95bed1a366434d3597ea75f5b9d772d74f Author: Thomas Gleixner <[EMAIL PROTECTED]> AuthorDate: Wed Jan 30 13:34:06 2008 +0100 Committer: Ingo Molnar <[EMAIL PROTECTED]> CommitDate: Wed Jan 30 13:34:06 2008 +0100
x86: fix ioremap RAM check Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]> --- arch/x86/mm/ioremap.c | 17 ++++------------- 1 files changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 24e42ca..e84c09e 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -125,23 +125,14 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, if (phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS) return (__force void __iomem *)phys_to_virt(phys_addr); -#ifdef CONFIG_X86_32 /* * Don't allow anybody to remap normal RAM that we're using.. */ - if (phys_addr <= virt_to_phys(high_memory - 1)) { - char *t_addr, *t_end; - struct page *page; - - t_addr = __va(phys_addr); - t_end = t_addr + (size - 1); - - for (page = virt_to_page(t_addr); - page <= virt_to_page(t_end); page++) - if (!PageReserved(page)) - return NULL; + for (offset = phys_addr >> PAGE_SHIFT; offset < max_pfn_mapped && + (offset << PAGE_SHIFT) < last_addr; offset++) { + if (page_is_ram(offset)) + return NULL; } -#endif pgprot = MAKE_GLOBAL(__PAGE_KERNEL | flags); - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html