diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-07-04 06:22:27 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-26 15:07:41 -0500 |
commit | 0d31fe47b0f62e6546779eae2fc9b2e024aff4ce (patch) | |
tree | 6e1a619868e7e8bde6180d73c75ea7ab6f131e9b /arch/arm/mm/highmem.c | |
parent | 67ece1443174d852e71c42facb3e2d7dd338c88a (diff) |
ARM: pgtable: provide get_top_pte() to complement set_top_pte()
Provide get_top_pte() to complement set_top_pte(), moving the only
users of TOP_PTE to arch/arm/mm/mm.h.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/highmem.c')
-rw-r--r-- | arch/arm/mm/highmem.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c index 35352517a5d4..3a9e8aa19759 100644 --- a/arch/arm/mm/highmem.c +++ b/arch/arm/mm/highmem.c | |||
@@ -69,7 +69,7 @@ void *__kmap_atomic(struct page *page) | |||
69 | * With debugging enabled, kunmap_atomic forces that entry to 0. | 69 | * With debugging enabled, kunmap_atomic forces that entry to 0. |
70 | * Make sure it was indeed properly unmapped. | 70 | * Make sure it was indeed properly unmapped. |
71 | */ | 71 | */ |
72 | BUG_ON(!pte_none(*(TOP_PTE(vaddr)))); | 72 | BUG_ON(!pte_none(get_top_pte(vaddr))); |
73 | #endif | 73 | #endif |
74 | /* | 74 | /* |
75 | * When debugging is off, kunmap_atomic leaves the previous mapping | 75 | * When debugging is off, kunmap_atomic leaves the previous mapping |
@@ -119,7 +119,7 @@ void *kmap_atomic_pfn(unsigned long pfn) | |||
119 | idx = type + KM_TYPE_NR * smp_processor_id(); | 119 | idx = type + KM_TYPE_NR * smp_processor_id(); |
120 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 120 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
121 | #ifdef CONFIG_DEBUG_HIGHMEM | 121 | #ifdef CONFIG_DEBUG_HIGHMEM |
122 | BUG_ON(!pte_none(*(TOP_PTE(vaddr)))); | 122 | BUG_ON(!pte_none(get_top_pte(vaddr))); |
123 | #endif | 123 | #endif |
124 | set_top_pte(vaddr, pfn_pte(pfn, kmap_prot)); | 124 | set_top_pte(vaddr, pfn_pte(pfn, kmap_prot)); |
125 | 125 | ||
@@ -129,11 +129,9 @@ void *kmap_atomic_pfn(unsigned long pfn) | |||
129 | struct page *kmap_atomic_to_page(const void *ptr) | 129 | struct page *kmap_atomic_to_page(const void *ptr) |
130 | { | 130 | { |
131 | unsigned long vaddr = (unsigned long)ptr; | 131 | unsigned long vaddr = (unsigned long)ptr; |
132 | pte_t *pte; | ||
133 | 132 | ||
134 | if (vaddr < FIXADDR_START) | 133 | if (vaddr < FIXADDR_START) |
135 | return virt_to_page(ptr); | 134 | return virt_to_page(ptr); |
136 | 135 | ||
137 | pte = TOP_PTE(vaddr); | 136 | return pte_page(get_top_pte(vaddr)); |
138 | return pte_page(*pte); | ||
139 | } | 137 | } |