kern_lock.c (252212) | kern_lock.c (255745) |
---|---|
1/*- 2 * Copyright (c) 2008 Attilio Rao <attilio@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 */ 28 29#include "opt_adaptive_lockmgrs.h" 30#include "opt_ddb.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_kdtrace.h" 33 34#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008 Attilio Rao <attilio@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 */ 28 29#include "opt_adaptive_lockmgrs.h" 30#include "opt_ddb.h" 31#include "opt_hwpmc_hooks.h" 32#include "opt_kdtrace.h" 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/kern/kern_lock.c 252212 2013-06-25 20:23:08Z jhb $"); | 35__FBSDID("$FreeBSD: head/sys/kern/kern_lock.c 255745 2013-09-20 23:06:21Z davide $"); |
36 37#include <sys/param.h> 38#include <sys/kdb.h> 39#include <sys/ktr.h> 40#include <sys/lock.h> 41#include <sys/lock_profile.h> 42#include <sys/lockmgr.h> 43#include <sys/mutex.h> --- 93 unchanged lines hidden (view full) --- 137 138#define lockmgr_xlocked(lk) \ 139 (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread) 140 141static void assert_lockmgr(const struct lock_object *lock, int how); 142#ifdef DDB 143static void db_show_lockmgr(const struct lock_object *lock); 144#endif | 36 37#include <sys/param.h> 38#include <sys/kdb.h> 39#include <sys/ktr.h> 40#include <sys/lock.h> 41#include <sys/lock_profile.h> 42#include <sys/lockmgr.h> 43#include <sys/mutex.h> --- 93 unchanged lines hidden (view full) --- 137 138#define lockmgr_xlocked(lk) \ 139 (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread) 140 141static void assert_lockmgr(const struct lock_object *lock, int how); 142#ifdef DDB 143static void db_show_lockmgr(const struct lock_object *lock); 144#endif |
145static void lock_lockmgr(struct lock_object *lock, int how); | 145static void lock_lockmgr(struct lock_object *lock, uintptr_t how); |
146#ifdef KDTRACE_HOOKS 147static int owner_lockmgr(const struct lock_object *lock, 148 struct thread **owner); 149#endif | 146#ifdef KDTRACE_HOOKS 147static int owner_lockmgr(const struct lock_object *lock, 148 struct thread **owner); 149#endif |
150static int unlock_lockmgr(struct lock_object *lock); | 150static uintptr_t unlock_lockmgr(struct lock_object *lock); |
151 152struct lock_class lock_class_lockmgr = { 153 .lc_name = "lockmgr", 154 .lc_flags = LC_RECURSABLE | LC_SLEEPABLE | LC_SLEEPLOCK | LC_UPGRADABLE, 155 .lc_assert = assert_lockmgr, 156#ifdef DDB 157 .lc_ddb_show = db_show_lockmgr, 158#endif --- 186 unchanged lines hidden (view full) --- 345static void 346assert_lockmgr(const struct lock_object *lock, int what) 347{ 348 349 panic("lockmgr locks do not support assertions"); 350} 351 352static void | 151 152struct lock_class lock_class_lockmgr = { 153 .lc_name = "lockmgr", 154 .lc_flags = LC_RECURSABLE | LC_SLEEPABLE | LC_SLEEPLOCK | LC_UPGRADABLE, 155 .lc_assert = assert_lockmgr, 156#ifdef DDB 157 .lc_ddb_show = db_show_lockmgr, 158#endif --- 186 unchanged lines hidden (view full) --- 345static void 346assert_lockmgr(const struct lock_object *lock, int what) 347{ 348 349 panic("lockmgr locks do not support assertions"); 350} 351 352static void |
353lock_lockmgr(struct lock_object *lock, int how) | 353lock_lockmgr(struct lock_object *lock, uintptr_t how) |
354{ 355 356 panic("lockmgr locks do not support sleep interlocking"); 357} 358 | 354{ 355 356 panic("lockmgr locks do not support sleep interlocking"); 357} 358 |
359static int | 359static uintptr_t |
360unlock_lockmgr(struct lock_object *lock) 361{ 362 363 panic("lockmgr locks do not support sleep interlocking"); 364} 365 366#ifdef KDTRACE_HOOKS 367static int --- 1138 unchanged lines hidden --- | 360unlock_lockmgr(struct lock_object *lock) 361{ 362 363 panic("lockmgr locks do not support sleep interlocking"); 364} 365 366#ifdef KDTRACE_HOOKS 367static int --- 1138 unchanged lines hidden --- |