diff options
| author | Mark Salter <msalter@redhat.com> | 2014-01-23 18:53:51 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-23 19:36:54 -0500 |
| commit | 978c5584015e9a843f96586a725141a80ff2109d (patch) | |
| tree | 0eaf3493f3f7ec07e112b2111dd0e2c1347f9758 /arch/hexagon/include/asm | |
| parent | 114cefc87ec445207f6968f584ea5edcb474f541 (diff) | |
hexagon: use generic fixmap.h
Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Richard Kuo <rkuo@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/hexagon/include/asm')
| -rw-r--r-- | arch/hexagon/include/asm/fixmap.h | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/arch/hexagon/include/asm/fixmap.h b/arch/hexagon/include/asm/fixmap.h index b75b6bf4269c..1387f84b42b6 100644 --- a/arch/hexagon/include/asm/fixmap.h +++ b/arch/hexagon/include/asm/fixmap.h | |||
| @@ -26,45 +26,7 @@ | |||
| 26 | */ | 26 | */ |
| 27 | #include <asm/mem-layout.h> | 27 | #include <asm/mem-layout.h> |
| 28 | 28 | ||
| 29 | /* | 29 | #include <asm-generic/fixmap.h> |
| 30 | * Full fixmap support involves set_fixmap() functions, but | ||
| 31 | * these may not be needed if all we're after is an area for | ||
| 32 | * highmem kernel mappings. | ||
| 33 | */ | ||
| 34 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) | ||
| 35 | #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) | ||
| 36 | |||
| 37 | extern void __this_fixmap_does_not_exist(void); | ||
| 38 | |||
| 39 | /** | ||
| 40 | * fix_to_virt -- "index to address" translation. | ||
| 41 | * | ||
| 42 | * If anyone tries to use the idx directly without translation, | ||
| 43 | * we catch the bug with a NULL-deference kernel oops. Illegal | ||
| 44 | * ranges of incoming indices are caught too. | ||
| 45 | */ | ||
| 46 | static inline unsigned long fix_to_virt(const unsigned int idx) | ||
| 47 | { | ||
| 48 | /* | ||
| 49 | * This branch gets completely eliminated after inlining, | ||
| 50 | * except when someone tries to use fixaddr indices in an | ||
| 51 | * illegal way. (such as mixing up address types or using | ||
| 52 | * out-of-range indices). | ||
| 53 | * | ||
| 54 | * If it doesn't get removed, the linker will complain | ||
| 55 | * loudly with a reasonably clear error message.. | ||
| 56 | */ | ||
| 57 | if (idx >= __end_of_fixed_addresses) | ||
| 58 | __this_fixmap_does_not_exist(); | ||
| 59 | |||
| 60 | return __fix_to_virt(idx); | ||
| 61 | } | ||
| 62 | |||
| 63 | static inline unsigned long virt_to_fix(const unsigned long vaddr) | ||
| 64 | { | ||
| 65 | BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); | ||
| 66 | return __virt_to_fix(vaddr); | ||
| 67 | } | ||
| 68 | 30 | ||
| 69 | #define kmap_get_fixmap_pte(vaddr) \ | 31 | #define kmap_get_fixmap_pte(vaddr) \ |
| 70 | pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), \ | 32 | pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), \ |
