diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2006-03-27 04:15:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:47 -0500 |
commit | 0ecd702bcb924d5fb7f687e09986f688336ac896 (patch) | |
tree | 50b9caabc044fb9780cc2a794aabb9d3a7fbf029 /include/asm-ia64 | |
parent | 655a0443470a73d5dc36e974a241e8db59bb1ccb (diff) |
[PATCH] unify pfn_to_page: ia64 pfn_to_page
ia64 has special config CONFIG_VIRTUAL_MEM_MAP.
CONFIG_DISCONTIGMEM=y && CONFIG_VIRTUAL_MEM_MAP!=y is bug ?
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-ia64')
-rw-r--r-- | include/asm-ia64/page.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h index 6e9aa23250c4..2087825eefa4 100644 --- a/include/asm-ia64/page.h +++ b/include/asm-ia64/page.h | |||
@@ -106,17 +106,25 @@ extern int ia64_pfn_valid (unsigned long pfn); | |||
106 | # define ia64_pfn_valid(pfn) 1 | 106 | # define ia64_pfn_valid(pfn) 1 |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | #ifdef CONFIG_VIRTUAL_MEM_MAP | ||
110 | extern struct page *vmem_map; | ||
111 | #ifdef CONFIG_DISCONTIGMEM | ||
112 | # define page_to_pfn(page) ((unsigned long) (page - vmem_map)) | ||
113 | # define pfn_to_page(pfn) (vmem_map + (pfn)) | ||
114 | #endif | ||
115 | #endif | ||
116 | |||
117 | #if defined(CONFIG_FLATMEM) || defined(CONFIG_SPARSEMEM) | ||
118 | /* FLATMEM always configures mem_map (mem_map = vmem_map if necessary) */ | ||
119 | #include <asm-generic/memory_model.h> | ||
120 | #endif | ||
121 | |||
109 | #ifdef CONFIG_FLATMEM | 122 | #ifdef CONFIG_FLATMEM |
110 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) | 123 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn)) |
111 | # define page_to_pfn(page) ((unsigned long) (page - mem_map)) | ||
112 | # define pfn_to_page(pfn) (mem_map + (pfn)) | ||
113 | #elif defined(CONFIG_DISCONTIGMEM) | 124 | #elif defined(CONFIG_DISCONTIGMEM) |
114 | extern struct page *vmem_map; | ||
115 | extern unsigned long min_low_pfn; | 125 | extern unsigned long min_low_pfn; |
116 | extern unsigned long max_low_pfn; | 126 | extern unsigned long max_low_pfn; |
117 | # define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) | 127 | # define pfn_valid(pfn) (((pfn) >= min_low_pfn) && ((pfn) < max_low_pfn) && ia64_pfn_valid(pfn)) |
118 | # define page_to_pfn(page) ((unsigned long) (page - vmem_map)) | ||
119 | # define pfn_to_page(pfn) (vmem_map + (pfn)) | ||
120 | #endif | 128 | #endif |
121 | 129 | ||
122 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 130 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |