1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <asm/cacheflush.h>
6 #include <asm/kmap_types.h>
7 #include <asm/fixmap.h>
10 * Right now we initialize only a single pte table. It can be extended
11 * easily, subsequent pte tables have to be allocated in one physical
15 * Ordering is (from lower to higher memory addresses):
18 * Persistent kmap area
27 #define PKMAP_BASE (FIXADDR_START - PMD_SIZE)
28 #define LAST_PKMAP PTRS_PER_PTE
29 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
30 #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
31 #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
33 #define kmap_prot PAGE_KERNEL
35 static inline void flush_cache_kmaps(void)
40 /* declarations for highmem.c */
41 extern unsigned long highstart_pfn, highend_pfn;
43 extern pte_t *pkmap_page_table;
45 extern void *kmap_high(struct page *page);
46 extern void kunmap_high(struct page *page);
48 extern void kmap_init(void);
51 * The following functions are already defined by <linux/highmem.h>
52 * when CONFIG_HIGHMEM is not set.
55 extern void *kmap(struct page *page);
56 extern void kunmap(struct page *page);
57 extern void *kmap_atomic(struct page *page);
58 extern void __kunmap_atomic(void *kvaddr);
59 extern void *kmap_atomic_pfn(unsigned long pfn);