Deleted Added
full compact
kern_lock.c (167366) kern_lock.c (167368)
1/*-
2 * Copyright (c) 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Copyright (C) 1997
6 * John S. Dyson. All rights reserved.
7 *
8 * This code contains ideas from software contributed to Berkeley by

--- 27 unchanged lines hidden (view full) ---

36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE.
39 *
40 * @(#)kern_lock.c 8.18 (Berkeley) 5/21/95
41 */
42
43#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Copyright (C) 1997
6 * John S. Dyson. All rights reserved.
7 *
8 * This code contains ideas from software contributed to Berkeley by

--- 27 unchanged lines hidden (view full) ---

36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 * SUCH DAMAGE.
39 *
40 * @(#)kern_lock.c 8.18 (Berkeley) 5/21/95
41 */
42
43#include <sys/cdefs.h>
44__FBSDID("$FreeBSD: head/sys/kern/kern_lock.c 167366 2007-03-09 16:19:34Z jhb $");
44__FBSDID("$FreeBSD: head/sys/kern/kern_lock.c 167368 2007-03-09 16:27:11Z jhb $");
45
46#include "opt_ddb.h"
47#include "opt_global.h"
48
49#include <sys/param.h>
50#include <sys/kdb.h>
51#include <sys/kernel.h>
52#include <sys/ktr.h>

--- 6 unchanged lines hidden (view full) ---

59#ifdef DEBUG_LOCKS
60#include <sys/stack.h>
61#endif
62
63#ifdef DDB
64#include <ddb/ddb.h>
65static void db_show_lockmgr(struct lock_object *lock);
66#endif
45
46#include "opt_ddb.h"
47#include "opt_global.h"
48
49#include <sys/param.h>
50#include <sys/kdb.h>
51#include <sys/kernel.h>
52#include <sys/ktr.h>

--- 6 unchanged lines hidden (view full) ---

59#ifdef DEBUG_LOCKS
60#include <sys/stack.h>
61#endif
62
63#ifdef DDB
64#include <ddb/ddb.h>
65static void db_show_lockmgr(struct lock_object *lock);
66#endif
67static void lock_lockmgr(struct lock_object *lock, int how);
68static int unlock_lockmgr(struct lock_object *lock);
67
69
68
69struct lock_class lock_class_lockmgr = {
70 .lc_name = "lockmgr",
71 .lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
72#ifdef DDB
70struct lock_class lock_class_lockmgr = {
71 .lc_name = "lockmgr",
72 .lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
73#ifdef DDB
73 .lc_ddb_show = db_show_lockmgr
74 .lc_ddb_show = db_show_lockmgr,
74#endif
75#endif
76 .lc_lock = lock_lockmgr,
77 .lc_unlock = unlock_lockmgr,
75};
76
78};
79
77
78/*
79 * Locking primitives implementation.
80 * Locks provide shared/exclusive sychronization.
81 */
82
80/*
81 * Locking primitives implementation.
82 * Locks provide shared/exclusive sychronization.
83 */
84
85void
86lock_lockmgr(struct lock_object *lock, int how)
87{
88
89 panic("lockmgr locks do not support sleep interlocking");
90}
91
92int
93unlock_lockmgr(struct lock_object *lock)
94{
95
96 panic("lockmgr locks do not support sleep interlocking");
97}
98
83#define COUNT(td, x) if ((td)) (td)->td_locks += (x)
84#define LK_ALL (LK_HAVE_EXCL | LK_WANT_EXCL | LK_WANT_UPGRADE | \
85 LK_SHARE_NONZERO | LK_WAIT_NONZERO)
86
87static int acquire(struct lock **lkpp, int extflags, int wanted, int *contested, uint64_t *waittime);
88static int acquiredrain(struct lock *lkp, int extflags) ;
89
90static __inline void

--- 595 unchanged lines hidden ---
99#define COUNT(td, x) if ((td)) (td)->td_locks += (x)
100#define LK_ALL (LK_HAVE_EXCL | LK_WANT_EXCL | LK_WANT_UPGRADE | \
101 LK_SHARE_NONZERO | LK_WAIT_NONZERO)
102
103static int acquire(struct lock **lkpp, int extflags, int wanted, int *contested, uint64_t *waittime);
104static int acquiredrain(struct lock *lkp, int extflags) ;
105
106static __inline void

--- 595 unchanged lines hidden ---