Merge branch 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[linux/fpc-iii.git] / arch / unicore32 / include / asm / page.h
blob594b3226250ea853386b5aed8893ddcece7b1787
1 /*
2 * linux/arch/unicore32/include/asm/page.h
4 * Code specific to PKUnity SoC and UniCore ISA
6 * Copyright (C) 2001-2010 GUAN Xue-tao
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 #ifndef __UNICORE_PAGE_H__
13 #define __UNICORE_PAGE_H__
15 /* PAGE_SHIFT determines the page size */
16 #define PAGE_SHIFT 12
17 #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
18 #define PAGE_MASK (~(PAGE_SIZE-1))
20 #ifndef __ASSEMBLY__
22 struct page;
23 struct vm_area_struct;
25 #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
26 extern void copy_page(void *to, const void *from);
28 #define clear_user_page(page, vaddr, pg) clear_page(page)
29 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
31 #undef STRICT_MM_TYPECHECKS
33 #ifdef STRICT_MM_TYPECHECKS
35 * These are used to make use of C type-checking..
37 typedef struct { unsigned long pte; } pte_t;
38 typedef struct { unsigned long pgd; } pgd_t;
39 typedef struct { unsigned long pgprot; } pgprot_t;
41 #define pte_val(x) ((x).pte)
42 #define pgd_val(x) ((x).pgd)
43 #define pgprot_val(x) ((x).pgprot)
45 #define __pte(x) ((pte_t) { (x) })
46 #define __pgd(x) ((pgd_t) { (x) })
47 #define __pgprot(x) ((pgprot_t) { (x) })
49 #else
51 * .. while these make it easier on the compiler
53 typedef unsigned long pte_t;
54 typedef unsigned long pgd_t;
55 typedef unsigned long pgprot_t;
57 #define pte_val(x) (x)
58 #define pgd_val(x) (x)
59 #define pgprot_val(x) (x)
61 #define __pte(x) (x)
62 #define __pgd(x) (x)
63 #define __pgprot(x) (x)
65 #endif /* STRICT_MM_TYPECHECKS */
67 typedef struct page *pgtable_t;
69 extern int pfn_valid(unsigned long);
71 #include <asm/memory.h>
73 #endif /* !__ASSEMBLY__ */
75 #define VM_DATA_DEFAULT_FLAGS \
76 (VM_READ | VM_WRITE | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
78 #include <asm-generic/getorder.h>
80 #endif