[PATCH 09/10] x86: provide arch-specific valid_phys_addr_range()

From: Petr Tesarik
Date: Fri Jun 17 2011 - 04:58:11 EST


The default implementation in drivers/char/mem.c refuses to map high
memory, but since xlate_dev_mem_ptr() can now handle high memory on
x86, all physical addresses are valid.

We needn't check the available physical memory (or memory holes) here,
because these cases are handled by xlate_dev_mem_ptr (using pfn_valid).

Signed-off-by: Petr Tesarik <ptesarik@xxxxxxx>
---
arch/x86/include/asm/io.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 9b994dd..e3150fe 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -311,6 +311,17 @@ BUILDIO(b, b, char)
BUILDIO(w, w, short)
BUILDIO(l, , int)

+#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
+static inline int valid_phys_addr_range (phys_addr_t addr, size_t size)
+{
+ return 1;
+}
+
+static inline int valid_mmap_phys_addr_range (unsigned long pfn, size_t size)
+{
+ return 1;
+}
+
extern void *xlate_dev_mem_ptr(phys_addr_t phys);
extern void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr);

--
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/