diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/highmem.h | 4 | ||||
-rw-r--r-- | arch/sparc/mm/highmem.c | 48 |
2 files changed, 29 insertions, 23 deletions
diff --git a/arch/sparc/include/asm/highmem.h b/arch/sparc/include/asm/highmem.h index ec23b0a87b98..3d7afbb7f4bb 100644 --- a/arch/sparc/include/asm/highmem.h +++ b/arch/sparc/include/asm/highmem.h | |||
@@ -70,8 +70,8 @@ static inline void kunmap(struct page *page) | |||
70 | kunmap_high(page); | 70 | kunmap_high(page); |
71 | } | 71 | } |
72 | 72 | ||
73 | extern void *kmap_atomic(struct page *page, enum km_type type); | 73 | extern void *__kmap_atomic(struct page *page); |
74 | extern void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type); | 74 | extern void __kunmap_atomic(void *kvaddr); |
75 | extern struct page *kmap_atomic_to_page(void *vaddr); | 75 | extern struct page *kmap_atomic_to_page(void *vaddr); |
76 | 76 | ||
77 | #define flush_cache_kmaps() flush_cache_all() | 77 | #define flush_cache_kmaps() flush_cache_all() |
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c index e139e9cbf5f7..5e50c09b7dce 100644 --- a/arch/sparc/mm/highmem.c +++ b/arch/sparc/mm/highmem.c | |||
@@ -29,17 +29,17 @@ | |||
29 | #include <asm/tlbflush.h> | 29 | #include <asm/tlbflush.h> |
30 | #include <asm/fixmap.h> | 30 | #include <asm/fixmap.h> |
31 | 31 | ||
32 | void *kmap_atomic(struct page *page, enum km_type type) | 32 | void *__kmap_atomic(struct page *page) |
33 | { | 33 | { |
34 | unsigned long idx; | ||
35 | unsigned long vaddr; | 34 | unsigned long vaddr; |
35 | long idx, type; | ||
36 | 36 | ||
37 | /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ | 37 | /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ |
38 | pagefault_disable(); | 38 | pagefault_disable(); |
39 | if (!PageHighMem(page)) | 39 | if (!PageHighMem(page)) |
40 | return page_address(page); | 40 | return page_address(page); |
41 | 41 | ||
42 | debug_kmap_atomic(type); | 42 | type = kmap_atomic_idx_push(); |
43 | idx = type + KM_TYPE_NR*smp_processor_id(); | 43 | idx = type + KM_TYPE_NR*smp_processor_id(); |
44 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 44 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
45 | 45 | ||
@@ -63,44 +63,50 @@ void *kmap_atomic(struct page *page, enum km_type type) | |||
63 | 63 | ||
64 | return (void*) vaddr; | 64 | return (void*) vaddr; |
65 | } | 65 | } |
66 | EXPORT_SYMBOL(kmap_atomic); | 66 | EXPORT_SYMBOL(__kmap_atomic); |
67 | 67 | ||
68 | void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type) | 68 | void __kunmap_atomic(void *kvaddr) |
69 | { | 69 | { |
70 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
71 | unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; | 70 | unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; |
72 | unsigned long idx = type + KM_TYPE_NR*smp_processor_id(); | 71 | int type; |
73 | 72 | ||
74 | if (vaddr < FIXADDR_START) { // FIXME | 73 | if (vaddr < FIXADDR_START) { // FIXME |
75 | pagefault_enable(); | 74 | pagefault_enable(); |
76 | return; | 75 | return; |
77 | } | 76 | } |
78 | 77 | ||
79 | BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx)); | 78 | type = kmap_atomic_idx_pop(); |
80 | 79 | ||
81 | /* XXX Fix - Anton */ | 80 | #ifdef CONFIG_DEBUG_HIGHMEM |
81 | { | ||
82 | unsigned long idx; | ||
83 | |||
84 | idx = type + KM_TYPE_NR * smp_processor_id(); | ||
85 | BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx)); | ||
86 | |||
87 | /* XXX Fix - Anton */ | ||
82 | #if 0 | 88 | #if 0 |
83 | __flush_cache_one(vaddr); | 89 | __flush_cache_one(vaddr); |
84 | #else | 90 | #else |
85 | flush_cache_all(); | 91 | flush_cache_all(); |
86 | #endif | 92 | #endif |
87 | 93 | ||
88 | /* | 94 | /* |
89 | * force other mappings to Oops if they'll try to access | 95 | * force other mappings to Oops if they'll try to access |
90 | * this pte without first remap it | 96 | * this pte without first remap it |
91 | */ | 97 | */ |
92 | pte_clear(&init_mm, vaddr, kmap_pte-idx); | 98 | pte_clear(&init_mm, vaddr, kmap_pte-idx); |
93 | /* XXX Fix - Anton */ | 99 | /* XXX Fix - Anton */ |
94 | #if 0 | 100 | #if 0 |
95 | __flush_tlb_one(vaddr); | 101 | __flush_tlb_one(vaddr); |
96 | #else | 102 | #else |
97 | flush_tlb_all(); | 103 | flush_tlb_all(); |
98 | #endif | 104 | #endif |
105 | } | ||
99 | #endif | 106 | #endif |
100 | |||
101 | pagefault_enable(); | 107 | pagefault_enable(); |
102 | } | 108 | } |
103 | EXPORT_SYMBOL(kunmap_atomic_notypecheck); | 109 | EXPORT_SYMBOL(__kunmap_atomic); |
104 | 110 | ||
105 | /* We may be fed a pagetable here by ptep_to_xxx and others. */ | 111 | /* We may be fed a pagetable here by ptep_to_xxx and others. */ |
106 | struct page *kmap_atomic_to_page(void *ptr) | 112 | struct page *kmap_atomic_to_page(void *ptr) |