From owner-p4-projects@FreeBSD.ORG Fri Mar 12 16:52:43 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7A00616A4D0; Fri, 12 Mar 2004 16:52:43 -0800 (PST) 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 4F22816A4CE for ; Fri, 12 Mar 2004 16:52:43 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46B5943D2F for ; Fri, 12 Mar 2004 16:52:43 -0800 (PST) (envelope-from jmallett@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2D0qhGe046374 for ; Fri, 12 Mar 2004 16:52:43 -0800 (PST) (envelope-from jmallett@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2D0qg5m046371 for perforce@freebsd.org; Fri, 12 Mar 2004 16:52:42 -0800 (PST) (envelope-from jmallett@freebsd.org) Date: Fri, 12 Mar 2004 16:52:42 -0800 (PST) Message-Id: <200403130052.i2D0qg5m046371@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 48841 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: Sat, 13 Mar 2004 00:52:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=48841 Change 48841 by jmallett@jmallett_oingo on 2004/03/12 16:52:22 Write cpu_switch in C. Affected files ... .. //depot/projects/mips/sys/mips/mips/swtch.S#3 edit .. //depot/projects/mips/sys/mips/mips/vm_machdep.c#11 edit Differences ... ==== //depot/projects/mips/sys/mips/mips/swtch.S#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/mips/sys/mips/mips/swtch.S#2 $ + * $P4: //depot/projects/mips/sys/mips/mips/swtch.S#3 $ */ #include @@ -85,28 +85,6 @@ END(cpu_throw) /* - * a0: struct thread *old - * a1: struct thread *new - */ -ENTRY(cpu_switch) - dsubu sp, 8 - sd ra, 0(sp) - jal savectx - nop - bnez v0, restore - nop - jal pmap_deactivate - nop - jal cpu_throw - nop - /* NOTREACHED */ -restore: - ld ra, 0(sp) - j ra - daddu sp, 8 -END(cpu_switch) - -/* * s0: Routine to call. * s1: a0 for said routine. * s2: a1 for said routine. ==== //depot/projects/mips/sys/mips/mips/vm_machdep.c#11 (text+ko) ==== @@ -103,6 +103,16 @@ } void +cpu_switch(struct thread *old, struct thread *new) +{ + if (!savectx(old->td_pcb)) { + pmap_deactivate(old); + cpu_throw(old, new); + panic("%s: should not be reached", __func__); + } +} + +void cpu_thread_exit(struct thread *td) { panic("%s", __func__);