diff options
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index e5f6fc428348..49eaad9136a7 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -201,6 +201,20 @@ static void __init arm_bootmem_init(unsigned long start_pfn, | |||
201 | } | 201 | } |
202 | } | 202 | } |
203 | 203 | ||
204 | #ifdef CONFIG_ZONE_DMA | ||
205 | static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, | ||
206 | unsigned long dma_size) | ||
207 | { | ||
208 | if (size[0] <= dma_size) | ||
209 | return; | ||
210 | |||
211 | size[ZONE_NORMAL] = size[0] - dma_size; | ||
212 | size[ZONE_DMA] = dma_size; | ||
213 | hole[ZONE_NORMAL] = hole[0]; | ||
214 | hole[ZONE_DMA] = 0; | ||
215 | } | ||
216 | #endif | ||
217 | |||
204 | static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | 218 | static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, |
205 | unsigned long max_high) | 219 | unsigned long max_high) |
206 | { | 220 | { |
@@ -243,11 +257,18 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | |||
243 | #endif | 257 | #endif |
244 | } | 258 | } |
245 | 259 | ||
260 | #ifdef ARM_DMA_ZONE_SIZE | ||
261 | #ifndef CONFIG_ZONE_DMA | ||
262 | #error ARM_DMA_ZONE_SIZE set but no DMA zone to limit allocations | ||
263 | #endif | ||
264 | |||
246 | /* | 265 | /* |
247 | * Adjust the sizes according to any special requirements for | 266 | * Adjust the sizes according to any special requirements for |
248 | * this machine type. | 267 | * this machine type. |
249 | */ | 268 | */ |
250 | arch_adjust_zones(zone_size, zhole_size); | 269 | arm_adjust_dma_zone(zone_size, zhole_size, |
270 | ARM_DMA_ZONE_SIZE >> PAGE_SHIFT); | ||
271 | #endif | ||
251 | 272 | ||
252 | free_area_init_node(0, zone_size, min, zhole_size); | 273 | free_area_init_node(0, zone_size, min, zhole_size); |
253 | } | 274 | } |