aboutsummaryrefslogtreecommitdiffstats
path: root/arch/metag
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2014-01-23 18:53:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:54 -0500
commit1c5c8043f5f4402105e87caec228373bf76d7793 (patch)
tree4078cc2f4808d08b938a9189240d443b13216f24 /arch/metag
parent978c5584015e9a843f96586a725141a80ff2109d (diff)
metag: use generic fixmap.h
Signed-off-by: Mark Salter <msalter@redhat.com> Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/metag')
-rw-r--r--arch/metag/include/asm/fixmap.h32
1 files changed, 1 insertions, 31 deletions
diff --git a/arch/metag/include/asm/fixmap.h b/arch/metag/include/asm/fixmap.h
index 33312751c92b..af621b041739 100644
--- a/arch/metag/include/asm/fixmap.h
+++ b/arch/metag/include/asm/fixmap.h
@@ -51,37 +51,7 @@ enum fixed_addresses {
51#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 51#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
52#define FIXADDR_START ((FIXADDR_TOP - FIXADDR_SIZE) & PMD_MASK) 52#define FIXADDR_START ((FIXADDR_TOP - FIXADDR_SIZE) & PMD_MASK)
53 53
54#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 54#include <asm-generic/fixmap.h>
55#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
56
57extern void __this_fixmap_does_not_exist(void);
58/*
59 * 'index to address' translation. If anyone tries to use the idx
60 * directly without tranlation, we catch the bug with a NULL-deference
61 * kernel oops. Illegal ranges of incoming indices are caught too.
62 */
63static inline unsigned long fix_to_virt(const unsigned int idx)
64{
65 /*
66 * this branch gets completely eliminated after inlining,
67 * except when someone tries to use fixaddr indices in an
68 * illegal way. (such as mixing up address types or using
69 * out-of-range indices).
70 *
71 * If it doesn't get removed, the linker will complain
72 * loudly with a reasonably clear error message..
73 */
74 if (idx >= __end_of_fixed_addresses)
75 __this_fixmap_does_not_exist();
76
77 return __fix_to_virt(idx);
78}
79
80static inline unsigned long virt_to_fix(const unsigned long vaddr)
81{
82 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
83 return __virt_to_fix(vaddr);
84}
85 55
86#define kmap_get_fixmap_pte(vaddr) \ 56#define kmap_get_fixmap_pte(vaddr) \
87 pte_offset_kernel( \ 57 pte_offset_kernel( \