MVME68K specific part of fix for PR 6152

This commit is contained in:
is 1999-02-26 22:16:35 +00:00
parent 22001aee9c
commit 8474ed8a1e
5 changed files with 37 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.10 1999/02/20 00:12:02 scw Exp $ */
/* $NetBSD: cpu.h,v 1.11 1999/02/26 22:16:35 is Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -191,7 +191,7 @@ void child_return __P((void *));
void myetheraddr __P((u_char *));
/* Prototypes from sys_machdep.c: */
int cachectl __P((int, caddr_t, int));
int cachectl1 __P((unsigned long, vaddr_t, size_t, struct proc *));
int dma_cachectl __P((caddr_t, int));
/* physical memory sections for mvme147 */

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.13 1999/01/16 20:32:59 chuck Exp $ */
/* $NetBSD: pmap.h,v 1.14 1999/02/26 22:16:36 is Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@ -148,6 +148,8 @@ extern pt_entry_t *Sysmap;
extern char *vmmap; /* map for mem, dumps, etc. */
vaddr_t pmap_map __P((vaddr_t, paddr_t, paddr_t, int));
void pmap_procwr __P((struct proc *, vaddr_t, size_t));
#define PMAP_NEED_PROCWR
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.45 1999/02/20 00:12:02 scw Exp $ */
/* $NetBSD: locore.s,v 1.46 1999/02/26 22:16:36 is Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -895,11 +895,12 @@ Ltrap1:
* command in d0, addr in a1, length in d1
*/
ENTRY_NOPROFILE(trap12)
movl _C_LABEL(cachectl),sp@- | push curproc pointer
movl d1,sp@- | push length
movl a1,sp@- | push addr
movl d0,sp@- | push command
jbsr _C_LABEL(cachectl) | do it
lea sp@(12),sp | pop args
jbsr _C_LABEL(cachectl1) | do it
lea sp@(16),sp | pop args
jra _ASM_LABEL(rei) | all done
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.25 1999/02/14 17:54:29 scw Exp $ */
/* $NetBSD: pmap.c,v 1.26 1999/02/26 22:16:36 is Exp $ */
/*
* Copyright (c) 1991, 1993
@ -2526,6 +2526,22 @@ pmap_enter_ptpage(pmap, va)
splx(s);
}
/*
* Routine: pmap_procwr
*
* Function:
* Synchronize caches corresponding to [addr, addr+len) in p.
*/
void
pmap_procwr(p, va, len)
struct proc *p;
vaddr_t va;
size_t len;
{
(void)cachectl1(0x80000004, va, len, p);
}
#ifdef DEBUG
/*
* pmap_pvdump:

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_machdep.c,v 1.15 1999/02/20 00:12:03 scw Exp $ */
/* $NetBSD: sys_machdep.c,v 1.16 1999/02/26 22:16:36 is Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -133,10 +133,11 @@ vdoualarm(arg)
*/
/*ARGSUSED1*/
int
cachectl(req, addr, len)
int req;
caddr_t addr;
cachectl1(req, addr, len, p)
unsigned long req;
vaddr_t addr;
int len;
struct proc *p;
{
int error = 0;
@ -145,11 +146,11 @@ cachectl(req, addr, len)
int inc = 0;
int doall = 0;
paddr_t pa = 0;
caddr_t end = 0;
vaddr_t end = 0;
#ifdef COMPAT_HPUX
extern struct emul emul_hpux;
if ((curproc->p_emul == &emul_hpux) &&
if ((p->p_emul == &emul_hpux) &&
len != 16 && len != NBPG)
doall = 1;
#endif
@ -161,10 +162,10 @@ cachectl(req, addr, len)
if (!doall) {
end = addr + len;
if (len <= 1024) {
addr = (caddr_t)((int)addr & ~0xF);
addr = addr & ~0xF;
inc = 16;
} else {
addr = (caddr_t)((int)addr & ~PGOFSET);
addr = addr & ~PGOFSET;
inc = NBPG;
}
}
@ -176,8 +177,8 @@ cachectl(req, addr, len)
*/
if (!doall &&
(pa == 0 || ((int)addr & PGOFSET) == 0)) {
pa = pmap_extract(curproc->p_vmspace->vm_map.pmap,
(vaddr_t)addr);
pa = pmap_extract(p->p_vmspace->vm_map.pmap,
addr);
if (pa == 0)
doall = 1;
}