treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[linux-2.6-block.git] / arch / unicore32 / include / asm / cpu-single.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * linux/arch/unicore32/include/asm/cpu-single.h
4  *
5  * Code specific to PKUnity SoC and UniCore ISA
6  *
7  * Copyright (C) 2001-2010 GUAN Xue-tao
8  */
9 #ifndef __UNICORE_CPU_SINGLE_H__
10 #define __UNICORE_CPU_SINGLE_H__
11
12 #include <asm/page.h>
13 #include <asm/memory.h>
14
15 #ifdef __KERNEL__
16 #ifndef __ASSEMBLY__
17
18 #define cpu_switch_mm(pgd, mm) cpu_do_switch_mm(virt_to_phys(pgd), mm)
19
20 #define cpu_get_pgd()                                   \
21         ({                                              \
22                 unsigned long pg;                       \
23                 __asm__("movc   %0, p0.c2, #0"          \
24                          : "=r" (pg) : : "cc");         \
25                 pg &= ~0x0fff;                          \
26                 (pgd_t *)phys_to_virt(pg);              \
27         })
28
29 struct mm_struct;
30
31 /* declare all the functions as extern */
32 extern void cpu_proc_fin(void);
33 extern int cpu_do_idle(void);
34 extern void cpu_dcache_clean_area(void *, int);
35 extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
36 extern void cpu_set_pte(pte_t *ptep, pte_t pte);
37 extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
38
39 #endif /* __ASSEMBLY__ */
40 #endif /* __KERNEL__ */
41
42 #endif /* __UNICORE_CPU_SINGLE_H__ */