xref: /openbmc/linux/arch/csky/include/asm/highmem.h (revision b830f94f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
3 
4 #ifndef __ASM_CSKY_HIGHMEM_H
5 #define __ASM_CSKY_HIGHMEM_H
6 
7 #ifdef __KERNEL__
8 
9 #include <linux/init.h>
10 #include <linux/interrupt.h>
11 #include <linux/uaccess.h>
12 #include <asm/kmap_types.h>
13 #include <asm/cache.h>
14 
15 /* undef for production */
16 #define HIGHMEM_DEBUG 1
17 
18 /* declarations for highmem.c */
19 extern unsigned long highstart_pfn, highend_pfn;
20 
21 extern pte_t *pkmap_page_table;
22 
23 /*
24  * Right now we initialize only a single pte table. It can be extended
25  * easily, subsequent pte tables have to be allocated in one physical
26  * chunk of RAM.
27  */
28 #define LAST_PKMAP 1024
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))
32 
33 extern void *kmap_high(struct page *page);
34 extern void kunmap_high(struct page *page);
35 
36 extern void *kmap(struct page *page);
37 extern void kunmap(struct page *page);
38 extern void *kmap_atomic(struct page *page);
39 extern void __kunmap_atomic(void *kvaddr);
40 extern void *kmap_atomic_pfn(unsigned long pfn);
41 extern struct page *kmap_atomic_to_page(void *ptr);
42 
43 #define flush_cache_kmaps() do {} while (0)
44 
45 extern void kmap_init(void);
46 
47 #define kmap_prot PAGE_KERNEL
48 
49 #endif /* __KERNEL__ */
50 
51 #endif /* __ASM_CSKY_HIGHMEM_H */
52