mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-26 01:05:05 +08:00
LOCKING(9): Remove dead code (KDTRACE_HOOKS)
This commit is contained in:
parent
9c1490aac3
commit
3f23fcd943
@ -50,10 +50,6 @@
|
||||
|
||||
static void assert_mtx(const struct lock_object *lock, int what);
|
||||
static void lock_mtx(struct lock_object *lock, uintptr_t how);
|
||||
#ifdef KDTRACE_HOOKS
|
||||
static int owner_mtx(const struct lock_object *lock,
|
||||
struct thread **owner);
|
||||
#endif
|
||||
static uintptr_t unlock_mtx(struct lock_object *lock);
|
||||
|
||||
/*
|
||||
@ -68,9 +64,6 @@ struct lock_class lock_class_mtx_sleep = {
|
||||
#endif
|
||||
.lc_lock = lock_mtx,
|
||||
.lc_unlock = unlock_mtx,
|
||||
#ifdef KDTRACE_HOOKS
|
||||
.lc_owner = owner_mtx,
|
||||
#endif
|
||||
};
|
||||
|
||||
struct lock_class lock_class_mtx_spin = {
|
||||
@ -82,9 +75,6 @@ struct lock_class lock_class_mtx_spin = {
|
||||
#endif
|
||||
.lc_lock = lock_mtx,
|
||||
.lc_unlock = unlock_mtx,
|
||||
#ifdef KDTRACE_HOOKS
|
||||
.lc_owner = owner_mtx,
|
||||
#endif
|
||||
};
|
||||
|
||||
struct mtx Giant;
|
||||
@ -111,17 +101,6 @@ unlock_mtx(struct lock_object *lock)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
int
|
||||
owner_mtx(struct lock_object *lock, struct thread **owner)
|
||||
{
|
||||
struct mtx *m = (struct mtx *)lock;
|
||||
|
||||
*owner = mtx_owner(m);
|
||||
return (mtx_unowned(m) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
mtx_init(struct mtx *m, const char *name, const char *type, int opts)
|
||||
{
|
||||
|
@ -60,9 +60,6 @@
|
||||
|
||||
static void assert_rw(const struct lock_object *lock, int what);
|
||||
static void lock_rw(struct lock_object *lock, uintptr_t how);
|
||||
#ifdef KDTRACE_HOOKS
|
||||
static int owner_rw(const struct lock_object *lock, struct thread **owner);
|
||||
#endif
|
||||
static uintptr_t unlock_rw(struct lock_object *lock);
|
||||
|
||||
struct lock_class lock_class_rw = {
|
||||
@ -74,9 +71,6 @@ struct lock_class lock_class_rw = {
|
||||
#endif
|
||||
.lc_lock = lock_rw,
|
||||
.lc_unlock = unlock_rw,
|
||||
#ifdef KDTRACE_HOOKS
|
||||
.lc_owner = owner_rw,
|
||||
#endif
|
||||
};
|
||||
|
||||
#define rw_wowner(rw) rtems_bsd_mutex_owner(&(rw)->mutex)
|
||||
@ -105,19 +99,6 @@ unlock_rw(struct lock_object *lock)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
int
|
||||
owner_rw(struct lock_object *lock, struct thread **owner)
|
||||
{
|
||||
struct rwlock *rw = (struct rwlock *)lock;
|
||||
uintptr_t x = rw->rw_lock;
|
||||
|
||||
*owner = rw_wowner(rw);
|
||||
return ((x & RW_LOCK_READ) != 0 ? (RW_READERS(x) != 0) :
|
||||
(*owner != NULL));
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
rw_init_flags(struct rwlock *rw, const char *name, int opts)
|
||||
{
|
||||
|
@ -49,9 +49,6 @@
|
||||
|
||||
static void assert_sx(const struct lock_object *lock, int what);
|
||||
static void lock_sx(struct lock_object *lock, uintptr_t how);
|
||||
#ifdef KDTRACE_HOOKS
|
||||
static int owner_sx(const struct lock_object *lock, struct thread **owner);
|
||||
#endif
|
||||
static uintptr_t unlock_sx(struct lock_object *lock);
|
||||
|
||||
struct lock_class lock_class_sx = {
|
||||
@ -63,9 +60,6 @@ struct lock_class lock_class_sx = {
|
||||
#endif
|
||||
.lc_lock = lock_sx,
|
||||
.lc_unlock = unlock_sx,
|
||||
#ifdef KDTRACE_HOOKS
|
||||
.lc_owner = owner_sx,
|
||||
#endif
|
||||
};
|
||||
|
||||
#define sx_xholder(sx) rtems_bsd_mutex_owner(&(sx)->mutex)
|
||||
@ -94,19 +88,6 @@ unlock_sx(struct lock_object *lock)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef KDTRACE_HOOKS
|
||||
int
|
||||
owner_sx(struct lock_object *lock, struct thread **owner)
|
||||
{
|
||||
struct sx *sx = (struct sx *)lock;
|
||||
uintptr_t x = sx->sx_lock;
|
||||
|
||||
*owner = (struct thread *)SX_OWNER(x);
|
||||
return ((x & SX_LOCK_SHARED) != 0 ? (SX_SHARERS(x) != 0) :
|
||||
(*owner != NULL));
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
sx_sysinit(void *arg)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user