diff options
Diffstat (limited to 'arch/mips/mm/init.c')
| -rw-r--r-- | arch/mips/mm/init.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index e9951c0e689f..2d1c2c024822 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
| @@ -177,7 +177,7 @@ void *kmap_coherent(struct page *page, unsigned long addr) | |||
| 177 | 177 | ||
| 178 | #define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) | 178 | #define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) |
| 179 | 179 | ||
| 180 | void kunmap_coherent(struct page *page) | 180 | void kunmap_coherent(void) |
| 181 | { | 181 | { |
| 182 | #ifndef CONFIG_MIPS_MT_SMTC | 182 | #ifndef CONFIG_MIPS_MT_SMTC |
| 183 | unsigned int wired; | 183 | unsigned int wired; |
| @@ -210,7 +210,7 @@ void copy_user_highpage(struct page *to, struct page *from, | |||
| 210 | if (cpu_has_dc_aliases) { | 210 | if (cpu_has_dc_aliases) { |
| 211 | vfrom = kmap_coherent(from, vaddr); | 211 | vfrom = kmap_coherent(from, vaddr); |
| 212 | copy_page(vto, vfrom); | 212 | copy_page(vto, vfrom); |
| 213 | kunmap_coherent(from); | 213 | kunmap_coherent(); |
| 214 | } else { | 214 | } else { |
| 215 | vfrom = kmap_atomic(from, KM_USER0); | 215 | vfrom = kmap_atomic(from, KM_USER0); |
| 216 | copy_page(vto, vfrom); | 216 | copy_page(vto, vfrom); |
| @@ -233,7 +233,7 @@ void copy_to_user_page(struct vm_area_struct *vma, | |||
| 233 | if (cpu_has_dc_aliases) { | 233 | if (cpu_has_dc_aliases) { |
| 234 | void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | 234 | void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
| 235 | memcpy(vto, src, len); | 235 | memcpy(vto, src, len); |
| 236 | kunmap_coherent(page); | 236 | kunmap_coherent(); |
| 237 | } else | 237 | } else |
| 238 | memcpy(dst, src, len); | 238 | memcpy(dst, src, len); |
| 239 | if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) | 239 | if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) |
| @@ -250,7 +250,7 @@ void copy_from_user_page(struct vm_area_struct *vma, | |||
| 250 | void *vfrom = | 250 | void *vfrom = |
| 251 | kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | 251 | kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
| 252 | memcpy(dst, vfrom, len); | 252 | memcpy(dst, vfrom, len); |
| 253 | kunmap_coherent(page); | 253 | kunmap_coherent(); |
| 254 | } else | 254 | } else |
| 255 | memcpy(dst, src, len); | 255 | memcpy(dst, src, len); |
| 256 | } | 256 | } |
| @@ -351,18 +351,15 @@ void __init paging_init(void) | |||
| 351 | #endif | 351 | #endif |
| 352 | kmap_coherent_init(); | 352 | kmap_coherent_init(); |
| 353 | 353 | ||
| 354 | #ifdef CONFIG_ISA | 354 | #ifdef CONFIG_ZONE_DMA |
| 355 | if (max_low_pfn >= MAX_DMA_PFN) | 355 | if (min_low_pfn < MAX_DMA_PFN && MAX_DMA_PFN <= max_low_pfn) { |
| 356 | if (min_low_pfn >= MAX_DMA_PFN) { | 356 | zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn; |
| 357 | zones_size[ZONE_DMA] = 0; | 357 | zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN; |
| 358 | zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; | 358 | } else if (max_low_pfn < MAX_DMA_PFN) |
| 359 | } else { | 359 | zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn; |
| 360 | zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn; | ||
| 361 | zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN; | ||
| 362 | } | ||
| 363 | else | 360 | else |
| 364 | #endif | 361 | #endif |
| 365 | zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn; | 362 | zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn; |
| 366 | 363 | ||
| 367 | #ifdef CONFIG_HIGHMEM | 364 | #ifdef CONFIG_HIGHMEM |
| 368 | zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn; | 365 | zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn; |
