1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2005-2017 Andes Technology Corporation
7 #include <asm/proc-fns.h>
8 #include <asm/kmap_types.h>
9 #include <asm/fixmap.h>
12 * Right now we initialize only a single pte table. It can be extended
13 * easily, subsequent pte tables have to be allocated in one physical
17 * Ordering is (from lower to higher memory addresses):
20 * Persistent kmap area
29 #define PKMAP_BASE ((FIXADDR_START - PGDIR_SIZE) & (PGDIR_MASK))
30 #define LAST_PKMAP PTRS_PER_PTE
31 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
32 #define PKMAP_NR(virt) (((virt) - (PKMAP_BASE)) >> PAGE_SHIFT)
33 #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
35 static inline void flush_cache_kmaps(void)
37 cpu_dcache_wbinval_all();
40 /* declarations for highmem.c */
41 extern unsigned long highstart_pfn, highend_pfn;
43 extern pte_t *pkmap_page_table;
45 extern void kmap_init(void);
48 * The following functions are already defined by <linux/highmem.h>
49 * when CONFIG_HIGHMEM is not set.
52 extern void *kmap_atomic_pfn(unsigned long pfn);