From e5f2f488c5f8bf041304bdd6cd4556fdc4f3dd4c Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Sat, 2 Dec 2000 18:33:29 +0000 Subject: [PATCH] Add USEC_SLEEP macro support. Change the location at which we define ISP_LOCK/ISP_UNLOCK macros. --- sys/dev/isp/isp_freebsd.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index ef58ce7971b1..34254603141a 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -119,6 +119,19 @@ struct isposinfo { #endif }; +/* + * Locking macros... + */ + +#ifdef ISP_SMPLOCK +#define ISP_LOCK(x) mtx_enter(&(x)->isp_osinfo.lock, MTX_DEF) +#define ISP_UNLOCK(x) mtx_exit(&(x)->isp_osinfo.lock, MTX_DEF) +#else +#define ISP_LOCK isp_lock +#define ISP_UNLOCK isp_unlock +#endif + + /* * Required Macros/Defines */ @@ -133,6 +146,10 @@ struct isposinfo { #define SNPRINTF snprintf #define STRNCAT strncat #define USEC_DELAY DELAY +#define USEC_SLEEP(isp, x) \ + ISP_UNLOCK(isp); \ + DELAY(x); \ + ISP_LOCK(isp) #define NANOTIME_T struct timespec #define GET_NANOTIME nanotime @@ -274,18 +291,6 @@ struct isposinfo { extern void isp_attach(struct ispsoftc *); extern void isp_uninit(struct ispsoftc *); -/* - * Locking macros... - */ - -#ifdef ISP_SMPLOCK -#define ISP_LOCK(x) mtx_enter(&(x)->isp_osinfo.lock, MTX_DEF) -#define ISP_UNLOCK(x) mtx_exit(&(x)->isp_osinfo.lock, MTX_DEF) -#else -#define ISP_LOCK isp_lock -#define ISP_UNLOCK isp_unlock -#endif - /* * Platform private flags */