From owner-p4-projects@FreeBSD.ORG Tue Nov 28 19:26:37 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7727D16A4C2; Tue, 28 Nov 2006 19:26:37 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38DCE16A494 for ; Tue, 28 Nov 2006 19:26:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D1F943CE9 for ; Tue, 28 Nov 2006 19:26:07 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kASJPieb062069 for ; Tue, 28 Nov 2006 19:25:44 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kASJPhcr062066 for perforce@freebsd.org; Tue, 28 Nov 2006 19:25:43 GMT (envelope-from gonzo@FreeBSD.org) Date: Tue, 28 Nov 2006 19:25:43 GMT Message-Id: <200611281925.kASJPhcr062066@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 110630 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: Tue, 28 Nov 2006 19:26:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=110630 Change 110630 by gonzo@gonzo_jeevse on 2006/11/28 19:25:30 o Clean out debug printfs o Move EPC modification to syscall function start, it should be modified before syscall handler. o Fill out v1 register with td_retval[1] value because it does required by some syscall (for example fork). Affected files ... .. //depot/projects/mips2/src/sys/mips/mips/trap.c#12 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips/trap.c#12 (text+ko) ==== @@ -311,6 +311,16 @@ if (td->td_ucred != td->td_proc->p_ucred) cred_update_thread(td); + /* + * XXXMIPS(1): Check for branch delay? + * XXXMIPS(2): Right now frame and td->td_frame point + * to the same memory area so after fork syscall + * epc register will be copied by cpu_fork call to + * new thread. We need to figure out the way to make + * sure these two pointers to be the same. + */ + frame->tf_regs[TF_EPC] += 4; + code = frame->tf_regs[TF_V0] & 0x000fffff; /* @@ -335,14 +345,6 @@ callp = &p->p_sysent->sv_table[code]; nargs = callp->sy_narg & SYF_ARGMASK; - /* syscallnames is available only of INVARIANTS are on */ -#ifdef INVARIANTS - printf("syscall enter thread %p pid %d proc " \ - "%s code %d(%s) nargs: %d\n", td, - td->td_proc->p_pid, td->td_proc->p_comm, code, - syscallnames[code], nargs); -#endif - /* Copy arguments from a0..a4 */ for(i = 0; i < MIN(nargs, 4 - args_shift); i++) copyargs[i] = frame->tf_regs[TF_A0 + i + args_shift]; @@ -389,7 +391,7 @@ * XXXMIPS: should we consider this case for 32-bit or * only for 64bits? */ - /* frame->tf_regs[TF_V1] = td->td_retval[1]; */ + frame->tf_regs[TF_V1] = td->td_retval[1]; frame->tf_regs[TF_A3] = 0; break; @@ -425,18 +427,8 @@ (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???", td->td_locks)); - /* XXXMIPS: Check for branch delay? */ - frame->tf_regs[TF_EPC] += 4; userret(td, frame); - /* syscallnames is available only of INVARIANTS are on */ -#ifdef INVARIANTS - printf("syscall exit thread %p pid %d proc " \ - "%s code %d(%s) nargs: %d error=%d\n", td, - td->td_proc->p_pid, td->td_proc->p_comm, code, - syscallnames[code], nargs, error); -#endif - CTR4(KTR_SYSC, "syscall exit thread %p pid %d proc %s code %d", td, td->td_proc->p_pid, td->td_proc->p_comm, code);