aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2014-01-23 18:53:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:54 -0500
commit142885379a8d296e89b9a89c95e40af7068b4bb3 (patch)
tree5a97243350fa295decd294aedf6683ac382da8a4 /arch/microblaze
parent1c5c8043f5f4402105e87caec228373bf76d7793 (diff)
microblaze: use generic fixmap.h
Signed-off-by: Mark Salter <msalter@redhat.com> Tested-by: Michal Simek <monstr@monstr.eu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/microblaze')
-rw-r--r--arch/microblaze/include/asm/fixmap.h44
1 files changed, 2 insertions, 42 deletions
diff --git a/arch/microblaze/include/asm/fixmap.h b/arch/microblaze/include/asm/fixmap.h
index f2b312e10b10..06c0e2b1883f 100644
--- a/arch/microblaze/include/asm/fixmap.h
+++ b/arch/microblaze/include/asm/fixmap.h
@@ -58,52 +58,12 @@ enum fixed_addresses {
58extern void __set_fixmap(enum fixed_addresses idx, 58extern void __set_fixmap(enum fixed_addresses idx,
59 phys_addr_t phys, pgprot_t flags); 59 phys_addr_t phys, pgprot_t flags);
60 60
61#define set_fixmap(idx, phys) \
62 __set_fixmap(idx, phys, PAGE_KERNEL)
63/*
64 * Some hardware wants to get fixmapped without caching.
65 */
66#define set_fixmap_nocache(idx, phys) \
67 __set_fixmap(idx, phys, PAGE_KERNEL_CI)
68
69#define clear_fixmap(idx) \
70 __set_fixmap(idx, 0, __pgprot(0))
71
72#define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 61#define __FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
73#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE) 62#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
74 63
75#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 64#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_CI
76#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
77
78extern void __this_fixmap_does_not_exist(void);
79
80/*
81 * 'index to address' translation. If anyone tries to use the idx
82 * directly without tranlation, we catch the bug with a NULL-deference
83 * kernel oops. Illegal ranges of incoming indices are caught too.
84 */
85static __always_inline unsigned long fix_to_virt(const unsigned int idx)
86{
87 /*
88 * this branch gets completely eliminated after inlining,
89 * except when someone tries to use fixaddr indices in an
90 * illegal way. (such as mixing up address types or using
91 * out-of-range indices).
92 *
93 * If it doesn't get removed, the linker will complain
94 * loudly with a reasonably clear error message..
95 */
96 if (idx >= __end_of_fixed_addresses)
97 __this_fixmap_does_not_exist();
98
99 return __fix_to_virt(idx);
100}
101 65
102static inline unsigned long virt_to_fix(const unsigned long vaddr) 66#include <asm-generic/fixmap.h>
103{
104 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
105 return __virt_to_fix(vaddr);
106}
107 67
108#endif /* !__ASSEMBLY__ */ 68#endif /* !__ASSEMBLY__ */
109#endif 69#endif