diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2006-03-27 04:15:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:44 -0500 |
commit | dc8ecb43701a78bd3c38e7fed1d1c76840579450 (patch) | |
tree | 4e9056ec8a86fc321384da15ba7a05bfda32e034 /include | |
parent | ad658b385e6308066f9084a7ea01305b223cd3a0 (diff) |
[PATCH] unify pfn_to_page: x86_64 pfn_to_page
x86_64 can use generic funcs.
For DISCONTIGMEM, CONFIG_OUT_OF_LINE_PFN_TO_PAGE is selected.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86_64/mmzone.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/page.h | 3 |
2 files changed, 1 insertions, 6 deletions
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 937f99b26883..6b18cd8f293d 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -44,12 +44,8 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | |||
44 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) | 44 | #define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT) |
45 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) | 45 | #define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr)) |
46 | 46 | ||
47 | extern struct page *pfn_to_page(unsigned long pfn); | ||
48 | extern unsigned long page_to_pfn(struct page *page); | ||
49 | extern int pfn_valid(unsigned long pfn); | 47 | extern int pfn_valid(unsigned long pfn); |
50 | #endif | 48 | #endif |
51 | 49 | ||
52 | #define local_mapnr(kvaddr) \ | ||
53 | ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ) | ||
54 | #endif | 50 | #endif |
55 | #endif | 51 | #endif |
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index 615e3e494929..408185bac351 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h | |||
@@ -123,8 +123,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
123 | #define __boot_va(x) __va(x) | 123 | #define __boot_va(x) __va(x) |
124 | #define __boot_pa(x) __pa(x) | 124 | #define __boot_pa(x) __pa(x) |
125 | #ifdef CONFIG_FLATMEM | 125 | #ifdef CONFIG_FLATMEM |
126 | #define pfn_to_page(pfn) (mem_map + (pfn)) | ||
127 | #define page_to_pfn(page) ((unsigned long)((page) - mem_map)) | ||
128 | #define pfn_valid(pfn) ((pfn) < end_pfn) | 126 | #define pfn_valid(pfn) ((pfn) < end_pfn) |
129 | #endif | 127 | #endif |
130 | 128 | ||
@@ -140,6 +138,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
140 | 138 | ||
141 | #endif /* __KERNEL__ */ | 139 | #endif /* __KERNEL__ */ |
142 | 140 | ||
141 | #include <asm-generic/memory_model.h> | ||
143 | #include <asm-generic/page.h> | 142 | #include <asm-generic/page.h> |
144 | 143 | ||
145 | #endif /* _X86_64_PAGE_H */ | 144 | #endif /* _X86_64_PAGE_H */ |