PERFORCE change 54800 for review
Juli Mallett
jmallett at FreeBSD.org
Sun Jun 13 07:38:09 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=54800
Change 54800 by jmallett at jmallett_oingo on 2004/06/13 07:36:38
Return nothing, and do TF copying. Before this, I was corrupting things
by way of overlapping the sp of thread0 with everything else.
Affected files ...
.. //depot/projects/mips/sys/mips/mips/trap.c#20 edit
Differences ...
==== //depot/projects/mips/sys/mips/mips/trap.c#20 (text+ko) ====
@@ -87,9 +87,9 @@
#define MAXTRAPID 31
/* XXX belongs in a header some day? */
-struct trapframe *trap(struct trapframe *, u_int, void *);
+void trap(struct trapframe *, u_int, void *);
-struct trapframe *
+void
trap(struct trapframe *tf, u_int cause, void *badvaddr)
{
struct trap_identifier *tid;
@@ -100,9 +100,8 @@
code = (cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT;
kernelmode = (tf->tf_regs[TF_SR] & MIPS_SR_KSU_USER) == 0;
- if (curthread != NULL) {
- curthread->td_frame = tf;
- }
+ if (curthread != NULL)
+ bcopy(tf, curthread->td_frame, sizeof *tf);
/*
* Handle that which we can.
@@ -111,25 +110,11 @@
case TrMod:
/* XXX Kernel only. */
tlb_modified(badvaddr);
- platform_trap_exit();
- if (curthread)
- tf = curthread->td_frame;
- return (tf);
+ goto done;
case TrInt:
- platform_trap_exit();
-#if 0
- /*
- * It looks like these break interrupt preemption.
- */
- critical_enter();
-#endif
+ /*platform_trap_exit();*/
platform_intr(tf);
-#if 0
- critical_exit();
-#endif
- if (curthread)
- tf = curthread->td_frame;
- return (tf);
+ goto done;
default:
/* Fatal! */
break;
@@ -186,6 +171,5 @@
done:
platform_trap_exit();
if (curthread)
- tf = curthread->td_frame;
- return (tf);
+ bcopy(curthread->td_frame, tf, sizeof *tf);
}
More information about the p4-projects
mailing list