Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 1 | #ifndef _ASM_HIGHMEM_H |
| 2 | #define _ASM_HIGHMEM_H |
| 3 | |
| 4 | #include <asm/kmap_types.h> |
| 5 | |
| 6 | #define PKMAP_BASE (PAGE_OFFSET - PMD_SIZE) |
| 7 | #define LAST_PKMAP PTRS_PER_PTE |
| 8 | #define LAST_PKMAP_MASK (LAST_PKMAP - 1) |
| 9 | #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT) |
| 10 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) |
| 11 | |
| 12 | #define kmap_prot PAGE_KERNEL |
| 13 | |
Nicolas Pitre | 7e5a69e | 2010-03-29 21:46:02 +0100 | [diff] [blame] | 14 | #define flush_cache_kmaps() \ |
| 15 | do { \ |
| 16 | if (cache_is_vivt()) \ |
| 17 | flush_cache_all(); \ |
| 18 | } while (0) |
Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 19 | |
| 20 | extern pte_t *pkmap_page_table; |
| 21 | |
Nicolas Pitre | 4337745 | 2009-03-12 22:52:09 -0400 | [diff] [blame] | 22 | #define ARCH_NEEDS_KMAP_HIGH_GET |
| 23 | |
Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 24 | extern void *kmap_high(struct page *page); |
Nicolas Pitre | 4337745 | 2009-03-12 22:52:09 -0400 | [diff] [blame] | 25 | extern void *kmap_high_get(struct page *page); |
Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 26 | extern void kunmap_high(struct page *page); |
| 27 | |
Nicolas Pitre | 7e5a69e | 2010-03-29 21:46:02 +0100 | [diff] [blame] | 28 | extern void *kmap_high_l1_vipt(struct page *page, pte_t *saved_pte); |
| 29 | extern void kunmap_high_l1_vipt(struct page *page, pte_t saved_pte); |
| 30 | |
| 31 | /* |
| 32 | * The following functions are already defined by <linux/highmem.h> |
| 33 | * when CONFIG_HIGHMEM is not set. |
| 34 | */ |
| 35 | #ifdef CONFIG_HIGHMEM |
Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 36 | extern void *kmap(struct page *page); |
| 37 | extern void kunmap(struct page *page); |
| 38 | extern void *kmap_atomic(struct page *page, enum km_type type); |
Cesar Eduardo Barros | 597781f | 2010-08-09 17:18:32 -0700 | [diff] [blame] | 39 | extern void kunmap_atomic_notypecheck(void *kvaddr, enum km_type type); |
Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 40 | extern void *kmap_atomic_pfn(unsigned long pfn, enum km_type type); |
| 41 | extern struct page *kmap_atomic_to_page(const void *ptr); |
Nicolas Pitre | 7e5a69e | 2010-03-29 21:46:02 +0100 | [diff] [blame] | 42 | #endif |
Nicolas Pitre | d73cd42 | 2008-09-15 16:44:55 -0400 | [diff] [blame] | 43 | |
| 44 | #endif |