MIPS part of fix for PR 6152, sligtly changed from M.Hitch's version
This commit is contained in:
parent
b10dbdb37a
commit
5e073f4807
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pmap.h,v 1.24 1999/01/18 02:11:07 castor Exp $ */
|
/* $NetBSD: pmap.h,v 1.25 1999/02/26 19:03:39 is Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1987 Carnegie-Mellon University
|
* Copyright (c) 1987 Carnegie-Mellon University
|
||||||
|
@ -123,6 +123,9 @@ void pmap_bootstrap __P((void));
|
||||||
|
|
||||||
void pmap_set_modified __P((paddr_t));
|
void pmap_set_modified __P((paddr_t));
|
||||||
|
|
||||||
|
void pmap_procwr __P((struct proc *, vaddr_t, size_t));
|
||||||
|
#define PMAP_NEED_PROCWR
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pmap_prefer() helps reduce virtual-coherency exceptions in
|
* pmap_prefer() helps reduce virtual-coherency exceptions in
|
||||||
* the virtually-indexed cache on mips3 CPUs.
|
* the virtually-indexed cache on mips3 CPUs.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pmap.c,v 1.50 1999/01/16 08:51:04 nisimura Exp $ */
|
/* $NetBSD: pmap.c,v 1.51 1999/02/26 19:03:40 is Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.50 1999/01/16 08:51:04 nisimura Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.51 1999/02/26 19:03:40 is Exp $");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Manages physical address maps.
|
* Manages physical address maps.
|
||||||
|
@ -1013,6 +1013,48 @@ pmap_protect(pmap, sva, eva, prot)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pmap_procwr(p, va, len)
|
||||||
|
struct proc *p;
|
||||||
|
vaddr_t va;
|
||||||
|
size_t len;
|
||||||
|
{
|
||||||
|
pmap_t pmap;
|
||||||
|
|
||||||
|
pmap = p->p_vmspace->vm_map.pmap;
|
||||||
|
|
||||||
|
if (CPUISMIPS3) {
|
||||||
|
#if 0
|
||||||
|
printf("pmap_procwr: va %lx len %lx\n", va, len);
|
||||||
|
#endif
|
||||||
|
mips3_FlushDCache(va, len);
|
||||||
|
mips3_FlushICache(MIPS_PHYS_TO_KSEG0(va &
|
||||||
|
(mips_L1ICacheSize - 1)), len);
|
||||||
|
} else {
|
||||||
|
pt_entry_t *pte;
|
||||||
|
unsigned entry;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
printf("pmap_procwr: va %lx", va);
|
||||||
|
#endif
|
||||||
|
if (!(pte = pmap_segmap(pmap, va)))
|
||||||
|
return;
|
||||||
|
pte += (va >> PGSHIFT) & (NPTEPG - 1);
|
||||||
|
entry = pte->pt_entry;
|
||||||
|
if (!mips_pg_v(entry))
|
||||||
|
return;
|
||||||
|
#if 0
|
||||||
|
printf(" flush %lx", pfn_to_vad(entry) + (va & PGOFSET));
|
||||||
|
#endif
|
||||||
|
mips1_FlushICache(MIPS_PHYS_TO_KSEG0(mips1_pfn_to_vad(entry)
|
||||||
|
+ (va & PGOFSET)),
|
||||||
|
len);
|
||||||
|
#if 0
|
||||||
|
printf("\n");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return RO protection of page.
|
* Return RO protection of page.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue