1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/unicore32/include/asm/page.h
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
9 #ifndef __UNICORE_PAGE_H__
10 #define __UNICORE_PAGE_H__
12 /* PAGE_SHIFT determines the page size */
14 #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
15 #define PAGE_MASK (~(PAGE_SIZE-1))
20 struct vm_area_struct;
22 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
23 extern void copy_page(void *to, const void *from);
25 #define clear_user_page(page, vaddr, pg) clear_page(page)
26 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
28 #undef STRICT_MM_TYPECHECKS
30 #ifdef STRICT_MM_TYPECHECKS
32 * These are used to make use of C type-checking..
34 typedef struct { unsigned long pte; } pte_t;
35 typedef struct { unsigned long pgd; } pgd_t;
36 typedef struct { unsigned long pgprot; } pgprot_t;
38 #define pte_val(x) ((x).pte)
39 #define pgd_val(x) ((x).pgd)
40 #define pgprot_val(x) ((x).pgprot)
42 #define __pte(x) ((pte_t) { (x) })
43 #define __pgd(x) ((pgd_t) { (x) })
44 #define __pgprot(x) ((pgprot_t) { (x) })
48 * .. while these make it easier on the compiler
50 typedef unsigned long pte_t;
51 typedef unsigned long pgd_t;
52 typedef unsigned long pgprot_t;
54 #define pte_val(x) (x)
55 #define pgd_val(x) (x)
56 #define pgprot_val(x) (x)
60 #define __pgprot(x) (x)
62 #endif /* STRICT_MM_TYPECHECKS */
64 typedef struct page *pgtable_t;
66 extern int pfn_valid(unsigned long);
68 #include <asm/memory.h>
70 #endif /* !__ASSEMBLY__ */
72 #define VM_DATA_DEFAULT_FLAGS \
73 (VM_READ | VM_WRITE | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
75 #include <asm-generic/getorder.h>