aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2014-01-23 18:53:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:54 -0500
commit083f7ba834c09ed9b3904bf2168c378c5550c970 (patch)
treef0a2ff124ff689f56954add4d2697e5b75f68163 /arch/sh/include
parent9494a1e8428ea8e60ae77b221b9d32a5edc21ef4 (diff)
sh: use generic fixmap.h
Signed-off-by: Mark Salter <msalter@redhat.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/sh/include')
-rw-r--r--arch/sh/include/asm/fixmap.h39
1 files changed, 2 insertions, 37 deletions
diff --git a/arch/sh/include/asm/fixmap.h b/arch/sh/include/asm/fixmap.h
index cbe0186b6794..4daf91c3b725 100644
--- a/arch/sh/include/asm/fixmap.h
+++ b/arch/sh/include/asm/fixmap.h
@@ -79,13 +79,6 @@ extern void __set_fixmap(enum fixed_addresses idx,
79 unsigned long phys, pgprot_t flags); 79 unsigned long phys, pgprot_t flags);
80extern void __clear_fixmap(enum fixed_addresses idx, pgprot_t flags); 80extern void __clear_fixmap(enum fixed_addresses idx, pgprot_t flags);
81 81
82#define set_fixmap(idx, phys) \
83 __set_fixmap(idx, phys, PAGE_KERNEL)
84/*
85 * Some hardware wants to get fixmapped without caching.
86 */
87#define set_fixmap_nocache(idx, phys) \
88 __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
89/* 82/*
90 * used by vmalloc.c. 83 * used by vmalloc.c.
91 * 84 *
@@ -101,36 +94,8 @@ extern void __clear_fixmap(enum fixed_addresses idx, pgprot_t flags);
101#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 94#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
102#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 95#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
103 96
104#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 97#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE
105#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
106
107extern void __this_fixmap_does_not_exist(void);
108
109/*
110 * 'index to address' translation. If anyone tries to use the idx
111 * directly without tranlation, we catch the bug with a NULL-deference
112 * kernel oops. Illegal ranges of incoming indices are caught too.
113 */
114static inline unsigned long fix_to_virt(const unsigned int idx)
115{
116 /*
117 * this branch gets completely eliminated after inlining,
118 * except when someone tries to use fixaddr indices in an
119 * illegal way. (such as mixing up address types or using
120 * out-of-range indices).
121 *
122 * If it doesn't get removed, the linker will complain
123 * loudly with a reasonably clear error message..
124 */
125 if (idx >= __end_of_fixed_addresses)
126 __this_fixmap_does_not_exist();
127 98
128 return __fix_to_virt(idx); 99#include <asm-generic/fixmap.h>
129}
130 100
131static inline unsigned long virt_to_fix(const unsigned long vaddr)
132{
133 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
134 return __virt_to_fix(vaddr);
135}
136#endif 101#endif