Date: Sun, 13 Jun 2004 07:36:50 GMT From: Juli Mallett <jmallett@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 54800 for review Message-ID: <200406130736.i5D7aorc056038@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54800 Change 54800 by jmallett@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406130736.i5D7aorc056038>