WIP FPC-III support
[linux/fpc-iii.git] / arch / nds32 / include / asm / highmem.h
blob16159a8716f22344d4fbee763be4cde01616a229
1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2005-2017 Andes Technology Corporation
4 #ifndef _ASM_HIGHMEM_H
5 #define _ASM_HIGHMEM_H
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
13 * chunk of RAM.
16 * Ordering is (from lower to higher memory addresses):
18 * high_memory
19 * Persistent kmap area
20 * PKMAP_BASE
21 * fixed_addresses
22 * FIXADDR_START
23 * FIXADDR_TOP
24 * Vmalloc area
25 * VMALLOC_START
26 * VMALLOC_END
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) \
52 do { \
53 __nds32__tlbop_inv(vaddr); \
54 __nds32__mtsr_dsb(vaddr, NDS32_SR_TLB_VPN); \
55 __nds32__tlbop_rwr(pteval); \
56 __nds32__isb(); \
57 } while (0)
59 #define arch_kmap_local_pre_unmap(vaddr) \
60 do { \
61 __nds32__tlbop_inv(vaddr); \
62 __nds32__isb(); \
63 } while (0)
65 #endif