From owner-p4-projects@FreeBSD.ORG Thu Jan 24 05:51:06 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F315316A46E; Thu, 24 Jan 2008 05:51:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A06DB16A419 for ; Thu, 24 Jan 2008 05:51:05 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A384C13C474 for ; Thu, 24 Jan 2008 05:51:05 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m0O5p56N079024 for ; Thu, 24 Jan 2008 05:51:05 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0O5p5QX079021 for perforce@freebsd.org; Thu, 24 Jan 2008 05:51:05 GMT (envelope-from imp@freebsd.org) Date: Thu, 24 Jan 2008 05:51:05 GMT Message-Id: <200801240551.m0O5p5QX079021@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 133971 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2008 05:51:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=133971 Change 133971 by imp@imp_paco-paco on 2008/01/24 05:50:23 Save and restore the gp register. mips2 did this and I can't for the life of me think of why you wouldn't want to do this. But I'm still confused by the limited number of registers saved here and need to understand why better... Even without this change, we make it way past cpu_switch and get tangled up somewhere past fork_exit(). I wonder if the time has come to understand John Baldwin's mail about ast(). I also need to double check to see if mips32 cpus have odd-ball multiply registers. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/mips/mips/swtch.S#8 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/swtch.S#8 (text+ko) ==== @@ -246,6 +246,7 @@ SAVE_U_PCB_CONTEXT(s8, 9, a0) SAVE_U_PCB_CONTEXT(ra, 10, a0) SAVE_U_PCB_CONTEXT(v0, 11, a0) + SAVE_U_PCB_CONTEXT(gp, 12, a0) /* * FREEBSD_DEVELOPERS_FIXME: * In case there are CPU-specific registers that need @@ -300,6 +301,7 @@ SAVE_U_PCB_CONTEXT(s8, 9, a0) SAVE_U_PCB_CONTEXT(ra, 10, a0) # save return address SAVE_U_PCB_CONTEXT(t0, 11, a0) # save status register + SAVE_U_PCB_CONTEXT(gp, 12, a0) /* * FREEBSD_DEVELOPERS_FIXME: * In case there are CPU-specific registers that need @@ -380,6 +382,7 @@ * Restore registers and return. */ lw a0, TD_PCB(s7) + RESTORE_U_PCB_CONTEXT(gp, 12, a0) RESTORE_U_PCB_CONTEXT(v0, 11, a0) # restore kernel context RESTORE_U_PCB_CONTEXT(ra, 10, a0) RESTORE_U_PCB_CONTEXT(s0, 0, a0)