diff options
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 72a2b8cee319..c08710b1ff02 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -93,14 +93,7 @@ struct node_info { | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | #define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT) | 95 | #define O_PFN_DOWN(x) ((x) >> PAGE_SHIFT) |
96 | #define V_PFN_DOWN(x) O_PFN_DOWN(__pa(x)) | ||
97 | |||
98 | #define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT) | 96 | #define O_PFN_UP(x) (PAGE_ALIGN(x) >> PAGE_SHIFT) |
99 | #define V_PFN_UP(x) O_PFN_UP(__pa(x)) | ||
100 | |||
101 | #define PFN_SIZE(x) ((x) >> PAGE_SHIFT) | ||
102 | #define PFN_RANGE(s,e) PFN_SIZE(PAGE_ALIGN((unsigned long)(e)) - \ | ||
103 | (((unsigned long)(s)) & PAGE_MASK)) | ||
104 | 97 | ||
105 | /* | 98 | /* |
106 | * FIXME: We really want to avoid allocating the bootmap bitmap | 99 | * FIXME: We really want to avoid allocating the bootmap bitmap |
@@ -113,7 +106,7 @@ find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages) | |||
113 | { | 106 | { |
114 | unsigned int start_pfn, bank, bootmap_pfn; | 107 | unsigned int start_pfn, bank, bootmap_pfn; |
115 | 108 | ||
116 | start_pfn = V_PFN_UP(&_end); | 109 | start_pfn = O_PFN_UP(__pa(&_end)); |
117 | bootmap_pfn = 0; | 110 | bootmap_pfn = 0; |
118 | 111 | ||
119 | for (bank = 0; bank < mi->nr_banks; bank ++) { | 112 | for (bank = 0; bank < mi->nr_banks; bank ++) { |
@@ -122,9 +115,9 @@ find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages) | |||
122 | if (mi->bank[bank].node != node) | 115 | if (mi->bank[bank].node != node) |
123 | continue; | 116 | continue; |
124 | 117 | ||
125 | start = O_PFN_UP(mi->bank[bank].start); | 118 | start = mi->bank[bank].start >> PAGE_SHIFT; |
126 | end = O_PFN_DOWN(mi->bank[bank].size + | 119 | end = (mi->bank[bank].size + |
127 | mi->bank[bank].start); | 120 | mi->bank[bank].start) >> PAGE_SHIFT; |
128 | 121 | ||
129 | if (end < start_pfn) | 122 | if (end < start_pfn) |
130 | continue; | 123 | continue; |
@@ -191,8 +184,8 @@ find_memend_and_nodes(struct meminfo *mi, struct node_info *np) | |||
191 | /* | 184 | /* |
192 | * Get the start and end pfns for this bank | 185 | * Get the start and end pfns for this bank |
193 | */ | 186 | */ |
194 | start = O_PFN_UP(mi->bank[i].start); | 187 | start = mi->bank[i].start >> PAGE_SHIFT; |
195 | end = O_PFN_DOWN(mi->bank[i].start + mi->bank[i].size); | 188 | end = (mi->bank[i].start + mi->bank[i].size) >> PAGE_SHIFT; |
196 | 189 | ||
197 | if (np[node].start > start) | 190 | if (np[node].start > start) |
198 | np[node].start = start; | 191 | np[node].start = start; |