diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-06-29 15:17:15 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-29 17:14:30 -0400 |
commit | ff0daca525dde796382b9ccd563f169df2571211 (patch) | |
tree | acb3feb60cec39f316447f702a2277a7448cbad9 /include/asm-arm | |
parent | ba53201180e267bd1f0792e6c375ced7c100738e (diff) |
[ARM] Add section support to ioremap
Allow section mappings to be setup using ioremap() and torn down
with iounmap(). This requires additional support in the MM
context switch to ensure that mappings are properly synchronised
when mapped in.
Based an original implementation by Deepak Saxena, reworked and
ARMv6 support added by rmk.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/memory.h | 5 | ||||
-rw-r--r-- | include/asm-arm/mmu.h | 1 | ||||
-rw-r--r-- | include/asm-arm/mmu_context.h | 12 |
3 files changed, 17 insertions, 1 deletions
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index 94f973b704f1..176a4fb04989 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h | |||
@@ -68,6 +68,11 @@ | |||
68 | */ | 68 | */ |
69 | #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) | 69 | #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) |
70 | 70 | ||
71 | /* | ||
72 | * Allow 2MB-aligned ioremap pages | ||
73 | */ | ||
74 | #define IOREMAP_MAX_ORDER 21 | ||
75 | |||
71 | #else /* CONFIG_MMU */ | 76 | #else /* CONFIG_MMU */ |
72 | 77 | ||
73 | /* | 78 | /* |
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h index 23dde52e0945..fe2a23b5627b 100644 --- a/include/asm-arm/mmu.h +++ b/include/asm-arm/mmu.h | |||
@@ -7,6 +7,7 @@ typedef struct { | |||
7 | #if __LINUX_ARM_ARCH__ >= 6 | 7 | #if __LINUX_ARM_ARCH__ >= 6 |
8 | unsigned int id; | 8 | unsigned int id; |
9 | #endif | 9 | #endif |
10 | unsigned int kvm_seq; | ||
10 | } mm_context_t; | 11 | } mm_context_t; |
11 | 12 | ||
12 | #if __LINUX_ARM_ARCH__ >= 6 | 13 | #if __LINUX_ARM_ARCH__ >= 6 |
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h index 9fadb01e030d..d1a65b1edcaa 100644 --- a/include/asm-arm/mmu_context.h +++ b/include/asm-arm/mmu_context.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
18 | #include <asm/proc-fns.h> | 18 | #include <asm/proc-fns.h> |
19 | 19 | ||
20 | void __check_kvm_seq(struct mm_struct *mm); | ||
21 | |||
20 | #if __LINUX_ARM_ARCH__ >= 6 | 22 | #if __LINUX_ARM_ARCH__ >= 6 |
21 | 23 | ||
22 | /* | 24 | /* |
@@ -45,13 +47,21 @@ static inline void check_context(struct mm_struct *mm) | |||
45 | { | 47 | { |
46 | if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) | 48 | if (unlikely((mm->context.id ^ cpu_last_asid) >> ASID_BITS)) |
47 | __new_context(mm); | 49 | __new_context(mm); |
50 | |||
51 | if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) | ||
52 | __check_kvm_seq(mm); | ||
48 | } | 53 | } |
49 | 54 | ||
50 | #define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0) | 55 | #define init_new_context(tsk,mm) (__init_new_context(tsk,mm),0) |
51 | 56 | ||
52 | #else | 57 | #else |
53 | 58 | ||
54 | #define check_context(mm) do { } while (0) | 59 | static inline void check_context(struct mm_struct *mm) |
60 | { | ||
61 | if (unlikely(mm->context.kvm_seq != init_mm.context.kvm_seq)) | ||
62 | __check_kvm_seq(mm); | ||
63 | } | ||
64 | |||
55 | #define init_new_context(tsk,mm) 0 | 65 | #define init_new_context(tsk,mm) 0 |
56 | 66 | ||
57 | #endif | 67 | #endif |