Date: Tue, 28 Nov 2006 19:25:43 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 110630 for review Message-ID: <200611281925.kASJPhcr062066@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611281925.kASJPhcr062066>