summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.h
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-04-19 22:46:26 +0000
committerscottl <scottl@FreeBSD.org>2007-04-19 22:46:26 +0000
commit4fc5076a7d9d61396b2037b5b15b9b762e3f1501 (patch)
treef58f4ba1b0a0c3448c078354cb0244ba97bd5a92 /sys/cam/cam_periph.h
parent6614b78b713a4897d45c5cfec8a78a6435bf5544 (diff)
downloadFreeBSD-src-4fc5076a7d9d61396b2037b5b15b9b762e3f1501.zip
FreeBSD-src-4fc5076a7d9d61396b2037b5b15b9b762e3f1501.tar.gz
Inline cam_periph_lock|unlock to make debugging easier. Use more
CAM_SIM_LOCK() more uniformly.
Diffstat (limited to 'sys/cam/cam_periph.h')
-rw-r--r--sys/cam/cam_periph.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h
index 8a6c1eb..e6073d9 100644
--- a/sys/cam/cam_periph.h
+++ b/sys/cam/cam_periph.h
@@ -32,6 +32,7 @@
#define _CAM_CAM_PERIPH_H 1
#include <sys/queue.h>
+#include <cam/cam_sim.h>
#ifdef _KERNEL
@@ -138,8 +139,6 @@ cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
char *name, cam_periph_type type, struct cam_path *,
ac_callback_t *, ac_code, void *arg);
struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
-void cam_periph_lock(struct cam_periph *periph);
-void cam_periph_unlock(struct cam_periph *periph);
cam_status cam_periph_acquire(struct cam_periph *periph);
void cam_periph_release(struct cam_periph *periph);
int cam_periph_hold(struct cam_periph *periph, int priority);
@@ -177,5 +176,17 @@ void cam_periph_freeze_after_event(struct cam_periph *periph,
int cam_periph_error(union ccb *ccb, cam_flags camflags,
u_int32_t sense_flags, union ccb *save_ccb);
+static __inline void
+cam_periph_lock(struct cam_periph *periph)
+{
+ mtx_lock(periph->sim->mtx);
+}
+
+static __inline void
+cam_periph_unlock(struct cam_periph *periph)
+{
+ mtx_unlock(periph->sim->mtx);
+}
+
#endif /* _KERNEL */
#endif /* _CAM_CAM_PERIPH_H */
OpenPOWER on IntegriCloud