From owner-p4-projects@FreeBSD.ORG Sun Jun 13 07:38:08 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 78F0716A4D1; Sun, 13 Jun 2004 07:38:08 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B9E916A4CE for ; Sun, 13 Jun 2004 07:38:08 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4496B43D39 for ; Sun, 13 Jun 2004 07:38:08 +0000 (GMT) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5D7apfE056041 for ; Sun, 13 Jun 2004 07:36:51 GMT (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5D7aorc056038 for perforce@freebsd.org; Sun, 13 Jun 2004 07:36:50 GMT (envelope-from jmallett@freebsd.org) Date: Sun, 13 Jun 2004 07:36:50 GMT Message-Id: <200406130736.i5D7aorc056038@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jmallett@freebsd.org using -f From: Juli Mallett To: Perforce Change Reviews Subject: PERFORCE change 54800 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2004 07:38:09 -0000 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); }