aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/init.c')
-rw-r--r--arch/mips/mm/init.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index b8cb0dde3af0..5240432e6d1d 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -8,6 +8,7 @@
8 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com 8 * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
9 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. 9 * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
10 */ 10 */
11#include <linux/bug.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/module.h> 13#include <linux/module.h>
13#include <linux/signal.h> 14#include <linux/signal.h>
@@ -26,6 +27,7 @@
26#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
27#include <linux/pfn.h> 28#include <linux/pfn.h>
28 29
30#include <asm/asm-offsets.h>
29#include <asm/bootinfo.h> 31#include <asm/bootinfo.h>
30#include <asm/cachectl.h> 32#include <asm/cachectl.h>
31#include <asm/cpu.h> 33#include <asm/cpu.h>
@@ -131,6 +133,8 @@ void *kmap_coherent(struct page *page, unsigned long addr)
131 pte_t pte; 133 pte_t pte;
132 int tlbidx; 134 int tlbidx;
133 135
136 BUG_ON(Page_dcache_dirty(page));
137
134 inc_preempt_count(); 138 inc_preempt_count();
135 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1); 139 idx = (addr >> PAGE_SHIFT) & (FIX_N_COLOURS - 1);
136#ifdef CONFIG_MIPS_MT_SMTC 140#ifdef CONFIG_MIPS_MT_SMTC
@@ -207,7 +211,7 @@ void copy_user_highpage(struct page *to, struct page *from,
207 void *vfrom, *vto; 211 void *vfrom, *vto;
208 212
209 vto = kmap_atomic(to, KM_USER1); 213 vto = kmap_atomic(to, KM_USER1);
210 if (cpu_has_dc_aliases) { 214 if (cpu_has_dc_aliases && !Page_dcache_dirty(from)) {
211 vfrom = kmap_coherent(from, vaddr); 215 vfrom = kmap_coherent(from, vaddr);
212 copy_page(vto, vfrom); 216 copy_page(vto, vfrom);
213 kunmap_coherent(); 217 kunmap_coherent();
@@ -498,7 +502,13 @@ unsigned long pgd_current[NR_CPUS];
498 * different layout ... 502 * different layout ...
499 */ 503 */
500#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order))) 504#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order)))
501pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); 505
506/*
507 * gcc 3.3 and older have trouble determining that PTRS_PER_PGD and PGD_ORDER
508 * are constants. So we use the variants from asm-offset.h until that gcc
509 * will officially be retired.
510 */
511pgd_t swapper_pg_dir[_PTRS_PER_PGD] __page_aligned(_PGD_ORDER);
502#ifdef CONFIG_64BIT 512#ifdef CONFIG_64BIT
503#ifdef MODULE_START 513#ifdef MODULE_START
504pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER); 514pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);