summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-01-28 16:38:49 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-01-28 16:38:49 +0000
commitdc5a9da956d163529955fb06761571452b712da4 (patch)
tree094c1939aad6af073e58d765f29aa5ec1cc6190f /sys
parent55b8488cba75efc02fbf27894891e6597496e36b (diff)
optimize m68k writeback():
- it can really only be invoked from trap(), not from other userret() callers, so it is safe to hardcode its docachepush parameter to 1. - use pmap_kenter_pa()/pmap_kremove() for the temporary mapping instead of pmap_enter()/pmap_remove(). optimize m68k userret(): - define PROC_PC for m68k systems. - only check want_resched when processing T_ASTFLT traps. - provide two version of userret(), one which will also invoke writeback() on 68040 if required, which is only invoked from trap(), and regular userret(). This speeds up system call returns.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hp300/hp300/trap.c112
-rw-r--r--sys/arch/m68k/include/cpu.h9
-rw-r--r--sys/arch/m68k/m68k/m68k_machdep.c4
-rw-r--r--sys/arch/mac68k/mac68k/trap.c118
-rw-r--r--sys/arch/mvme68k/mvme68k/trap.c122
5 files changed, 154 insertions, 211 deletions
diff --git a/sys/arch/hp300/hp300/trap.c b/sys/arch/hp300/hp300/trap.c
index 3808d7f44f6..0a8d3b895ae 100644
--- a/sys/arch/hp300/hp300/trap.c
+++ b/sys/arch/hp300/hp300/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.48 2005/11/12 23:14:00 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.49 2007/01/28 16:38:45 miod Exp $ */
/* $NetBSD: trap.c,v 1.57 1998/02/16 20:58:31 thorpej Exp $ */
/*
@@ -103,9 +103,10 @@ extern struct emul emul_hpux;
extern struct emul emul_sunos;
#endif
-int writeback(struct frame *fp, int docachepush);
+int writeback(struct frame *);
void trap(int type, u_int code, u_int v, struct frame frame);
void syscall(register_t code, struct frame frame);
+void wb_userret(struct proc *, struct frame *);
#ifdef DEBUG
void dumpssw(u_short);
@@ -195,44 +196,32 @@ int mmupid = -1;
* to user mode.
*/
void
-userret(p, fp, oticks, faultaddr, fromtrap)
- struct proc *p;
- struct frame *fp;
- u_quad_t oticks;
- u_int faultaddr;
- int fromtrap;
+userret(struct proc *p)
{
int sig;
+
+ /* take pending signals */
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ curpriority = p->p_priority = p->p_usrpri;
+}
+
#ifdef M68040
+/*
+ * Same as above, but also handles writeback completion on 68040.
+ */
+void
+wb_userret(struct proc *p, struct frame *fp)
+{
+ int sig;
union sigval sv;
- int beenhere = 0;
-again:
-#endif
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
p->p_priority = p->p_usrpri;
- if (want_resched) {
- /*
- * We're being preempted.
- */
- preempt(NULL);
- while ((sig = CURSIG(p)) != 0)
- postsig(sig);
- }
/*
- * If profiling, charge system time to the trapped pc.
- */
- if (p->p_flag & P_PROFIL) {
- extern int psratio;
-
- addupc_task(p, fp->f_pc,
- (int)(p->p_sticks - oticks) * psratio);
- }
-#ifdef M68040
- /*
* Deal with user mode writebacks (from trap, or from sigreturn).
* If any writeback fails, go back and attempt signal delivery.
* unless we have already been here and attempted the writeback
@@ -241,25 +230,18 @@ again:
* the writebacks. Maybe we should just drop the sucker?
*/
if (cputype == CPU_68040 && fp->f_format == FMT7) {
- if (beenhere) {
-#ifdef DEBUG
- if (mmudebug & MDB_WBFAILED)
- printf(fromtrap ?
- "pid %d(%s): writeback aborted, pc=%x, fa=%x\n" :
- "pid %d(%s): writeback aborted in sigreturn, pc=%x\n",
- p->p_pid, p->p_comm, fp->f_pc, faultaddr);
-#endif
- } else if ((sig = writeback(fp, fromtrap))) {
- beenhere = 1;
- oticks = p->p_sticks;
- sv.sival_ptr = (caddr_t)faultaddr;
+ if ((sig = writeback(fp)) != 0) {
+ sv.sival_ptr = (caddr_t)fp->f_fmt7.f_fa;
trapsignal(p, sig, T_MMUFLT, SEGV_MAPERR, sv);
- goto again;
+
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ p->p_priority = p->p_usrpri;
}
}
-#endif
curpriority = p->p_priority;
}
+#endif
/*
* Trap is called from locore to handle most types of processor traps,
@@ -577,6 +559,9 @@ dopanic:
p->p_flag &= ~P_OWEUPC;
ADDUPROF(p);
}
+ if (type == (T_ASTFLT | T_USER) && want_resched) {
+ preempt(NULL);
+ }
goto out;
case T_MMUFLT: /* kernel mode page fault */
@@ -661,7 +646,7 @@ dopanic:
if (type == T_MMUFLT) {
#ifdef M68040
if (cputype == CPU_68040)
- (void) writeback(&frame, 1);
+ (void)writeback(&frame);
#endif
return;
}
@@ -688,7 +673,11 @@ dopanic:
out:
if ((type & T_USER) == 0)
return;
- userret(p, &frame, sticks, v, 1);
+#ifdef M68040
+ wb_userret(p, &frame);
+#else
+ userret(p);
+#endif
}
#ifdef M68040
@@ -710,14 +699,13 @@ char wberrstr[] =
#endif
int
-writeback(fp, docachepush)
- struct frame *fp;
- int docachepush;
+writeback(struct frame *fp)
{
struct fmt7 *f = &fp->f_fmt7;
struct proc *p = curproc;
int err = 0;
u_int fa;
+ paddr_t pa;
caddr_t oonfault = p->p_addr->u_pcb.pcb_onfault;
#ifdef DEBUG
@@ -754,23 +742,15 @@ writeback(fp, docachepush)
* XXX there are security problems if we attempt to do a
* cache push after a signal handler has been called.
*/
- if (docachepush) {
- paddr_t pa;
-
- pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
- trunc_page((vaddr_t)f->f_fa), VM_PROT_WRITE,
- VM_PROT_WRITE|PMAP_WIRED);
- pmap_update(pmap_kernel());
- fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0xF];
- bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
- pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
- DCFL(pa);
- pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
- (vaddr_t)&vmmap[NBPG]);
- pmap_update(pmap_kernel());
- } else
- printf("WARNING: pid %d(%s) uid %u: CPUSH not done\n",
- p->p_pid, p->p_comm, p->p_ucred->cr_uid);
+ pmap_kenter_pa((vaddr_t)vmmap,
+ trunc_page((vaddr_t)f->f_fa), VM_PROT_WRITE);
+ pmap_update(pmap_kernel());
+ fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0x000f];
+ bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
+ pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
+ DCFL(pa);
+ pmap_kremove((vaddr_t)vmmap, PAGE_SIZE);
+ pmap_update(pmap_kernel());
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.
@@ -1182,7 +1162,7 @@ bad:
if (error == ERESTART && (p->p_md.md_flags & MDP_STACKADJ))
frame.f_regs[SP] -= sizeof (int);
#endif
- userret(p, &frame, sticks, 0, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
ktrsysret(p, code, error, rval[0]);
diff --git a/sys/arch/m68k/include/cpu.h b/sys/arch/m68k/include/cpu.h
index 47040a8ce39..c390a862c4f 100644
--- a/sys/arch/m68k/include/cpu.h
+++ b/sys/arch/m68k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.14 2006/11/29 13:22:07 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.15 2007/01/28 16:38:47 miod Exp $ */
/* $NetBSD: cpu.h,v 1.3 1997/02/02 06:56:57 thorpej Exp $ */
/*
@@ -230,7 +230,7 @@ int suline(caddr_t, caddr_t);
void switch_exit(struct proc *);
/* m68k_machdep.c */
-void userret(struct proc *, struct frame *, u_quad_t, u_int, int);
+void userret(struct proc *);
/* regdump.c */
void regdump(struct trapframe *, int);
@@ -242,6 +242,11 @@ int cachectl(struct proc *, int, vaddr_t, int);
#define CC_IPURGE 0x00000004
#define CC_EXTPURGE 0x80000000
+/*
+ * This is used during profiling to integrate system time.
+ */
+#define PROC_PC(p) (((struct trapframe *)((p)->p_md.md_regs))->tf_pc)
+
#endif /* _KERNEL */
#endif /* _M68K_CPU_H_ */
diff --git a/sys/arch/m68k/m68k/m68k_machdep.c b/sys/arch/m68k/m68k/m68k_machdep.c
index 1b064a7cf5b..52917dabb11 100644
--- a/sys/arch/m68k/m68k/m68k_machdep.c
+++ b/sys/arch/m68k/m68k/m68k_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m68k_machdep.c,v 1.8 2006/04/16 22:36:44 miod Exp $ */
+/* $OpenBSD: m68k_machdep.c,v 1.9 2007/01/28 16:38:47 miod Exp $ */
/* $NetBSD: m68k_machdep.c,v 1.3 1997/06/12 09:57:04 veego Exp $ */
/*-
@@ -103,7 +103,7 @@ child_return(arg)
f->f_sr &= ~PSL_C; /* carry bit */
f->f_format = FMT0;
- userret(p, f, p->p_sticks, 0, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
ktrsysret(p,
diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c
index 4f8ae17d1de..7d14554196b 100644
--- a/sys/arch/mac68k/mac68k/trap.c
+++ b/sys/arch/mac68k/mac68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.50 2006/01/30 21:26:17 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.51 2007/01/28 16:38:48 miod Exp $ */
/* $NetBSD: trap.c,v 1.68 1998/12/22 08:47:07 scottr Exp $ */
/*
@@ -142,7 +142,8 @@ void trap(int, u_int, u_int, struct frame);
void syscall(register_t, struct frame);
#if defined(M68040)
-static int writeback(struct frame *, int);
+int writeback(struct frame *);
+void wb_userret(struct proc *, struct frame *);
#if DEBUG
static void dumpssw(u_short);
static void dumpwb(int, u_short, u_int, u_int);
@@ -154,46 +155,32 @@ static void dumpwb(int, u_short, u_int, u_int);
* to user mode.
*/
void
-userret(p, fp, oticks, faultaddr, fromtrap)
- struct proc *p;
- struct frame *fp;
- u_quad_t oticks;
- u_int faultaddr;
- int fromtrap;
+userret(struct proc *p)
{
int sig;
-#if defined(M68040)
- int beenhere = 0;
- union sigval sv;
-again:
-#endif
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
+ curpriority = p->p_priority = p->p_usrpri;
+}
- p->p_priority = p->p_usrpri;
+#ifdef M68040
+/*
+ * Same as above, but also handles writeback completion on 68040.
+ */
+void
+wb_userret(struct proc *p, struct frame *fp)
+{
+ int sig;
+ union sigval sv;
- if (want_resched) {
- /*
- * We're being preempted.
- */
- preempt(NULL);
- while ((sig = CURSIG(p)) != 0)
- postsig(sig);
- }
+ /* take pending signals */
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ p->p_priority = p->p_usrpri;
/*
- * If profiling, charge recent system time.
- */
- if (p->p_flag & P_PROFIL) {
- extern int psratio;
-
- addupc_task(p, fp->f_pc,
- (int)(p->p_sticks - oticks) * psratio);
- }
-#if defined(M68040)
- /*
* Deal with user mode writebacks (from trap, or from sigreturn).
* If any writeback fails, go back and attempt signal delivery
* unless we have already been here and attempted the writeback
@@ -202,25 +189,18 @@ again:
* the writebacks. Maybe we should just drop the sucker?
*/
if (mmutype == MMU_68040 && fp->f_format == FMT7) {
- if (beenhere) {
-#if DEBUG
- if (mmudebug & MDB_WBFAILED)
- printf(fromtrap ?
- "pid %d(%s): writeback aborted, pc=%x, fa=%x\n" :
- "pid %d(%s): writeback aborted in sigreturn, pc=%x\n",
- p->p_pid, p->p_comm, fp->f_pc, faultaddr);
-#endif
- } else if ((sig = writeback(fp, fromtrap))) {
- beenhere = 1;
- oticks = p->p_sticks;
- sv.sival_ptr = (void *)faultaddr;
- trapsignal(p, sig, VM_PROT_WRITE, SEGV_MAPERR, sv);
- goto again;
+ if ((sig = writeback(fp)) != 0) {
+ sv.sival_ptr = (void *)fp->f_fmt7.f_fa;
+ trapsignal(p, sig, T_MMUFLT, SEGV_MAPERR, sv);
+
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ p->p_priority = p->p_usrpri;
}
}
-#endif
curpriority = p->p_priority;
}
+#endif
/*
* Trap is called from locore to handle most types of processor traps,
@@ -534,6 +514,9 @@ copyfault:
p->p_flag &= ~P_OWEUPC;
ADDUPROF(p);
}
+ if (type == (T_ASTFLT | T_USER) && want_resched) {
+ preempt(NULL);
+ }
goto out;
case T_MMUFLT: /* Kernel mode page fault */
@@ -603,7 +586,7 @@ copyfault:
if (type == T_MMUFLT) {
#if defined(M68040)
if (mmutype == MMU_68040)
- (void)writeback(&frame, 1);
+ (void)writeback(&frame);
#endif
return;
}
@@ -630,7 +613,11 @@ copyfault:
out:
if ((type & T_USER) == 0)
return;
- userret(p, &frame, sticks, v, 1);
+#ifdef M68040
+ wb_userret(p, &frame);
+#else
+ userret(p);
+#endif
}
#if defined(M68040)
@@ -652,14 +639,13 @@ char wberrstr[] =
#endif
int
-writeback(fp, docachepush)
- struct frame *fp;
- int docachepush;
+writeback(struct frame *fp)
{
struct fmt7 *f = &fp->f_fmt7;
struct proc *p = curproc;
int err = 0;
u_int fa;
+ paddr_t pa;
caddr_t oonfault = p->p_addr->u_pcb.pcb_onfault;
#ifdef DEBUG
@@ -696,23 +682,15 @@ writeback(fp, docachepush)
* XXX there are security problems if we attempt to do a
* cache push after a signal handler has been called.
*/
- if (docachepush) {
- paddr_t pa;
-
- pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
- trunc_page((vaddr_t)f->f_fa), VM_PROT_WRITE,
- VM_PROT_WRITE|PMAP_WIRED);
- pmap_update(pmap_kernel());
- fa = (u_int)&vmmap[m68k_page_offset(f->f_fa) & ~0xF];
- bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
- pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
- DCFL(pa);
- pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
- (vaddr_t)&vmmap[NBPG]);
- pmap_update(pmap_kernel());
- } else
- printf("WARNING: pid %d(%s) uid %u: CPUSH not done\n",
- p->p_pid, p->p_comm, p->p_ucred->cr_uid);
+ pmap_kenter_pa((vaddr_t)vmmap,
+ trunc_page((vaddr_t)f->f_fa), VM_PROT_WRITE);
+ pmap_update(pmap_kernel());
+ fa = (u_int)&vmmap[m68k_page_offset(f->f_fa) & ~0x000f];
+ bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
+ pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
+ DCFL(pa);
+ pmap_kremove((vaddr_t)vmmap, PAGE_SIZE);
+ pmap_update(pmap_kernel());
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.
@@ -1124,7 +1102,7 @@ bad:
if (error == ERESTART && (p->p_md.md_flags & MDP_STACKADJ))
frame.f_regs[SP] -= sizeof (int);
#endif
- userret(p, &frame, sticks, 0, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
ktrsysret(p, code, error, rval[0]);
diff --git a/sys/arch/mvme68k/mvme68k/trap.c b/sys/arch/mvme68k/mvme68k/trap.c
index 84210a63acd..cb72380c5a2 100644
--- a/sys/arch/mvme68k/mvme68k/trap.c
+++ b/sys/arch/mvme68k/mvme68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.63 2006/06/11 20:46:50 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.64 2007/01/28 16:38:48 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -167,49 +167,39 @@ void trap(int, u_int, u_int, struct frame);
void syscall(register_t, struct frame);
void init_intrs(void);
void hardintr(int, int, void *);
-int writeback(struct frame *fp, int docachepush);
+int writeback(struct frame *);
+void wb_userret(struct proc *, struct frame *);
/*
* trap and syscall both need the following work done before returning
* to user mode.
*/
void
-userret(p, fp, oticks, faultaddr, fromtrap)
- register struct proc *p;
- register struct frame *fp;
- u_quad_t oticks;
- u_int faultaddr;
- int fromtrap;
+userret(struct proc *p)
{
int sig;
-#if defined(M68040)
- int beenhere = 0;
-again:
-#endif
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
- p->p_priority = p->p_usrpri;
- if (want_resched) {
- /*
- * We're being preempted.
- */
- preempt(NULL);
- while ((sig = CURSIG(p)) != 0)
- postsig(sig);
- }
+ curpriority = p->p_priority = p->p_usrpri;
+}
- /*
- * If profiling, charge system time to the trapped pc.
- */
- if (p->p_flag & P_PROFIL) {
- extern int psratio;
+#ifdef M68040
+/*
+ * Same as above, but also handles writeback completion on 68040.
+ */
+void
+wb_userret(struct proc *p, struct frame *fp)
+{
+ int sig;
+ union sigval sv;
+
+ /* take pending signals */
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ p->p_priority = p->p_usrpri;
- addupc_task(p, fp->f_pc,
- (int)(p->p_sticks - oticks) * psratio);
- }
-#if defined(M68040)
/*
* Deal with user mode writebacks (from trap, or from sigreturn).
* If any writeback fails, go back and attempt signal delivery.
@@ -219,27 +209,18 @@ again:
* the writebacks. Maybe we should just drop the sucker?
*/
if (mmutype == MMU_68040 && fp->f_format == FMT7) {
- if (beenhere) {
-#ifdef DEBUG
- if (mmudebug & MDB_WBFAILED)
- printf(fromtrap ?
- "pid %d(%s): writeback aborted, pc=%x, fa=%x\n" :
- "pid %d(%s): writeback aborted in sigreturn, pc=%x\n",
- p->p_pid, p->p_comm, fp->f_pc, faultaddr);
-#endif
- } else if ((sig = writeback(fp, fromtrap))) {
- register union sigval sv;
-
- beenhere = 1;
- oticks = p->p_sticks;
- sv.sival_int = faultaddr;
- trapsignal(p, sig, VM_PROT_WRITE, SEGV_MAPERR, sv);
- goto again;
+ if ((sig = writeback(fp)) != 0) {
+ sv.sival_int = fp->f_fmt7.f_fa;
+ trapsignal(p, sig, T_MMUFLT, SEGV_MAPERR, sv);
+
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
+ p->p_priority = p->p_usrpri;
}
}
-#endif
curpriority = p->p_priority;
}
+#endif
/*
* Trap is called from locore to handle most types of processor traps,
@@ -513,6 +494,9 @@ copyfault:
p->p_flag &= ~P_OWEUPC;
ADDUPROF(p);
}
+ if (type == (T_ASTFLT | T_USER) && want_resched) {
+ preempt(NULL);
+ }
goto out;
case T_MMUFLT: /* kernel mode page fault */
@@ -595,7 +579,7 @@ copyfault:
if (type == T_MMUFLT) {
#if defined(M68040)
if (mmutype == MMU_68040)
- (void) writeback(&frame, 1);
+ (void)writeback(&frame);
#endif
return;
}
@@ -622,7 +606,11 @@ copyfault:
out:
if ((type & T_USER) == 0)
return;
- userret(p, &frame, sticks, v, 1);
+#ifdef M68040
+ wb_userret(p, &frame);
+#else
+ userret(p);
+#endif
}
#if defined(M68040)
@@ -644,14 +632,13 @@ char wberrstr[] =
#endif
int
-writeback(fp, docachepush)
- struct frame *fp;
- int docachepush;
+writeback(struct frame *fp)
{
- register struct fmt7 *f = &fp->f_fmt7;
- register struct proc *p = curproc;
+ struct fmt7 *f = &fp->f_fmt7;
+ struct proc *p = curproc;
int err = 0;
u_int fa;
+ paddr_t pa;
caddr_t oonfault = p->p_addr->u_pcb.pcb_onfault;
#ifdef DEBUG
@@ -688,22 +675,15 @@ writeback(fp, docachepush)
* XXX there are security problems if we attempt to do a
* cache push after a signal handler has been called.
*/
- if (docachepush) {
- paddr_t pa;
-
- pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
- trunc_page(f->f_fa), VM_PROT_WRITE, VM_PROT_WRITE|PMAP_WIRED);
- pmap_update(pmap_kernel());
- fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0xF];
- bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
- pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
- DCFL(pa);
- pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
- (vaddr_t)&vmmap[NBPG]);
- pmap_update(pmap_kernel());
- } else
- printf("WARNING: pid %d(%s) uid %u: CPUSH not done\n",
- p->p_pid, p->p_comm, p->p_ucred->cr_uid);
+ pmap_kenter_pa((vaddr_t)vmmap,
+ trunc_page(f->f_fa), VM_PROT_WRITE);
+ pmap_update(pmap_kernel());
+ fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0x000f];
+ bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
+ pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
+ DCFL(pa);
+ pmap_kremove((vaddr_t)vmmap, PAGE_SIZE);
+ pmap_update(pmap_kernel());
} else if ((f->f_ssw & (SSW4_RW|SSW4_TTMASK)) == SSW4_TTM16) {
/*
* MOVE16 fault.
@@ -1118,7 +1098,7 @@ bad:
if (error == ERESTART && (p->p_md.md_flags & MDP_STACKADJ))
frame.f_regs[SP] -= sizeof (int);
#endif
- userret(p, &frame, sticks, 0, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
ktrsysret(p, code, error, rval[0]);