1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2005-2017 Andes Technology Corporation
7 #include <asm/proc-fns.h>
8 #include <asm/fixmap.h>
11 * Right now we initialize only a single pte table. It can be extended
12 * easily, subsequent pte tables have to be allocated in one physical
16 * Ordering is (from lower to higher memory addresses):
19 * Persistent kmap area
28 #define PKMAP_BASE ((FIXADDR_START - PGDIR_SIZE) & (PGDIR_MASK))
29 #define LAST_PKMAP PTRS_PER_PTE
30 #define LAST_PKMAP_MASK (LAST_PKMAP - 1)
31 #define PKMAP_NR(virt) (((virt) - (PKMAP_BASE)) >> PAGE_SHIFT)
32 #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
34 static inline void flush_cache_kmaps(void)
36 cpu_dcache_wbinval_all();
39 /* declarations for highmem.c */
40 extern unsigned long highstart_pfn
, highend_pfn
;
42 extern pte_t
*pkmap_page_table
;
44 extern void kmap_init(void);
47 * FIXME: The below looks broken vs. a kmap_atomic() in task context which
48 * is interupted and another kmap_atomic() happens in interrupt context.
49 * But what do I know about nds32. -- tglx
51 #define arch_kmap_local_post_map(vaddr, pteval) \
53 __nds32__tlbop_inv(vaddr); \
54 __nds32__mtsr_dsb(vaddr, NDS32_SR_TLB_VPN); \
55 __nds32__tlbop_rwr(pteval); \
59 #define arch_kmap_local_pre_unmap(vaddr) \
61 __nds32__tlbop_inv(vaddr); \