Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/sparc64 Cleanup trapstate handling and garb...
details: https://anonhg.NetBSD.org/src/rev/f70288d53f9d
branches: trunk
changeset: 495589:f70288d53f9d
user: eeh <eeh%NetBSD.org@localhost>
date: Tue Aug 01 00:36:05 2000 +0000
description:
Cleanup trapstate handling and garbage collect old stuff.
diffstat:
sys/arch/sparc64/sparc64/vm_machdep.c | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
diffs (53 lines):
diff -r 9ad2d4bf6185 -r f70288d53f9d sys/arch/sparc64/sparc64/vm_machdep.c
--- a/sys/arch/sparc64/sparc64/vm_machdep.c Tue Aug 01 00:34:13 2000 +0000
+++ b/sys/arch/sparc64/sparc64/vm_machdep.c Tue Aug 01 00:36:05 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.29 2000/06/29 07:38:01 mrg Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.30 2000/08/01 00:36:05 eeh Exp $ */
/*
* Copyright (c) 1996
@@ -233,10 +233,11 @@
void (*func) __P((void *));
void *arg;
{
- register struct pcb *opcb = &p1->p_addr->u_pcb;
- register struct pcb *npcb = &p2->p_addr->u_pcb;
- register struct trapframe *tf2;
- register struct rwindow *rp;
+ struct pcb *opcb = &p1->p_addr->u_pcb;
+ struct pcb *npcb = &p2->p_addr->u_pcb;
+ struct trapframe *tf2;
+ struct rwindow *rp;
+ extern struct proc proc0;
/*
* Save all user registers to p1's stack or, in the case of
@@ -254,15 +255,6 @@
#endif
if (p1 == curproc) {
write_user_windows();
-#if 0
- /* Make sure our D$ is not polluted w/bad data */
- blast_vcache();
- /*
- * We should not need to copy this out cause we should be
- * able to directly reload our windows from the pcb.
- */
- rwindow_save(p1);
-#endif
/*
* We're in the kernel, so we don't really care about
@@ -332,6 +324,11 @@
npcb->pcb_pc = (long)proc_trampoline - 8;
npcb->pcb_sp = (long)rp - STACK_OFFSET;
+ /* Need to create a %tstate if we're forking from proc0 */
+ if (p1 == &proc0)
+ tf2->tf_tstate = (ASI_PRIMARY_NO_FAULT<<TSTATE_ASI_SHIFT) |
+ ((PSTATE_USER)<<TSTATE_PSTATE_SHIFT);
+
#ifdef NOTDEF_DEBUG
printf("cpu_fork: Copying over trapframe: otf=%p ntf=%p sp=%p opcb=%p npcb=%p\n",
Home |
Main Index |
Thread Index |
Old Index