From 3f23fcd943026eb324992f99a5beaecdb4f4a5ce Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 16 Nov 2017 08:15:37 +0100 Subject: 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 0bb8a43f..40559eaa 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 2e03da23..80180829 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 57087eef..1092afe8 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) { -- cgit v1.2.3