xref: /linux/arch/arm/include/asm/fixmap.h (revision 3932b9ca55b0be314a36d3e84faff3e823c081f5)
1 #ifndef _ASM_FIXMAP_H
2 #define _ASM_FIXMAP_H
3 
4 #define FIXADDR_START		0xffc00000UL
5 #define FIXADDR_TOP		0xffe00000UL
6 #define FIXADDR_SIZE		(FIXADDR_TOP - FIXADDR_START)
7 
8 #define FIX_KMAP_NR_PTES	(FIXADDR_SIZE >> PAGE_SHIFT)
9 
10 #define __fix_to_virt(x)	(FIXADDR_START + ((x) << PAGE_SHIFT))
11 #define __virt_to_fix(x)	(((x) - FIXADDR_START) >> PAGE_SHIFT)
12 
13 extern void __this_fixmap_does_not_exist(void);
14 
15 static inline unsigned long fix_to_virt(const unsigned int idx)
16 {
17 	if (idx >= FIX_KMAP_NR_PTES)
18 		__this_fixmap_does_not_exist();
19 	return __fix_to_virt(idx);
20 }
21 
22 static inline unsigned int virt_to_fix(const unsigned long vaddr)
23 {
24 	BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
25 	return __virt_to_fix(vaddr);
26 }
27 
28 #endif
29