diff options
Diffstat (limited to 'include/asm-sh/page.h')
-rw-r--r-- | include/asm-sh/page.h | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index ca8b26d90475..380fd62dd05a 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
@@ -13,9 +13,16 @@ | |||
13 | [ P4 control ] 0xE0000000 | 13 | [ P4 control ] 0xE0000000 |
14 | */ | 14 | */ |
15 | 15 | ||
16 | |||
17 | /* PAGE_SHIFT determines the page size */ | 16 | /* PAGE_SHIFT determines the page size */ |
18 | #define PAGE_SHIFT 12 | 17 | #if defined(CONFIG_PAGE_SIZE_4KB) |
18 | # define PAGE_SHIFT 12 | ||
19 | #elif defined(CONFIG_PAGE_SIZE_8KB) | ||
20 | # define PAGE_SHIFT 13 | ||
21 | #elif defined(CONFIG_PAGE_SIZE_64KB) | ||
22 | # define PAGE_SHIFT 16 | ||
23 | #else | ||
24 | # error "Bogus kernel page size?" | ||
25 | #endif | ||
19 | 26 | ||
20 | #ifdef __ASSEMBLY__ | 27 | #ifdef __ASSEMBLY__ |
21 | #define PAGE_SIZE (1 << PAGE_SHIFT) | 28 | #define PAGE_SIZE (1 << PAGE_SHIFT) |
@@ -28,8 +35,14 @@ | |||
28 | 35 | ||
29 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) | 36 | #if defined(CONFIG_HUGETLB_PAGE_SIZE_64K) |
30 | #define HPAGE_SHIFT 16 | 37 | #define HPAGE_SHIFT 16 |
38 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K) | ||
39 | #define HPAGE_SHIFT 18 | ||
31 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) | 40 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_1MB) |
32 | #define HPAGE_SHIFT 20 | 41 | #define HPAGE_SHIFT 20 |
42 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_4MB) | ||
43 | #define HPAGE_SHIFT 22 | ||
44 | #elif defined(CONFIG_HUGETLB_PAGE_SIZE_64MB) | ||
45 | #define HPAGE_SHIFT 26 | ||
33 | #endif | 46 | #endif |
34 | 47 | ||
35 | #ifdef CONFIG_HUGETLB_PAGE | 48 | #ifdef CONFIG_HUGETLB_PAGE |
@@ -69,15 +82,25 @@ extern void __copy_user_page(void *to, void *from, void *orig_to); | |||
69 | /* | 82 | /* |
70 | * These are used to make use of C type-checking.. | 83 | * These are used to make use of C type-checking.. |
71 | */ | 84 | */ |
72 | typedef struct { unsigned long pte; } pte_t; | 85 | #ifdef CONFIG_X2TLB |
73 | typedef struct { unsigned long pgd; } pgd_t; | 86 | typedef struct { unsigned long pte_low, pte_high; } pte_t; |
87 | typedef struct { unsigned long long pgprot; } pgprot_t; | ||
88 | #define pte_val(x) \ | ||
89 | ((x).pte_low | ((unsigned long long)(x).pte_high << 32)) | ||
90 | #define __pte(x) \ | ||
91 | ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; }) | ||
92 | #else | ||
93 | typedef struct { unsigned long pte_low; } pte_t; | ||
74 | typedef struct { unsigned long pgprot; } pgprot_t; | 94 | typedef struct { unsigned long pgprot; } pgprot_t; |
95 | #define pte_val(x) ((x).pte_low) | ||
96 | #define __pte(x) ((pte_t) { (x) } ) | ||
97 | #endif | ||
98 | |||
99 | typedef struct { unsigned long pgd; } pgd_t; | ||
75 | 100 | ||
76 | #define pte_val(x) ((x).pte) | ||
77 | #define pgd_val(x) ((x).pgd) | 101 | #define pgd_val(x) ((x).pgd) |
78 | #define pgprot_val(x) ((x).pgprot) | 102 | #define pgprot_val(x) ((x).pgprot) |
79 | 103 | ||
80 | #define __pte(x) ((pte_t) { (x) } ) | ||
81 | #define __pgd(x) ((pgd_t) { (x) } ) | 104 | #define __pgd(x) ((pgd_t) { (x) } ) |
82 | #define __pgprot(x) ((pgprot_t) { (x) } ) | 105 | #define __pgprot(x) ((pgprot_t) { (x) } ) |
83 | 106 | ||