diff options
author | fsmp <fsmp@FreeBSD.org> | 1997-08-31 03:17:48 +0000 |
---|---|---|
committer | fsmp <fsmp@FreeBSD.org> | 1997-08-31 03:17:48 +0000 |
commit | 53cd3a6e283516523cbdacf36340687e233d6ba8 (patch) | |
tree | 9e1ad83a6fdf24736bad3da3ddafb94f85346735 /sys/amd64 | |
parent | 92287f9b58f359eb2a68d5c728235f5ffd89c1cd (diff) | |
download | FreeBSD-src-53cd3a6e283516523cbdacf36340687e233d6ba8.zip FreeBSD-src-53cd3a6e283516523cbdacf36340687e233d6ba8.tar.gz |
Debug version of simple_lock. This will store the CPU id of the
holding CPU along with the lock. When a CPU fails to get the lock
it compares its own id to the holder id. If they are the same it
panic()s, as simple locks are binary, and this would cause a deadlock.
Controlled by smptests.h: SL_DEBUG, ON by default.
Some minor cleanup.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 31 | ||||
-rw-r--r-- | sys/amd64/amd64/mptable.c | 31 | ||||
-rw-r--r-- | sys/amd64/include/mptable.h | 31 |
3 files changed, 33 insertions, 60 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 955a3a1..322f0f1 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.32 1997/08/30 01:25:13 smp Exp smp $ + * $Id: mp_machdep.c,v 1.34 1997/08/31 03:05:56 smp Exp smp $ */ #include "opt_smp.h" @@ -1446,16 +1446,18 @@ struct simplelock fast_intr_lock; /* critical region around INTR() routines */ struct simplelock intr_lock; +/* lock regions around the clock hardware */ +struct simplelock clock_lock; + #ifdef SIMPLE_MPINTRLOCK -/* critical region around INTR() routines */ +/* lock regions protected in UP kernel via cli/sti */ struct simplelock mpintr_lock; -struct simplelock clock_lock; #endif -#if 0 -/* lock the com (tty) data structures */ +#ifdef USE_COMLOCK +/* locks com (tty) data/hardware accesses: a FASTINTR() */ struct simplelock com_lock; -#endif +#endif /* USE_COMLOCK */ static void init_locks(void) @@ -1470,27 +1472,16 @@ init_locks(void) isr_lock = FREE_LOCK; #ifdef SIMPLE_MPINTRLOCK - /* lock regions protected in UP kernel via cli/sti */ s_lock_init((struct simplelock*)&mpintr_lock); - s_lock_init((struct simplelock*)&clock_lock); #endif - - /* serializes FAST_INTR() accesses */ + s_lock_init((struct simplelock*)&clock_lock); s_lock_init((struct simplelock*)&fast_intr_lock); - - /* serializes INTR() accesses */ s_lock_init((struct simplelock*)&intr_lock); - - /* locks the IO APIC and apic_imen accesses */ s_lock_init((struct simplelock*)&imen_lock); - - /* locks cpl/cml/cim/ipending accesses */ s_lock_init((struct simplelock*)&cpl_lock); - -#if 0 - /* locks com (tty) data/hardware accesses: a FASTINTR() */ +#ifdef USE_COMLOCK s_lock_init((struct simplelock*)&com_lock); -#endif +#endif /* USE_COMLOCK */ } diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index 955a3a1..322f0f1 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.32 1997/08/30 01:25:13 smp Exp smp $ + * $Id: mp_machdep.c,v 1.34 1997/08/31 03:05:56 smp Exp smp $ */ #include "opt_smp.h" @@ -1446,16 +1446,18 @@ struct simplelock fast_intr_lock; /* critical region around INTR() routines */ struct simplelock intr_lock; +/* lock regions around the clock hardware */ +struct simplelock clock_lock; + #ifdef SIMPLE_MPINTRLOCK -/* critical region around INTR() routines */ +/* lock regions protected in UP kernel via cli/sti */ struct simplelock mpintr_lock; -struct simplelock clock_lock; #endif -#if 0 -/* lock the com (tty) data structures */ +#ifdef USE_COMLOCK +/* locks com (tty) data/hardware accesses: a FASTINTR() */ struct simplelock com_lock; -#endif +#endif /* USE_COMLOCK */ static void init_locks(void) @@ -1470,27 +1472,16 @@ init_locks(void) isr_lock = FREE_LOCK; #ifdef SIMPLE_MPINTRLOCK - /* lock regions protected in UP kernel via cli/sti */ s_lock_init((struct simplelock*)&mpintr_lock); - s_lock_init((struct simplelock*)&clock_lock); #endif - - /* serializes FAST_INTR() accesses */ + s_lock_init((struct simplelock*)&clock_lock); s_lock_init((struct simplelock*)&fast_intr_lock); - - /* serializes INTR() accesses */ s_lock_init((struct simplelock*)&intr_lock); - - /* locks the IO APIC and apic_imen accesses */ s_lock_init((struct simplelock*)&imen_lock); - - /* locks cpl/cml/cim/ipending accesses */ s_lock_init((struct simplelock*)&cpl_lock); - -#if 0 - /* locks com (tty) data/hardware accesses: a FASTINTR() */ +#ifdef USE_COMLOCK s_lock_init((struct simplelock*)&com_lock); -#endif +#endif /* USE_COMLOCK */ } diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 955a3a1..322f0f1 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.32 1997/08/30 01:25:13 smp Exp smp $ + * $Id: mp_machdep.c,v 1.34 1997/08/31 03:05:56 smp Exp smp $ */ #include "opt_smp.h" @@ -1446,16 +1446,18 @@ struct simplelock fast_intr_lock; /* critical region around INTR() routines */ struct simplelock intr_lock; +/* lock regions around the clock hardware */ +struct simplelock clock_lock; + #ifdef SIMPLE_MPINTRLOCK -/* critical region around INTR() routines */ +/* lock regions protected in UP kernel via cli/sti */ struct simplelock mpintr_lock; -struct simplelock clock_lock; #endif -#if 0 -/* lock the com (tty) data structures */ +#ifdef USE_COMLOCK +/* locks com (tty) data/hardware accesses: a FASTINTR() */ struct simplelock com_lock; -#endif +#endif /* USE_COMLOCK */ static void init_locks(void) @@ -1470,27 +1472,16 @@ init_locks(void) isr_lock = FREE_LOCK; #ifdef SIMPLE_MPINTRLOCK - /* lock regions protected in UP kernel via cli/sti */ s_lock_init((struct simplelock*)&mpintr_lock); - s_lock_init((struct simplelock*)&clock_lock); #endif - - /* serializes FAST_INTR() accesses */ + s_lock_init((struct simplelock*)&clock_lock); s_lock_init((struct simplelock*)&fast_intr_lock); - - /* serializes INTR() accesses */ s_lock_init((struct simplelock*)&intr_lock); - - /* locks the IO APIC and apic_imen accesses */ s_lock_init((struct simplelock*)&imen_lock); - - /* locks cpl/cml/cim/ipending accesses */ s_lock_init((struct simplelock*)&cpl_lock); - -#if 0 - /* locks com (tty) data/hardware accesses: a FASTINTR() */ +#ifdef USE_COMLOCK s_lock_init((struct simplelock*)&com_lock); -#endif +#endif /* USE_COMLOCK */ } |