aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include
diff options
context:
space:
mode:
authorMark Salter <msalter@redhat.com>2014-01-23 18:53:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:54 -0500
commita6ce7114eed4f2f56edcd02fc6dad019ba2c04fc (patch)
tree01b4f31b20dd2c9440f4ee5454cef5b363ca0c8f /arch/um/include
parent8b49233fd7a733fddd9050c0f67f3c8b9056cc34 (diff)
um: use generic fixmap.h
Signed-off-by: Mark Salter <msalter@redhat.com> Acked-by: Richard Weinberger <richard@nod.at> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/include')
-rw-r--r--arch/um/include/asm/fixmap.h40
1 files changed, 1 insertions, 39 deletions
diff --git a/arch/um/include/asm/fixmap.h b/arch/um/include/asm/fixmap.h
index 21a423bae5e8..3094ea3c73b0 100644
--- a/arch/um/include/asm/fixmap.h
+++ b/arch/um/include/asm/fixmap.h
@@ -43,13 +43,6 @@ enum fixed_addresses {
43extern void __set_fixmap (enum fixed_addresses idx, 43extern void __set_fixmap (enum fixed_addresses idx,
44 unsigned long phys, pgprot_t flags); 44 unsigned long phys, pgprot_t flags);
45 45
46#define set_fixmap(idx, phys) \
47 __set_fixmap(idx, phys, PAGE_KERNEL)
48/*
49 * Some hardware wants to get fixmapped without caching.
50 */
51#define set_fixmap_nocache(idx, phys) \
52 __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
53/* 46/*
54 * used by vmalloc.c. 47 * used by vmalloc.c.
55 * 48 *
@@ -62,37 +55,6 @@ extern void __set_fixmap (enum fixed_addresses idx,
62#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 55#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
63#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 56#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
64 57
65#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) 58#include <asm-generic/fixmap.h>
66#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
67
68extern void __this_fixmap_does_not_exist(void);
69
70/*
71 * 'index to address' translation. If anyone tries to use the idx
72 * directly without tranlation, we catch the bug with a NULL-deference
73 * kernel oops. Illegal ranges of incoming indices are caught too.
74 */
75static inline unsigned long fix_to_virt(const unsigned int idx)
76{
77 /*
78 * this branch gets completely eliminated after inlining,
79 * except when someone tries to use fixaddr indices in an
80 * illegal way. (such as mixing up address types or using
81 * out-of-range indices).
82 *
83 * If it doesn't get removed, the linker will complain
84 * loudly with a reasonably clear error message..
85 */
86 if (idx >= __end_of_fixed_addresses)
87 __this_fixmap_does_not_exist();
88
89 return __fix_to_virt(idx);
90}
91
92static inline unsigned long virt_to_fix(const unsigned long vaddr)
93{
94 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
95 return __virt_to_fix(vaddr);
96}
97 59
98#endif 60#endif