From owner-svn-src-all@FreeBSD.ORG Fri Feb 5 06:36:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09DD0106566C; Fri, 5 Feb 2010 06:36:04 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFBF58FC0C; Fri, 5 Feb 2010 06:36:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o156a3km056264; Fri, 5 Feb 2010 06:36:03 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o156a309056262; Fri, 5 Feb 2010 06:36:03 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002050636.o156a309056262@svn.freebsd.org> From: Neel Natu Date: Fri, 5 Feb 2010 06:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203511 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 06:36:04 -0000 Author: neel Date: Fri Feb 5 06:36:03 2010 New Revision: 203511 URL: http://svn.freebsd.org/changeset/base/203511 Log: Correct a comment - we are not setting the exception level but rather are disabling interrupts. Simplify register usage - we can directly load 'curpcb' into 'k1' after interrupts are disabled. There is no need to do so indirectly through 'a1'. Modified: head/sys/mips/mips/swtch.S Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Fri Feb 5 03:22:04 2010 (r203510) +++ head/sys/mips/mips/swtch.S Fri Feb 5 06:36:03 2010 (r203511) @@ -161,21 +161,19 @@ LEAF(fork_trampoline) DO_AST -/* - * Since interrupts are enabled at this point, we use a1 instead of - * k0 or k1 to store the PCB pointer. This is because k0 and k1 - * are not preserved across interrupts. - */ - GET_CPU_PCPU(a1) - lw a1, PC_CURPCB(a1) -1: - - mfc0 v0, COP_0_STATUS_REG # set exeption level bit. + mfc0 v0, COP_0_STATUS_REG and v0, ~(SR_INT_ENAB) - mtc0 v0, COP_0_STATUS_REG # set exeption level bit. + mtc0 v0, COP_0_STATUS_REG # disable interrupts COP0_SYNC +/* + * The use of k1 for storing the PCB pointer must be done only + * after interrupts are disabled. Otherwise it will get overwritten + * by the interrupt code. + */ .set noat - move k1, a1 + GET_CPU_PCPU(k1) + lw k1, PC_CURPCB(k1) + RESTORE_U_PCB_REG(t0, MULLO, k1) RESTORE_U_PCB_REG(t1, MULHI, k1) mtlo t0 @@ -185,11 +183,6 @@ LEAF(fork_trampoline) RESTORE_U_PCB_REG(v0, V0, k1) _MTC0 a0, COP_0_EXC_PC # set return address -/* - * The use of k1 for storing the PCB pointer must be done only - * after interrupts are disabled. Otherwise it will get overwritten - * by the interrupt code. - */ RESTORE_U_PCB_REG(v1, V1, k1) RESTORE_U_PCB_REG(a0, A0, k1) RESTORE_U_PCB_REG(a1, A1, k1)