diff options
author | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
commit | bac30d1a78d0f11c613968fc8b351a91ed465386 (patch) | |
tree | e52f3c876522a2f6047a6ec1c27df2e8a79486b8 /include/asm-alpha/mmzone.h | |
parent | e8222502ee6157e2713da9e0792c21f4ad458d50 (diff) | |
parent | ca9ba4471c1203bb6e759b76e83167fec54fe590 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'include/asm-alpha/mmzone.h')
-rw-r--r-- | include/asm-alpha/mmzone.h | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h index a011ef4cf3d3..192d80c875b0 100644 --- a/include/asm-alpha/mmzone.h +++ b/include/asm-alpha/mmzone.h | |||
@@ -59,9 +59,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n) | |||
59 | #define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr)) | 59 | #define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr)) |
60 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 60 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
61 | 61 | ||
62 | #define local_mapnr(kvaddr) \ | ||
63 | ((__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr))) | ||
64 | |||
65 | /* | 62 | /* |
66 | * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory | 63 | * Given a kaddr, LOCAL_BASE_ADDR finds the owning node of the memory |
67 | * and returns the kaddr corresponding to first physical page in the | 64 | * and returns the kaddr corresponding to first physical page in the |
@@ -86,8 +83,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n) | |||
86 | pte_t pte; \ | 83 | pte_t pte; \ |
87 | unsigned long pfn; \ | 84 | unsigned long pfn; \ |
88 | \ | 85 | \ |
89 | pfn = ((unsigned long)((page)-page_zone(page)->zone_mem_map)) << 32; \ | 86 | pfn = page_to_pfn(page) << 32; \ |
90 | pfn += page_zone(page)->zone_start_pfn << 32; \ | ||
91 | pte_val(pte) = pfn | pgprot_val(pgprot); \ | 87 | pte_val(pte) = pfn | pgprot_val(pgprot); \ |
92 | \ | 88 | \ |
93 | pte; \ | 89 | pte; \ |
@@ -104,19 +100,8 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n) | |||
104 | __xx; \ | 100 | __xx; \ |
105 | }) | 101 | }) |
106 | 102 | ||
107 | #define pfn_to_page(pfn) \ | ||
108 | ({ \ | ||
109 | unsigned long kaddr = (unsigned long)__va((pfn) << PAGE_SHIFT); \ | ||
110 | (NODE_DATA(kvaddr_to_nid(kaddr))->node_mem_map + local_mapnr(kaddr)); \ | ||
111 | }) | ||
112 | |||
113 | #define page_to_pfn(page) \ | ||
114 | ((page) - page_zone(page)->zone_mem_map + \ | ||
115 | (page_zone(page)->zone_start_pfn)) | ||
116 | |||
117 | #define page_to_pa(page) \ | 103 | #define page_to_pa(page) \ |
118 | ((( (page) - page_zone(page)->zone_mem_map ) \ | 104 | (page_to_pfn(page) << PAGE_SHIFT) |
119 | + page_zone(page)->zone_start_pfn) << PAGE_SHIFT) | ||
120 | 105 | ||
121 | #define pfn_to_nid(pfn) pa_to_nid(((u64)(pfn) << PAGE_SHIFT)) | 106 | #define pfn_to_nid(pfn) pa_to_nid(((u64)(pfn) << PAGE_SHIFT)) |
122 | #define pfn_valid(pfn) \ | 107 | #define pfn_valid(pfn) \ |