aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include/asm
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2010-09-07 01:49:10 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-10-22 03:43:24 -0400
commit138ff3462f53a7370bef15443e623ecba1c350bf (patch)
tree2a12a53579dec5c4b6f3f449be21c7ff1d00ca10 /arch/m68k/include/asm
parentb0860c1d80016df82b93b926f1cff3110ccb5028 (diff)
m68k/m68knommu: clean up page.h
There is a lot of common defines in the MMU and non-MMU variants of page.h. Factor out the common stuff into the master page.h. It still includes the underlying page_mm.h or page_no.h, but they only contain the real differences now. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/include/asm')
-rw-r--r--arch/m68k/include/asm/page.h48
-rw-r--r--arch/m68k/include/asm/page_mm.h49
-rw-r--r--arch/m68k/include/asm/page_no.h51
3 files changed, 55 insertions, 93 deletions
diff --git a/arch/m68k/include/asm/page.h b/arch/m68k/include/asm/page.h
index f2b4480cc98a..dfebb7c1e379 100644
--- a/arch/m68k/include/asm/page.h
+++ b/arch/m68k/include/asm/page.h
@@ -1,5 +1,49 @@
1#ifdef __uClinux__ 1#ifndef _M68K_PAGE_H
2#include "page_no.h" 2#define _M68K_PAGE_H
3
4#include <linux/const.h>
5#include <asm/setup.h>
6#include <asm/page_offset.h>
7
8/* PAGE_SHIFT determines the page size */
9#ifndef CONFIG_SUN3
10#define PAGE_SHIFT (12)
3#else 11#else
12#define PAGE_SHIFT (13)
13#endif
14#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
15#define PAGE_MASK (~(PAGE_SIZE-1))
16#define PAGE_OFFSET (PAGE_OFFSET_RAW)
17
18#ifndef __ASSEMBLY__
19
20/*
21 * These are used to make use of C type-checking..
22 */
23typedef struct { unsigned long pte; } pte_t;
24typedef struct { unsigned long pmd[16]; } pmd_t;
25typedef struct { unsigned long pgd; } pgd_t;
26typedef struct { unsigned long pgprot; } pgprot_t;
27typedef struct page *pgtable_t;
28
29#define pte_val(x) ((x).pte)
30#define pmd_val(x) ((&x)->pmd[0])
31#define pgd_val(x) ((x).pgd)
32#define pgprot_val(x) ((x).pgprot)
33
34#define __pte(x) ((pte_t) { (x) } )
35#define __pmd(x) ((pmd_t) { (x) } )
36#define __pgd(x) ((pgd_t) { (x) } )
37#define __pgprot(x) ((pgprot_t) { (x) } )
38
39#endif /* !__ASSEMBLY__ */
40
41#ifdef CONFIG_MMU
4#include "page_mm.h" 42#include "page_mm.h"
43#else
44#include "page_no.h"
5#endif 45#endif
46
47#include <asm-generic/getorder.h>
48
49#endif /* _M68K_PAGE_H */
diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
index eeb6764c1053..66f0b3938cbb 100644
--- a/arch/m68k/include/asm/page_mm.h
+++ b/arch/m68k/include/asm/page_mm.h
@@ -1,23 +1,9 @@
1#ifndef _M68K_PAGE_H 1#ifndef _M68K_PAGE_MM_H
2#define _M68K_PAGE_H 2#define _M68K_PAGE_MM_H
3
4#include <linux/const.h>
5
6/* PAGE_SHIFT determines the page size */
7#ifndef CONFIG_SUN3
8#define PAGE_SHIFT (12)
9#else
10#define PAGE_SHIFT (13)
11#endif
12#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
13#define PAGE_MASK (~(PAGE_SIZE-1))
14
15#include <asm/setup.h>
16 3
17#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
18 5
19#include <linux/compiler.h> 6#include <linux/compiler.h>
20
21#include <asm/module.h> 7#include <asm/module.h>
22 8
23#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 9#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
@@ -78,33 +64,6 @@ static inline void clear_page(void *page)
78 flush_dcache_page(page); \ 64 flush_dcache_page(page); \
79 } while (0) 65 } while (0)
80 66
81/*
82 * These are used to make use of C type-checking..
83 */
84typedef struct { unsigned long pte; } pte_t;
85typedef struct { unsigned long pmd[16]; } pmd_t;
86typedef struct { unsigned long pgd; } pgd_t;
87typedef struct { unsigned long pgprot; } pgprot_t;
88typedef struct page *pgtable_t;
89
90#define pte_val(x) ((x).pte)
91#define pmd_val(x) ((&x)->pmd[0])
92#define pgd_val(x) ((x).pgd)
93#define pgprot_val(x) ((x).pgprot)
94
95#define __pte(x) ((pte_t) { (x) } )
96#define __pmd(x) ((pmd_t) { (x) } )
97#define __pgd(x) ((pgd_t) { (x) } )
98#define __pgprot(x) ((pgprot_t) { (x) } )
99
100#endif /* !__ASSEMBLY__ */
101
102#include <asm/page_offset.h>
103
104#define PAGE_OFFSET (PAGE_OFFSET_RAW)
105
106#ifndef __ASSEMBLY__
107
108extern unsigned long m68k_memoffset; 67extern unsigned long m68k_memoffset;
109 68
110#ifndef CONFIG_SUN3 69#ifndef CONFIG_SUN3
@@ -217,6 +176,4 @@ static inline __attribute_const__ int __virt_to_node_shift(void)
217#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 176#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
218 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 177 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
219 178
220#include <asm-generic/getorder.h> 179#endif /* _M68K_PAGE_MM_H */
221
222#endif /* _M68K_PAGE_H */
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h
index 8029a33e03c3..90595721185f 100644
--- a/arch/m68k/include/asm/page_no.h
+++ b/arch/m68k/include/asm/page_no.h
@@ -1,18 +1,11 @@
1#ifndef _M68KNOMMU_PAGE_H 1#ifndef _M68K_PAGE_NO_H
2#define _M68KNOMMU_PAGE_H 2#define _M68K_PAGE_NO_H
3
4#include <linux/const.h>
5
6/* PAGE_SHIFT determines the page size */
7
8#define PAGE_SHIFT (12)
9#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
10#define PAGE_MASK (~(PAGE_SIZE-1))
11
12#include <asm/setup.h>
13 3
14#ifndef __ASSEMBLY__ 4#ifndef __ASSEMBLY__
15 5
6extern unsigned long memory_start;
7extern unsigned long memory_end;
8
16#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 9#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
17#define free_user_page(page, addr) free_page(addr) 10#define free_user_page(page, addr) free_page(addr)
18 11
@@ -26,36 +19,6 @@
26 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr) 19 alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
27#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 20#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
28 21
29/*
30 * These are used to make use of C type-checking..
31 */
32typedef struct { unsigned long pte; } pte_t;
33typedef struct { unsigned long pmd[16]; } pmd_t;
34typedef struct { unsigned long pgd; } pgd_t;
35typedef struct { unsigned long pgprot; } pgprot_t;
36typedef struct page *pgtable_t;
37
38#define pte_val(x) ((x).pte)
39#define pmd_val(x) ((&x)->pmd[0])
40#define pgd_val(x) ((x).pgd)
41#define pgprot_val(x) ((x).pgprot)
42
43#define __pte(x) ((pte_t) { (x) } )
44#define __pmd(x) ((pmd_t) { (x) } )
45#define __pgd(x) ((pgd_t) { (x) } )
46#define __pgprot(x) ((pgprot_t) { (x) } )
47
48extern unsigned long memory_start;
49extern unsigned long memory_end;
50
51#endif /* !__ASSEMBLY__ */
52
53#include <asm/page_offset.h>
54
55#define PAGE_OFFSET (PAGE_OFFSET_RAW)
56
57#ifndef __ASSEMBLY__
58
59#define __pa(vaddr) ((unsigned long)(vaddr)) 22#define __pa(vaddr) ((unsigned long)(vaddr))
60#define __va(paddr) ((void *)(paddr)) 23#define __va(paddr) ((void *)(paddr))
61 24
@@ -74,6 +37,4 @@ extern unsigned long memory_end;
74 37
75#endif /* __ASSEMBLY__ */ 38#endif /* __ASSEMBLY__ */
76 39
77#include <asm-generic/getorder.h> 40#endif /* _M68K_PAGE_NO_H */
78
79#endif /* _M68KNOMMU_PAGE_H */