1 #ifndef _M68K_PAGE_H
2 #define _M68K_PAGE_H
3
4
5 #define PAGE_SHIFT 12
6 #define PAGE_SIZE (1UL << PAGE_SHIFT)
7 #define PAGE_MASK (~(PAGE_SIZE-1))
8
9 #ifdef __KERNEL__
10
11 #define STRICT_MM_TYPECHECKS
12
13 #ifdef STRICT_MM_TYPECHECKS
14
15
16
17 typedef struct { unsigned long pte; } pte_t;
18 typedef struct { unsigned long pmd[16]; } pmd_t;
19 typedef struct { unsigned long pgd; } pgd_t;
20 typedef struct { unsigned long pgprot; } pgprot_t;
21
22 #define pte_val(x) ((x).pte)
23 #define pmd_val(x) ((&x)->pmd[0])
24 #define pgd_val(x) ((x).pgd)
25 #define pgprot_val(x) ((x).pgprot)
26
27 #define __pte(x) ((pte_t) { (x) } )
28 #define __pmd(x) ((pmd_t) { (x) } )
29 #define __pgd(x) ((pgd_t) { (x) } )
30 #define __pgprot(x) ((pgprot_t) { (x) } )
31
32 #else
33
34
35
36 typedef unsigned long pte_t;
37 typedef struct { unsigned long pmd[16]; } pmd_t;
38 typedef unsigned long pgd_t;
39 typedef unsigned long pgprot_t;
40
41 #define pte_val(x) (x)
42 #define pmd_val(x) ((&x)->pmd[0])
43 #define pgd_val(x) (x)
44 #define pgprot_val(x) (x)
45
46 #define __pte(x) (x)
47 #define __pmd(x) ((pmd_t) { (x) } )
48 #define __pgd(x) (x)
49 #define __pgprot(x) (x)
50
51 #endif
52
53
54
55 extern int m68k_is040or060;
56
57
58
59
60 extern int m68k_pgtable_cachemode;
61
62
63 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
64
65
66 #define PAGE_OFFSET 0
67 #define MAP_NR(addr) (((unsigned long)(addr)) >> PAGE_SHIFT)
68 #define MAP_PAGE_RESERVED (1<<15)
69
70 #endif
71
72 #endif