Date: Mon, 25 Jan 2010 19:01:38 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r202983 - head/sys/mips/mips Message-ID: <201001251901.o0PJ1cgx050220@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Mon Jan 25 19:01:38 2010 New Revision: 202983 URL: http://svn.freebsd.org/changeset/base/202983 Log: Store the mutex in the correct location. Before, we were storing it in the pcb at the td_lock offset, rather than in the struct thread at the td_lock offset. And we were storing a pointer to the old thread rather than to the mutex. Why this didn't always kill us, I'll never know. Fix an obsolete comment and update the prototype in the comments. Also note what variables are in what registers since this function is a little complex... neel@ found this problem and proposed this fix. This cures a number of different problem reports out there, and gets us booting octeon to the login prompt... Submitted by: neel@ Reviewed by: rrs@, gonzo@ Modified: head/sys/mips/mips/swtch.S Modified: head/sys/mips/mips/swtch.S ============================================================================== --- head/sys/mips/mips/swtch.S Mon Jan 25 18:52:47 2010 (r202982) +++ head/sys/mips/mips/swtch.S Mon Jan 25 19:01:38 2010 (r202983) @@ -282,9 +282,10 @@ NON_LEAF(mips_cpu_throw, STAND_FRAME_SIZ END(mips_cpu_throw) /* - *XXX Fixme: should be written to new interface that requires lock - * storage. We fake it for now. - * cpu_switch(struct thread *old, struct thread *new); + * cpu_switch(struct thread *old, struct thread *new, struct mutex *mtx); + * a0 - old + * a1 - new + * a2 - mtx * Find the highest priority process and resume it. */ NON_LEAF(cpu_switch, STAND_FRAME_SIZE, ra) @@ -323,7 +324,7 @@ getpc: * to be saved with the other registers do so here. */ - sw a3, TD_LOCK(a0) # Switchout td_lock + sw a2, TD_LOCK(a3) # Switchout td_lock mips_sw1: #if defined(SMP) && defined(SCHED_ULE)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001251901.o0PJ1cgx050220>