aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/fixmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/tile/include/asm/fixmap.h')
-rw-r--r--arch/tile/include/asm/fixmap.h33
1 files changed, 1 insertions, 32 deletions
diff --git a/arch/tile/include/asm/fixmap.h b/arch/tile/include/asm/fixmap.h
index c6b9c1b38fd1..ffe2637aeb31 100644
--- a/arch/tile/include/asm/fixmap.h
+++ b/arch/tile/include/asm/fixmap.h
@@ -25,9 +25,6 @@
25#include <asm/kmap_types.h> 25#include <asm/kmap_types.h>
26#endif 26#endif
27 27
28#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
29#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
30
31/* 28/*
32 * Here we define all the compile-time 'special' virtual 29 * Here we define all the compile-time 'special' virtual
33 * addresses. The point is to have a constant address at 30 * addresses. The point is to have a constant address at
@@ -83,35 +80,7 @@ enum fixed_addresses {
83#define FIXADDR_START (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_SIZE) 80#define FIXADDR_START (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_SIZE)
84#define FIXADDR_BOOT_START (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_BOOT_SIZE) 81#define FIXADDR_BOOT_START (FIXADDR_TOP + PAGE_SIZE - __FIXADDR_BOOT_SIZE)
85 82
86extern void __this_fixmap_does_not_exist(void); 83#include <asm-generic/fixmap.h>
87
88/*
89 * 'index to address' translation. If anyone tries to use the idx
90 * directly without tranlation, we catch the bug with a NULL-deference
91 * kernel oops. Illegal ranges of incoming indices are caught too.
92 */
93static __always_inline unsigned long fix_to_virt(const unsigned int idx)
94{
95 /*
96 * this branch gets completely eliminated after inlining,
97 * except when someone tries to use fixaddr indices in an
98 * illegal way. (such as mixing up address types or using
99 * out-of-range indices).
100 *
101 * If it doesn't get removed, the linker will complain
102 * loudly with a reasonably clear error message..
103 */
104 if (idx >= __end_of_fixed_addresses)
105 __this_fixmap_does_not_exist();
106
107 return __fix_to_virt(idx);
108}
109
110static inline unsigned long virt_to_fix(const unsigned long vaddr)
111{
112 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
113 return __virt_to_fix(vaddr);
114}
115 84
116#endif /* !__ASSEMBLY__ */ 85#endif /* !__ASSEMBLY__ */
117 86