[rtems-libbsd commit] LOCKING(9): Remove dead code (KDTRACE_HOOKS)
Sebastian Huber
sebh at rtems.org
Thu Nov 16 08:03:22 UTC 2017
Module: rtems-libbsd
Branch: master
Commit: 3f23fcd943026eb324992f99a5beaecdb4f4a5ce
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=3f23fcd943026eb324992f99a5beaecdb4f4a5ce
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Nov 16 08:15:37 2017 +0100
LOCKING(9): Remove dead code (KDTRACE_HOOKS)
---
rtemsbsd/rtems/rtems-kernel-mutex.c | 21 ---------------------
rtemsbsd/rtems/rtems-kernel-rwlock.c | 19 -------------------
rtemsbsd/rtems/rtems-kernel-sx.c | 19 -------------------
3 files changed, 59 deletions(-)
diff --git a/rtemsbsd/rtems/rtems-kernel-mutex.c b/rtemsbsd/rtems/rtems-kernel-mutex.c
index 0bb8a43..40559ea 100644
--- a/rtemsbsd/rtems/rtems-kernel-mutex.c
+++ b/rtemsbsd/rtems/rtems-kernel-mutex.c
@@ -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)
{
diff --git a/rtemsbsd/rtems/rtems-kernel-rwlock.c b/rtemsbsd/rtems/rtems-kernel-rwlock.c
index 2e03da2..8018082 100644
--- a/rtemsbsd/rtems/rtems-kernel-rwlock.c
+++ b/rtemsbsd/rtems/rtems-kernel-rwlock.c
@@ -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)
{
diff --git a/rtemsbsd/rtems/rtems-kernel-sx.c b/rtemsbsd/rtems/rtems-kernel-sx.c
index 57087ee..1092afe 100644
--- a/rtemsbsd/rtems/rtems-kernel-sx.c
+++ b/rtemsbsd/rtems/rtems-kernel-sx.c
@@ -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)
{
More information about the vc
mailing list