aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/kmap_types.h26
-rw-r--r--arch/avr32/include/asm/kmap_types.h24
-rw-r--r--arch/frv/include/asm/highmem.h34
-rw-r--r--arch/frv/include/asm/kmap_types.h24
-rw-r--r--arch/frv/mb93090-mb00/pci-dma.c4
-rw-r--r--arch/frv/mm/cache-page.c8
-rw-r--r--arch/frv/mm/highmem.c20
-rw-r--r--arch/powerpc/include/asm/kmap_types.h31
-rw-r--r--arch/tile/include/asm/kmap_types.h31
-rw-r--r--arch/tile/mm/highmem.c2
-rw-r--r--arch/um/include/asm/kmap_types.h18
11 files changed, 33 insertions, 189 deletions
diff --git a/arch/arm/include/asm/kmap_types.h b/arch/arm/include/asm/kmap_types.h
index e51b1e81df05..83eb2f772911 100644
--- a/arch/arm/include/asm/kmap_types.h
+++ b/arch/arm/include/asm/kmap_types.h
@@ -4,30 +4,6 @@
4/* 4/*
5 * This is the "bare minimum". AIO seems to require this. 5 * This is the "bare minimum". AIO seems to require this.
6 */ 6 */
7enum km_type { 7#define KM_TYPE_NR 16
8 KM_BOUNCE_READ,
9 KM_SKB_SUNRPC_DATA,
10 KM_SKB_DATA_SOFTIRQ,
11 KM_USER0,
12 KM_USER1,
13 KM_BIO_SRC_IRQ,
14 KM_BIO_DST_IRQ,
15 KM_PTE0,
16 KM_PTE1,
17 KM_IRQ0,
18 KM_IRQ1,
19 KM_SOFTIRQ0,
20 KM_SOFTIRQ1,
21 KM_L1_CACHE,
22 KM_L2_CACHE,
23 KM_KDB,
24 KM_TYPE_NR
25};
26
27#ifdef CONFIG_DEBUG_HIGHMEM
28#define KM_NMI (-1)
29#define KM_NMI_PTE (-1)
30#define KM_IRQ_PTE (-1)
31#endif
32 8
33#endif 9#endif
diff --git a/arch/avr32/include/asm/kmap_types.h b/arch/avr32/include/asm/kmap_types.h
index b7f5c6870107..479330b89796 100644
--- a/arch/avr32/include/asm/kmap_types.h
+++ b/arch/avr32/include/asm/kmap_types.h
@@ -2,29 +2,9 @@
2#define __ASM_AVR32_KMAP_TYPES_H 2#define __ASM_AVR32_KMAP_TYPES_H
3 3
4#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
5# define D(n) __KM_FENCE_##n , 5# define KM_TYPE_NR 29
6#else 6#else
7# define D(n) 7# define KM_TYPE_NR 14
8#endif 8#endif
9 9
10enum km_type {
11D(0) KM_BOUNCE_READ,
12D(1) KM_SKB_SUNRPC_DATA,
13D(2) KM_SKB_DATA_SOFTIRQ,
14D(3) KM_USER0,
15D(4) KM_USER1,
16D(5) KM_BIO_SRC_IRQ,
17D(6) KM_BIO_DST_IRQ,
18D(7) KM_PTE0,
19D(8) KM_PTE1,
20D(9) KM_PTE2,
21D(10) KM_IRQ0,
22D(11) KM_IRQ1,
23D(12) KM_SOFTIRQ0,
24D(13) KM_SOFTIRQ1,
25D(14) KM_TYPE_NR
26};
27
28#undef D
29
30#endif /* __ASM_AVR32_KMAP_TYPES_H */ 10#endif /* __ASM_AVR32_KMAP_TYPES_H */
diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h
index 716956a5317b..b3adc93611f3 100644
--- a/arch/frv/include/asm/highmem.h
+++ b/arch/frv/include/asm/highmem.h
@@ -76,15 +76,16 @@ extern struct page *kmap_atomic_to_page(void *ptr);
76 76
77#ifndef __ASSEMBLY__ 77#ifndef __ASSEMBLY__
78 78
79#define __kmap_atomic_primary(type, paddr, ampr) \ 79#define __kmap_atomic_primary(cached, paddr, ampr) \
80({ \ 80({ \
81 unsigned long damlr, dampr; \ 81 unsigned long damlr, dampr; \
82 \ 82 \
83 dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \ 83 dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \
84 \ 84 \
85 if (type != __KM_CACHE) \ 85 if (!cached) \
86 asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \ 86 asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \
87 else \ 87 else \
88 /* cache flush page attachment point */ \
88 asm volatile("movgs %0,iampr"#ampr"\n" \ 89 asm volatile("movgs %0,iampr"#ampr"\n" \
89 "movgs %0,dampr"#ampr"\n" \ 90 "movgs %0,dampr"#ampr"\n" \
90 :: "r"(dampr) : "memory" \ 91 :: "r"(dampr) : "memory" \
@@ -112,29 +113,20 @@ extern struct page *kmap_atomic_to_page(void *ptr);
112 (void *) damlr; \ 113 (void *) damlr; \
113}) 114})
114 115
115static inline void *kmap_atomic_primary(struct page *page, enum km_type type) 116static inline void *kmap_atomic_primary(struct page *page)
116{ 117{
117 unsigned long paddr; 118 unsigned long paddr;
118 119
119 pagefault_disable(); 120 pagefault_disable();
120 paddr = page_to_phys(page); 121 paddr = page_to_phys(page);
121 122
122 switch (type) { 123 return __kmap_atomic_primary(1, paddr, 2);
123 case 0: return __kmap_atomic_primary(0, paddr, 2);
124 case 1: return __kmap_atomic_primary(1, paddr, 3);
125 case 2: return __kmap_atomic_primary(2, paddr, 4);
126 case 3: return __kmap_atomic_primary(3, paddr, 5);
127
128 default:
129 BUG();
130 return NULL;
131 }
132} 124}
133 125
134#define __kunmap_atomic_primary(type, ampr) \ 126#define __kunmap_atomic_primary(cached, ampr) \
135do { \ 127do { \
136 asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \ 128 asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \
137 if (type == __KM_CACHE) \ 129 if (cached) \
138 asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \ 130 asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \
139} while(0) 131} while(0)
140 132
@@ -143,17 +135,9 @@ do { \
143 asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \ 135 asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \
144} while(0) 136} while(0)
145 137
146static inline void kunmap_atomic_primary(void *kvaddr, enum km_type type) 138static inline void kunmap_atomic_primary(void *kvaddr)
147{ 139{
148 switch (type) { 140 __kunmap_atomic_primary(1, 2);
149 case 0: __kunmap_atomic_primary(0, 2); break;
150 case 1: __kunmap_atomic_primary(1, 3); break;
151 case 2: __kunmap_atomic_primary(2, 4); break;
152 case 3: __kunmap_atomic_primary(3, 5); break;
153
154 default:
155 BUG();
156 }
157 pagefault_enable(); 141 pagefault_enable();
158} 142}
159 143
diff --git a/arch/frv/include/asm/kmap_types.h b/arch/frv/include/asm/kmap_types.h
index f8e16b2a5804..43901f220963 100644
--- a/arch/frv/include/asm/kmap_types.h
+++ b/arch/frv/include/asm/kmap_types.h
@@ -2,28 +2,6 @@
2#ifndef _ASM_KMAP_TYPES_H 2#ifndef _ASM_KMAP_TYPES_H
3#define _ASM_KMAP_TYPES_H 3#define _ASM_KMAP_TYPES_H
4 4
5enum km_type { 5#define KM_TYPE_NR 17
6 /* arch specific kmaps - change the numbers attached to these at your peril */
7 __KM_CACHE, /* cache flush page attachment point */
8 __KM_PGD, /* current page directory */
9 __KM_ITLB_PTD, /* current instruction TLB miss page table lookup */
10 __KM_DTLB_PTD, /* current data TLB miss page table lookup */
11
12 /* general kmaps */
13 KM_BOUNCE_READ,
14 KM_SKB_SUNRPC_DATA,
15 KM_SKB_DATA_SOFTIRQ,
16 KM_USER0,
17 KM_USER1,
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR
27};
28 6
29#endif 7#endif
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c
index 4f8d8bcdc7de..82478979ac9a 100644
--- a/arch/frv/mb93090-mb00/pci-dma.c
+++ b/arch/frv/mb93090-mb00/pci-dma.c
@@ -62,14 +62,14 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
62 dampr2 = __get_DAMPR(2); 62 dampr2 = __get_DAMPR(2);
63 63
64 for (i = 0; i < nents; i++) { 64 for (i = 0; i < nents; i++) {
65 vaddr = kmap_atomic_primary(sg_page(&sg[i]), __KM_CACHE); 65 vaddr = kmap_atomic_primary(sg_page(&sg[i]));
66 66
67 frv_dcache_writeback((unsigned long) vaddr, 67 frv_dcache_writeback((unsigned long) vaddr,
68 (unsigned long) vaddr + PAGE_SIZE); 68 (unsigned long) vaddr + PAGE_SIZE);
69 69
70 } 70 }
71 71
72 kunmap_atomic_primary(vaddr, __KM_CACHE); 72 kunmap_atomic_primary(vaddr);
73 if (dampr2) { 73 if (dampr2) {
74 __set_DAMPR(2, dampr2); 74 __set_DAMPR(2, dampr2);
75 __set_IAMPR(2, dampr2); 75 __set_IAMPR(2, dampr2);
diff --git a/arch/frv/mm/cache-page.c b/arch/frv/mm/cache-page.c
index b24ade27a0f0..8e09dae0ec3f 100644
--- a/arch/frv/mm/cache-page.c
+++ b/arch/frv/mm/cache-page.c
@@ -26,11 +26,11 @@ void flush_dcache_page(struct page *page)
26 26
27 dampr2 = __get_DAMPR(2); 27 dampr2 = __get_DAMPR(2);
28 28
29 vaddr = kmap_atomic_primary(page, __KM_CACHE); 29 vaddr = kmap_atomic_primary(page);
30 30
31 frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); 31 frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE);
32 32
33 kunmap_atomic_primary(vaddr, __KM_CACHE); 33 kunmap_atomic_primary(vaddr);
34 34
35 if (dampr2) { 35 if (dampr2) {
36 __set_DAMPR(2, dampr2); 36 __set_DAMPR(2, dampr2);
@@ -54,12 +54,12 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
54 54
55 dampr2 = __get_DAMPR(2); 55 dampr2 = __get_DAMPR(2);
56 56
57 vaddr = kmap_atomic_primary(page, __KM_CACHE); 57 vaddr = kmap_atomic_primary(page);
58 58
59 start = (start & ~PAGE_MASK) | (unsigned long) vaddr; 59 start = (start & ~PAGE_MASK) | (unsigned long) vaddr;
60 frv_cache_wback_inv(start, start + len); 60 frv_cache_wback_inv(start, start + len);
61 61
62 kunmap_atomic_primary(vaddr, __KM_CACHE); 62 kunmap_atomic_primary(vaddr);
63 63
64 if (dampr2) { 64 if (dampr2) {
65 __set_DAMPR(2, dampr2); 65 __set_DAMPR(2, dampr2);
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c
index 31902c9d5be5..bed9a9bd3c10 100644
--- a/arch/frv/mm/highmem.c
+++ b/arch/frv/mm/highmem.c
@@ -50,11 +50,11 @@ void *kmap_atomic(struct page *page)
50 /* 50 /*
51 * The first 4 primary maps are reserved for architecture code 51 * The first 4 primary maps are reserved for architecture code
52 */ 52 */
53 case 0: return __kmap_atomic_primary(4, paddr, 6); 53 case 0: return __kmap_atomic_primary(0, paddr, 6);
54 case 1: return __kmap_atomic_primary(5, paddr, 7); 54 case 1: return __kmap_atomic_primary(0, paddr, 7);
55 case 2: return __kmap_atomic_primary(6, paddr, 8); 55 case 2: return __kmap_atomic_primary(0, paddr, 8);
56 case 3: return __kmap_atomic_primary(7, paddr, 9); 56 case 3: return __kmap_atomic_primary(0, paddr, 9);
57 case 4: return __kmap_atomic_primary(8, paddr, 10); 57 case 4: return __kmap_atomic_primary(0, paddr, 10);
58 58
59 case 5 ... 5 + NR_TLB_LINES - 1: 59 case 5 ... 5 + NR_TLB_LINES - 1:
60 return __kmap_atomic_secondary(type - 5, paddr); 60 return __kmap_atomic_secondary(type - 5, paddr);
@@ -70,11 +70,11 @@ void __kunmap_atomic(void *kvaddr)
70{ 70{
71 int type = kmap_atomic_idx(); 71 int type = kmap_atomic_idx();
72 switch (type) { 72 switch (type) {
73 case 0: __kunmap_atomic_primary(4, 6); break; 73 case 0: __kunmap_atomic_primary(0, 6); break;
74 case 1: __kunmap_atomic_primary(5, 7); break; 74 case 1: __kunmap_atomic_primary(0, 7); break;
75 case 2: __kunmap_atomic_primary(6, 8); break; 75 case 2: __kunmap_atomic_primary(0, 8); break;
76 case 3: __kunmap_atomic_primary(7, 9); break; 76 case 3: __kunmap_atomic_primary(0, 9); break;
77 case 4: __kunmap_atomic_primary(8, 10); break; 77 case 4: __kunmap_atomic_primary(0, 10); break;
78 78
79 case 5 ... 5 + NR_TLB_LINES - 1: 79 case 5 ... 5 + NR_TLB_LINES - 1:
80 __kunmap_atomic_secondary(type - 5, kvaddr); 80 __kunmap_atomic_secondary(type - 5, kvaddr);
diff --git a/arch/powerpc/include/asm/kmap_types.h b/arch/powerpc/include/asm/kmap_types.h
index bca8fdcd2542..5acabbd7ac6f 100644
--- a/arch/powerpc/include/asm/kmap_types.h
+++ b/arch/powerpc/include/asm/kmap_types.h
@@ -10,36 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 */ 11 */
12 12
13enum km_type { 13#define KM_TYPE_NR 16
14 KM_BOUNCE_READ,
15 KM_SKB_SUNRPC_DATA,
16 KM_SKB_DATA_SOFTIRQ,
17 KM_USER0,
18 KM_USER1,
19 KM_BIO_SRC_IRQ,
20 KM_BIO_DST_IRQ,
21 KM_PTE0,
22 KM_PTE1,
23 KM_IRQ0,
24 KM_IRQ1,
25 KM_SOFTIRQ0,
26 KM_SOFTIRQ1,
27 KM_PPC_SYNC_PAGE,
28 KM_PPC_SYNC_ICACHE,
29 KM_KDB,
30 KM_TYPE_NR
31};
32
33/*
34 * This is a temporary build fix that (so they say on lkml....) should no longer
35 * be required after 2.6.33, because of changes planned to the kmap code.
36 * Let's try to remove this cruft then.
37 */
38#ifdef CONFIG_DEBUG_HIGHMEM
39#define KM_NMI (-1)
40#define KM_NMI_PTE (-1)
41#define KM_IRQ_PTE (-1)
42#endif
43 14
44#endif /* __KERNEL__ */ 15#endif /* __KERNEL__ */
45#endif /* _ASM_POWERPC_KMAP_TYPES_H */ 16#endif /* _ASM_POWERPC_KMAP_TYPES_H */
diff --git a/arch/tile/include/asm/kmap_types.h b/arch/tile/include/asm/kmap_types.h
index 3d0f20246260..92b28e3e9972 100644
--- a/arch/tile/include/asm/kmap_types.h
+++ b/arch/tile/include/asm/kmap_types.h
@@ -23,35 +23,6 @@
23 * adds 4MB of required address-space. For now we leave KM_TYPE_NR 23 * adds 4MB of required address-space. For now we leave KM_TYPE_NR
24 * set to depth 8. 24 * set to depth 8.
25 */ 25 */
26enum km_type { 26#define KM_TYPE_NR 8
27 KM_TYPE_NR = 8
28};
29
30/*
31 * We provide dummy definitions of all the stray values that used to be
32 * required for kmap_atomic() and no longer are.
33 */
34enum {
35 KM_BOUNCE_READ,
36 KM_SKB_SUNRPC_DATA,
37 KM_SKB_DATA_SOFTIRQ,
38 KM_USER0,
39 KM_USER1,
40 KM_BIO_SRC_IRQ,
41 KM_BIO_DST_IRQ,
42 KM_PTE0,
43 KM_PTE1,
44 KM_IRQ0,
45 KM_IRQ1,
46 KM_SOFTIRQ0,
47 KM_SOFTIRQ1,
48 KM_SYNC_ICACHE,
49 KM_SYNC_DCACHE,
50 KM_UML_USERCOPY,
51 KM_IRQ_PTE,
52 KM_NMI,
53 KM_NMI_PTE,
54 KM_KDB
55};
56 27
57#endif /* _ASM_TILE_KMAP_TYPES_H */ 28#endif /* _ASM_TILE_KMAP_TYPES_H */
diff --git a/arch/tile/mm/highmem.c b/arch/tile/mm/highmem.c
index ef8e5a62b6e3..347d123b14be 100644
--- a/arch/tile/mm/highmem.c
+++ b/arch/tile/mm/highmem.c
@@ -93,7 +93,7 @@ static DEFINE_PER_CPU(struct kmap_amps, amps);
93 * If we examine it earlier we are exposed to a race where it looks 93 * If we examine it earlier we are exposed to a race where it looks
94 * writable earlier, but becomes immutable before we write the PTE. 94 * writable earlier, but becomes immutable before we write the PTE.
95 */ 95 */
96static void kmap_atomic_register(struct page *page, enum km_type type, 96static void kmap_atomic_register(struct page *page, int type,
97 unsigned long va, pte_t *ptep, pte_t pteval) 97 unsigned long va, pte_t *ptep, pte_t pteval)
98{ 98{
99 unsigned long flags; 99 unsigned long flags;
diff --git a/arch/um/include/asm/kmap_types.h b/arch/um/include/asm/kmap_types.h
index 6c03acdb4405..2e0a6b1d8300 100644
--- a/arch/um/include/asm/kmap_types.h
+++ b/arch/um/include/asm/kmap_types.h
@@ -8,22 +8,6 @@
8 8
9/* No more #include "asm/arch/kmap_types.h" ! */ 9/* No more #include "asm/arch/kmap_types.h" ! */
10 10
11enum km_type { 11#define KM_TYPE_NR 14
12 KM_BOUNCE_READ,
13 KM_SKB_SUNRPC_DATA,
14 KM_SKB_DATA_SOFTIRQ,
15 KM_USER0,
16 KM_USER1,
17 KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR
27};
28 12
29#endif 13#endif