diff options
Diffstat (limited to 'include/asm-sh/page.h')
-rw-r--r-- | include/asm-sh/page.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 6f7eb8a3aba5..ca8b26d90475 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -16,7 +16,13 @@ | |||
16 | 16 | ||
17 | /* PAGE_SHIFT determines the page size */ | 17 | /* PAGE_SHIFT determines the page size */ |
18 | #define PAGE_SHIFT 12 | 18 | #define PAGE_SHIFT 12 |
19 | |||
20 | #ifdef __ASSEMBLY__ | ||
21 | #define PAGE_SIZE (1 << PAGE_SHIFT) | ||
22 | #else | ||
19 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 23 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
24 | #endif | ||
25 | |||
20 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 26 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
21 | #define PTE_MASK PAGE_MASK | 27 | #define PTE_MASK PAGE_MASK |
22 | 28 | ||
@@ -30,7 +36,6 @@ | |||
30 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) | 36 | #define HPAGE_SIZE (1UL << HPAGE_SHIFT) |
31 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) | 37 | #define HPAGE_MASK (~(HPAGE_SIZE-1)) |
32 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) | 38 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT-PAGE_SHIFT) |
33 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
34 | #endif | 39 | #endif |
35 | 40 | ||
36 | #ifdef __KERNEL__ | 41 | #ifdef __KERNEL__ |
@@ -39,10 +44,18 @@ | |||
39 | extern void (*clear_page)(void *to); | 44 | extern void (*clear_page)(void *to); |
40 | extern void (*copy_page)(void *to, void *from); | 45 | extern void (*copy_page)(void *to, void *from); |
41 | 46 | ||
47 | extern unsigned long shm_align_mask; | ||
48 | |||
49 | #ifdef CONFIG_MMU | ||
42 | extern void clear_page_slow(void *to); | 50 | extern void clear_page_slow(void *to); |
43 | extern void copy_page_slow(void *to, void *from); | 51 | extern void copy_page_slow(void *to, void *from); |
52 | #else | ||
53 | extern void clear_page_nommu(void *to); | ||
54 | extern void copy_page_nommu(void *to, void *from); | ||
55 | #endif | ||
44 | 56 | ||
45 | #if defined(CONFIG_SH7705_CACHE_32KB) && defined(CONFIG_MMU) | 57 | #if defined(CONFIG_MMU) && (defined(CONFIG_CPU_SH4) || \ |
58 | defined(CONFIG_SH7705_CACHE_32KB)) | ||
46 | struct page; | 59 | struct page; |
47 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); | 60 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); |
48 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); | 61 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); |
@@ -51,29 +64,20 @@ extern void __copy_user_page(void *to, void *from, void *orig_to); | |||
51 | #elif defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH3) || !defined(CONFIG_MMU) | 64 | #elif defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH3) || !defined(CONFIG_MMU) |
52 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 65 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
53 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 66 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
54 | #elif defined(CONFIG_CPU_SH4) | ||
55 | struct page; | ||
56 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); | ||
57 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); | ||
58 | extern void __clear_user_page(void *to, void *orig_to); | ||
59 | extern void __copy_user_page(void *to, void *from, void *orig_to); | ||
60 | #endif | 67 | #endif |
61 | 68 | ||
62 | /* | 69 | /* |
63 | * These are used to make use of C type-checking.. | 70 | * These are used to make use of C type-checking.. |
64 | */ | 71 | */ |
65 | typedef struct { unsigned long pte; } pte_t; | 72 | typedef struct { unsigned long pte; } pte_t; |
66 | typedef struct { unsigned long pmd; } pmd_t; | ||
67 | typedef struct { unsigned long pgd; } pgd_t; | 73 | typedef struct { unsigned long pgd; } pgd_t; |
68 | typedef struct { unsigned long pgprot; } pgprot_t; | 74 | typedef struct { unsigned long pgprot; } pgprot_t; |
69 | 75 | ||
70 | #define pte_val(x) ((x).pte) | 76 | #define pte_val(x) ((x).pte) |
71 | #define pmd_val(x) ((x).pmd) | ||
72 | #define pgd_val(x) ((x).pgd) | 77 | #define pgd_val(x) ((x).pgd) |
73 | #define pgprot_val(x) ((x).pgprot) | 78 | #define pgprot_val(x) ((x).pgprot) |
74 | 79 | ||
75 | #define __pte(x) ((pte_t) { (x) } ) | 80 | #define __pte(x) ((pte_t) { (x) } ) |
76 | #define __pmd(x) ((pmd_t) { (x) } ) | ||
77 | #define __pgd(x) ((pgd_t) { (x) } ) | 81 | #define __pgd(x) ((pgd_t) { (x) } ) |
78 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 82 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
79 | 83 | ||
@@ -93,7 +97,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
93 | #define __MEMORY_START CONFIG_MEMORY_START | 97 | #define __MEMORY_START CONFIG_MEMORY_START |
94 | #define __MEMORY_SIZE CONFIG_MEMORY_SIZE | 98 | #define __MEMORY_SIZE CONFIG_MEMORY_SIZE |
95 | 99 | ||
96 | #define PAGE_OFFSET (0x80000000UL) | 100 | #define PAGE_OFFSET CONFIG_PAGE_OFFSET |
97 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) | 101 | #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) |
98 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) | 102 | #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) |
99 | 103 | ||
@@ -115,5 +119,10 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
115 | #include <asm-generic/memory_model.h> | 119 | #include <asm-generic/memory_model.h> |
116 | #include <asm-generic/page.h> | 120 | #include <asm-generic/page.h> |
117 | 121 | ||
122 | /* vDSO support */ | ||
123 | #ifdef CONFIG_VSYSCALL | ||
124 | #define __HAVE_ARCH_GATE_AREA | ||
125 | #endif | ||
126 | |||
118 | #endif /* __KERNEL__ */ | 127 | #endif /* __KERNEL__ */ |
119 | #endif /* __ASM_SH_PAGE_H */ | 128 | #endif /* __ASM_SH_PAGE_H */ |