| .. | .. |
|---|
| 13 | 13 | #define _XTENSA_HIGHMEM_H |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | #include <linux/wait.h> |
|---|
| 16 | +#include <linux/pgtable.h> |
|---|
| 16 | 17 | #include <asm/cacheflush.h> |
|---|
| 17 | 18 | #include <asm/fixmap.h> |
|---|
| 18 | | -#include <asm/kmap_types.h> |
|---|
| 19 | | -#include <asm/pgtable.h> |
|---|
| 20 | 19 | |
|---|
| 21 | | -#define PKMAP_BASE ((FIXADDR_START - \ |
|---|
| 20 | +#define PKMAP_BASE ((FIXADDR_START - \ |
|---|
| 22 | 21 | (LAST_PKMAP + 1) * PAGE_SIZE) & PMD_MASK) |
|---|
| 23 | 22 | #define LAST_PKMAP (PTRS_PER_PTE * DCACHE_N_COLORS) |
|---|
| 24 | 23 | #define LAST_PKMAP_MASK (LAST_PKMAP - 1) |
|---|
| .. | .. |
|---|
| 63 | 62 | |
|---|
| 64 | 63 | extern pte_t *pkmap_page_table; |
|---|
| 65 | 64 | |
|---|
| 66 | | -void *kmap_high(struct page *page); |
|---|
| 67 | | -void kunmap_high(struct page *page); |
|---|
| 68 | | - |
|---|
| 69 | | -static inline void *kmap(struct page *page) |
|---|
| 70 | | -{ |
|---|
| 71 | | - /* Check if this memory layout is broken because PKMAP overlaps |
|---|
| 72 | | - * page table. |
|---|
| 73 | | - */ |
|---|
| 74 | | - BUILD_BUG_ON(PKMAP_BASE < |
|---|
| 75 | | - TLBTEMP_BASE_1 + TLBTEMP_SIZE); |
|---|
| 76 | | - BUG_ON(in_interrupt()); |
|---|
| 77 | | - if (!PageHighMem(page)) |
|---|
| 78 | | - return page_address(page); |
|---|
| 79 | | - return kmap_high(page); |
|---|
| 80 | | -} |
|---|
| 81 | | - |
|---|
| 82 | | -static inline void kunmap(struct page *page) |
|---|
| 83 | | -{ |
|---|
| 84 | | - BUG_ON(in_interrupt()); |
|---|
| 85 | | - if (!PageHighMem(page)) |
|---|
| 86 | | - return; |
|---|
| 87 | | - kunmap_high(page); |
|---|
| 88 | | -} |
|---|
| 89 | | - |
|---|
| 90 | 65 | static inline void flush_cache_kmaps(void) |
|---|
| 91 | 66 | { |
|---|
| 92 | 67 | flush_cache_all(); |
|---|
| 93 | 68 | } |
|---|
| 94 | 69 | |
|---|
| 95 | | -void *kmap_atomic(struct page *page); |
|---|
| 96 | | -void __kunmap_atomic(void *kvaddr); |
|---|
| 70 | +enum fixed_addresses kmap_local_map_idx(int type, unsigned long pfn); |
|---|
| 71 | +#define arch_kmap_local_map_idx kmap_local_map_idx |
|---|
| 72 | + |
|---|
| 73 | +enum fixed_addresses kmap_local_unmap_idx(int type, unsigned long addr); |
|---|
| 74 | +#define arch_kmap_local_unmap_idx kmap_local_unmap_idx |
|---|
| 75 | + |
|---|
| 76 | +#define arch_kmap_local_post_unmap(vaddr) \ |
|---|
| 77 | + local_flush_tlb_kernel_range(vaddr, vaddr + PAGE_SIZE) |
|---|
| 97 | 78 | |
|---|
| 98 | 79 | void kmap_init(void); |
|---|
| 99 | 80 | |
|---|