kern_mutex.c (69998) | kern_mutex.c (70861) |
---|---|
1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ | 1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ |
30 * $FreeBSD: head/sys/kern/kern_mutex.c 69998 2000-12-13 21:53:42Z jhb $ | 30 * $FreeBSD: head/sys/kern/kern_mutex.c 70861 2001-01-10 04:43:51Z jake $ |
31 */ 32 33/* 34 * Main Entry: witness 35 * Pronunciation: 'wit-n&s 36 * Function: noun 37 * Etymology: Middle English witnesse, from Old English witnes knowledge, 38 * testimony, witness, from 2wit --- 800 unchanged lines hidden (view full) --- 839 840 if (flags & MTX_SPIN) { 841 if (!w->w_spin) 842 panic("mutex_enter: MTX_SPIN on MTX_DEF mutex %s @" 843 " %s:%d", m->mtx_description, file, line); 844 if (m->mtx_recurse != 0) 845 return; 846 mtx_enter(&w_mtx, MTX_SPIN | MTX_QUIET); | 31 */ 32 33/* 34 * Main Entry: witness 35 * Pronunciation: 'wit-n&s 36 * Function: noun 37 * Etymology: Middle English witnesse, from Old English witnes knowledge, 38 * testimony, witness, from 2wit --- 800 unchanged lines hidden (view full) --- 839 840 if (flags & MTX_SPIN) { 841 if (!w->w_spin) 842 panic("mutex_enter: MTX_SPIN on MTX_DEF mutex %s @" 843 " %s:%d", m->mtx_description, file, line); 844 if (m->mtx_recurse != 0) 845 return; 846 mtx_enter(&w_mtx, MTX_SPIN | MTX_QUIET); |
847 i = witness_spin_check; | 847 i = PCPU_GET(witness_spin_check); |
848 if (i != 0 && w->w_level < i) { 849 mtx_exit(&w_mtx, MTX_SPIN | MTX_QUIET); 850 panic("mutex_enter(%s:%x, MTX_SPIN) out of order @" 851 " %s:%d already holding %s:%x", 852 m->mtx_description, w->w_level, file, line, 853 spin_order_list[ffs(i)-1], i); 854 } 855 PCPU_SET(witness_spin_check, i | w->w_level); --- 116 unchanged lines hidden (view full) --- 972 973 if (flags & MTX_SPIN) { 974 if (!w->w_spin) 975 panic("mutex_exit: MTX_SPIN on MTX_DEF mutex %s @" 976 " %s:%d", m->mtx_description, file, line); 977 if (m->mtx_recurse != 0) 978 return; 979 mtx_enter(&w_mtx, MTX_SPIN | MTX_QUIET); | 848 if (i != 0 && w->w_level < i) { 849 mtx_exit(&w_mtx, MTX_SPIN | MTX_QUIET); 850 panic("mutex_enter(%s:%x, MTX_SPIN) out of order @" 851 " %s:%d already holding %s:%x", 852 m->mtx_description, w->w_level, file, line, 853 spin_order_list[ffs(i)-1], i); 854 } 855 PCPU_SET(witness_spin_check, i | w->w_level); --- 116 unchanged lines hidden (view full) --- 972 973 if (flags & MTX_SPIN) { 974 if (!w->w_spin) 975 panic("mutex_exit: MTX_SPIN on MTX_DEF mutex %s @" 976 " %s:%d", m->mtx_description, file, line); 977 if (m->mtx_recurse != 0) 978 return; 979 mtx_enter(&w_mtx, MTX_SPIN | MTX_QUIET); |
980 PCPU_SET(witness_spin_check, witness_spin_check & ~w->w_level); | 980 PCPU_SET(witness_spin_check, 981 PCPU_GET(witness_spin_check) & ~w->w_level); |
981 mtx_exit(&w_mtx, MTX_SPIN | MTX_QUIET); 982 return; 983 } 984 if (w->w_spin) 985 panic("mutex_exit: MTX_DEF on MTX_SPIN mutex %s @ %s:%d", 986 m->mtx_description, file, line); 987 988 if (m->mtx_recurse != 0) --- 17 unchanged lines hidden (view full) --- 1006 if (flags & MTX_SPIN) { 1007 if (!w->w_spin) 1008 panic("mutex_try_enter: " 1009 "MTX_SPIN on MTX_DEF mutex %s @ %s:%d", 1010 m->mtx_description, file, line); 1011 if (m->mtx_recurse != 0) 1012 return; 1013 mtx_enter(&w_mtx, MTX_SPIN | MTX_QUIET); | 982 mtx_exit(&w_mtx, MTX_SPIN | MTX_QUIET); 983 return; 984 } 985 if (w->w_spin) 986 panic("mutex_exit: MTX_DEF on MTX_SPIN mutex %s @ %s:%d", 987 m->mtx_description, file, line); 988 989 if (m->mtx_recurse != 0) --- 17 unchanged lines hidden (view full) --- 1007 if (flags & MTX_SPIN) { 1008 if (!w->w_spin) 1009 panic("mutex_try_enter: " 1010 "MTX_SPIN on MTX_DEF mutex %s @ %s:%d", 1011 m->mtx_description, file, line); 1012 if (m->mtx_recurse != 0) 1013 return; 1014 mtx_enter(&w_mtx, MTX_SPIN | MTX_QUIET); |
1014 PCPU_SET(witness_spin_check, witness_spin_check | w->w_level); | 1015 PCPU_SET(witness_spin_check, 1016 PCPU_GET(witness_spin_check) | w->w_level); |
1015 mtx_exit(&w_mtx, MTX_SPIN | MTX_QUIET); 1016 w->w_file = file; 1017 w->w_line = line; 1018 m->mtx_line = line; 1019 m->mtx_file = file; 1020 return; 1021 } 1022 --- 391 unchanged lines hidden --- | 1017 mtx_exit(&w_mtx, MTX_SPIN | MTX_QUIET); 1018 w->w_file = file; 1019 w->w_line = line; 1020 m->mtx_line = line; 1021 m->mtx_file = file; 1022 return; 1023 } 1024 --- 391 unchanged lines hidden --- |