diff options
Diffstat (limited to 'include/asm-ia64/page.h')
-rw-r--r-- | include/asm-ia64/page.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 9edffad8c28b..5e6362a786b7 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h | |||
@@ -47,8 +47,6 @@ | |||
47 | #define PERCPU_PAGE_SHIFT 16 /* log2() of max. size of per-CPU area */ | 47 | #define PERCPU_PAGE_SHIFT 16 /* log2() of max. size of per-CPU area */ |
48 | #define PERCPU_PAGE_SIZE (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT) | 48 | #define PERCPU_PAGE_SIZE (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT) |
49 | 49 | ||
50 | #define RGN_MAP_LIMIT ((1UL << (4*PAGE_SHIFT - 12)) - PAGE_SIZE) /* per region addr limit */ | ||
51 | |||
52 | 50 | ||
53 | #ifdef CONFIG_HUGETLB_PAGE | 51 | #ifdef CONFIG_HUGETLB_PAGE |
54 | # define HPAGE_REGION_BASE RGN_BASE(RGN_HPAGE) | 52 | # define HPAGE_REGION_BASE RGN_BASE(RGN_HPAGE) |
@@ -102,24 +100,26 @@ do { \ | |||
102 | 100 | ||
103 | #ifdef CONFIG_VIRTUAL_MEM_MAP | 101 | #ifdef CONFIG_VIRTUAL_MEM_MAP |
104 | extern int ia64_pfn_valid (unsigned long pfn); | 102 | extern int ia64_pfn_valid (unsigned long pfn); |
105 | #else | 103 | #elif defined(CONFIG_FLATMEM) |
106 | # define ia64_pfn_valid(pfn) 1 | 104 | # define ia64_pfn_valid(pfn) 1 |
107 | #endif | 105 | #endif |
108 | 106 | ||
109 | #ifndef CONFIG_DISCONTIGMEM | 107 | #ifdef CONFIG_FLATMEM |
110 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) | 108 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) |
111 | # define page_to_pfn(page) ((unsigned long) (page - mem_map)) | 109 | # define page_to_pfn(page) ((unsigned long) (page - mem_map)) |
112 | # define pfn_to_page(pfn) (mem_map + (pfn)) | 110 | # define pfn_to_page(pfn) (mem_map + (pfn)) |
113 | #else | 111 | #elif defined(CONFIG_DISCONTIGMEM) |
114 | extern struct page *vmem_map; | 112 | extern struct page *vmem_map; |
113 | extern unsigned long min_low_pfn; | ||
115 | extern unsigned long max_low_pfn; | 114 | extern unsigned long max_low_pfn; |
116 | # define pfn_valid(pfn) (((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) | 115 | # define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) |
117 | # define page_to_pfn(page) ((unsigned long) (page - vmem_map)) | 116 | # define page_to_pfn(page) ((unsigned long) (page - vmem_map)) |
118 | # define pfn_to_page(pfn) (vmem_map + (pfn)) | 117 | # define pfn_to_page(pfn) (vmem_map + (pfn)) |
119 | #endif | 118 | #endif |
120 | 119 | ||
121 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 120 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
122 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 121 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
122 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | ||
123 | 123 | ||
124 | typedef union ia64_va { | 124 | typedef union ia64_va { |
125 | struct { | 125 | struct { |
@@ -174,11 +174,17 @@ get_order (unsigned long size) | |||
174 | */ | 174 | */ |
175 | typedef struct { unsigned long pte; } pte_t; | 175 | typedef struct { unsigned long pte; } pte_t; |
176 | typedef struct { unsigned long pmd; } pmd_t; | 176 | typedef struct { unsigned long pmd; } pmd_t; |
177 | #ifdef CONFIG_PGTABLE_4 | ||
178 | typedef struct { unsigned long pud; } pud_t; | ||
179 | #endif | ||
177 | typedef struct { unsigned long pgd; } pgd_t; | 180 | typedef struct { unsigned long pgd; } pgd_t; |
178 | typedef struct { unsigned long pgprot; } pgprot_t; | 181 | typedef struct { unsigned long pgprot; } pgprot_t; |
179 | 182 | ||
180 | # define pte_val(x) ((x).pte) | 183 | # define pte_val(x) ((x).pte) |
181 | # define pmd_val(x) ((x).pmd) | 184 | # define pmd_val(x) ((x).pmd) |
185 | #ifdef CONFIG_PGTABLE_4 | ||
186 | # define pud_val(x) ((x).pud) | ||
187 | #endif | ||
182 | # define pgd_val(x) ((x).pgd) | 188 | # define pgd_val(x) ((x).pgd) |
183 | # define pgprot_val(x) ((x).pgprot) | 189 | # define pgprot_val(x) ((x).pgprot) |
184 | 190 | ||