aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/pgtable.h
diff options
context:
space:
mode:
authorToshi Kani <toshi.kani@hp.com>2015-04-14 18:47:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 19:49:04 -0400
commite61ce6ade404ef17bd63d62bec78e29047a47b47 (patch)
tree4a3e14abad0216e51f781b2776562829febe2626 /include/asm-generic/pgtable.h
parent0ddab1d2ed664c85c95488eef569786a84aedf37 (diff)
mm: change ioremap to set up huge I/O mappings
ioremap_pud_range() and ioremap_pmd_range() are changed to create huge I/O mappings when their capability is enabled, and a request meets required conditions -- both virtual & physical addresses are aligned by their huge page size, and a requested range fufills their huge page size. When pud_set_huge() or pmd_set_huge() returns zero, i.e. no-operation is performed, the code simply falls back to the next level. The changes are only enabled when CONFIG_HAVE_ARCH_HUGE_VMAP is defined on the architecture. Signed-off-by: Toshi Kani <toshi.kani@hp.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Robert Elliott <Elliott@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-generic/pgtable.h')
-rw-r--r--include/asm-generic/pgtable.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 1f9f5da6828f..9fb7dc7ca7f4 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/mm_types.h> 7#include <linux/mm_types.h>
8#include <linux/bug.h> 8#include <linux/bug.h>
9#include <linux/errno.h>
9 10
10#if 4 - defined(__PAGETABLE_PUD_FOLDED) - defined(__PAGETABLE_PMD_FOLDED) != \ 11#if 4 - defined(__PAGETABLE_PUD_FOLDED) - defined(__PAGETABLE_PMD_FOLDED) != \
11 CONFIG_PGTABLE_LEVELS 12 CONFIG_PGTABLE_LEVELS
@@ -696,6 +697,20 @@ static inline int pmd_protnone(pmd_t pmd)
696 697
697#endif /* CONFIG_MMU */ 698#endif /* CONFIG_MMU */
698 699
700#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
701int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot);
702int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot);
703#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */
704static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot)
705{
706 return 0;
707}
708static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot)
709{
710 return 0;
711}
712#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */
713
699#endif /* !__ASSEMBLY__ */ 714#endif /* !__ASSEMBLY__ */
700 715
701#ifndef io_remap_pfn_range 716#ifndef io_remap_pfn_range