From owner-p4-projects Mon Sep 2 22:12:17 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3475D37B400; Mon, 2 Sep 2002 22:11:52 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D715D37B401 for ; Mon, 2 Sep 2002 22:11:51 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 271B843E72 for ; Mon, 2 Sep 2002 22:11:51 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g835BoJU026366 for ; Mon, 2 Sep 2002 22:11:50 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g835BoaE026363 for perforce@freebsd.org; Mon, 2 Sep 2002 22:11:50 -0700 (PDT) Date: Mon, 2 Sep 2002 22:11:50 -0700 (PDT) Message-Id: <200209030511.g835BoaE026363@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 16982 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=16982 Change 16982 by peter@peter_overcee on 2002/09/02 22:11:03 IFC @16981 Affected files ... .. //depot/projects/ia64/lib/libc/stdtime/localtime.c#6 integrate .. //depot/projects/ia64/sys/dev/isp/isp_freebsd.c#9 integrate .. //depot/projects/ia64/sys/dev/isp/isp_freebsd.h#12 integrate .. //depot/projects/ia64/sys/ia64/include/signal.h#4 integrate Differences ... ==== //depot/projects/ia64/lib/libc/stdtime/localtime.c#6 (text+ko) ==== @@ -9,7 +9,7 @@ #endif /* !defined NOID */ #endif /* !defined lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.32 2002/05/28 20:12:42 alfred Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.33 2002/09/03 04:34:10 peter Exp $"); /* ** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu). ==== //depot/projects/ia64/sys/dev/isp/isp_freebsd.c#9 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.84 2002/08/22 16:13:31 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.85 2002/09/03 04:31:55 mjacob Exp $ */ /* * Platform (FreeBSD) dependent common attachment code for Qlogic adapters. * @@ -234,7 +234,7 @@ } -static __inline void +static INLINE void isp_freeze_loopdown(struct ispsoftc *isp, char *msg) { if (isp->isp_osinfo.simqfrozen == 0) { @@ -521,15 +521,15 @@ #ifdef ISP_TARGET_MODE -static __inline int is_lun_enabled(struct ispsoftc *, int, lun_id_t); -static __inline int are_any_luns_enabled(struct ispsoftc *, int); -static __inline tstate_t *get_lun_statep(struct ispsoftc *, int, lun_id_t); -static __inline void rls_lun_statep(struct ispsoftc *, tstate_t *); -static __inline int isp_psema_sig_rqe(struct ispsoftc *, int); -static __inline int isp_cv_wait_timed_rqe(struct ispsoftc *, int, int); -static __inline void isp_cv_signal_rqe(struct ispsoftc *, int, int); -static __inline void isp_vsema_rqe(struct ispsoftc *, int); -static __inline atio_private_data_t *isp_get_atpd(struct ispsoftc *, int); +static INLINE int is_lun_enabled(struct ispsoftc *, int, lun_id_t); +static INLINE int are_any_luns_enabled(struct ispsoftc *, int); +static INLINE tstate_t *get_lun_statep(struct ispsoftc *, int, lun_id_t); +static INLINE void rls_lun_statep(struct ispsoftc *, tstate_t *); +static INLINE int isp_psema_sig_rqe(struct ispsoftc *, int); +static INLINE int isp_cv_wait_timed_rqe(struct ispsoftc *, int, int); +static INLINE void isp_cv_signal_rqe(struct ispsoftc *, int, int); +static INLINE void isp_vsema_rqe(struct ispsoftc *, int); +static INLINE atio_private_data_t *isp_get_atpd(struct ispsoftc *, int); static cam_status create_lun_state(struct ispsoftc *, int, struct cam_path *, tstate_t **); static void destroy_lun_state(struct ispsoftc *, tstate_t *); @@ -545,7 +545,7 @@ static int isp_handle_platform_notify_scsi(struct ispsoftc *, in_entry_t *); static int isp_handle_platform_notify_fc(struct ispsoftc *, in_fcentry_t *); -static __inline int +static INLINE int is_lun_enabled(struct ispsoftc *isp, int bus, lun_id_t lun) { tstate_t *tptr; @@ -561,7 +561,7 @@ return (0); } -static __inline int +static INLINE int are_any_luns_enabled(struct ispsoftc *isp, int port) { int lo, hi; @@ -580,7 +580,7 @@ return (0); } -static __inline tstate_t * +static INLINE tstate_t * get_lun_statep(struct ispsoftc *isp, int bus, lun_id_t lun) { tstate_t *tptr = NULL; @@ -607,53 +607,73 @@ return (tptr); } -static __inline void +static INLINE void rls_lun_statep(struct ispsoftc *isp, tstate_t *tptr) { if (tptr->hold) tptr->hold--; } -static __inline int +static INLINE int isp_psema_sig_rqe(struct ispsoftc *isp, int bus) { while (isp->isp_osinfo.tmflags[bus] & TM_BUSY) { isp->isp_osinfo.tmflags[bus] |= TM_WANTED; +#ifdef ISP_SMPLOCK if (cv_wait_sig(&isp->isp_osinfo.tgtcv0[bus], &isp->isp_lock)) { return (-1); } +#else + if (tsleep(&isp->isp_osinfo.tgtcv0[bus], PZERO, "cv_isp", 0)) { + return (-1); + } +#endif isp->isp_osinfo.tmflags[bus] |= TM_BUSY; } return (0); } -static __inline int +static INLINE int isp_cv_wait_timed_rqe(struct ispsoftc *isp, int bus, int timo) { +#ifdef ISP_SMPLOCK if (cv_timedwait(&isp->isp_osinfo.tgtcv1[bus], &isp->isp_lock, timo)) { return (-1); } +#else + if (tsleep(&isp->isp_osinfo.tgtcv1[bus], PZERO, "cv_isp1", 0)) { + return (-1); + } +#endif return (0); } -static __inline void +static INLINE void isp_cv_signal_rqe(struct ispsoftc *isp, int bus, int status) { isp->isp_osinfo.rstatus[bus] = status; +#ifdef ISP_SMPLOCK cv_signal(&isp->isp_osinfo.tgtcv1[bus]); +#else + wakeup(&isp->isp_osinfo.tgtcv1[bus]); +#endif } -static __inline void +static INLINE void isp_vsema_rqe(struct ispsoftc *isp, int bus) { if (isp->isp_osinfo.tmflags[bus] & TM_WANTED) { isp->isp_osinfo.tmflags[bus] &= ~TM_WANTED; +#ifdef ISP_SMPLOCK cv_signal(&isp->isp_osinfo.tgtcv0[bus]); +#else + cv_signal(&isp->isp_osinfo.tgtcv0[bus]); +#endif } isp->isp_osinfo.tmflags[bus] &= ~TM_BUSY; } -static __inline atio_private_data_t * +static INLINE atio_private_data_t * isp_get_atpd(struct ispsoftc *isp, int tag) { atio_private_data_t *atp; @@ -711,7 +731,7 @@ return (CAM_REQ_CMP); } -static __inline void +static INLINE void destroy_lun_state(struct ispsoftc *isp, tstate_t *tptr) { int hfx; @@ -1941,7 +1961,9 @@ { struct ispsoftc *isp = arg; +#ifdef ISP_SMPLOCK mtx_lock(&isp->isp_lock); +#endif /* * The first loop is for our usage where we have yet to have * gotten good fibre channel state. @@ -1959,8 +1981,12 @@ break; } } +#ifdef ISP_SMPLOCK msleep(isp_kthread, &isp->isp_lock, PRIBIO, "isp_fcthrd", hz); +#else + (void) tsleep(isp_kthread, PRIBIO, "isp_fcthrd", hz); +#endif } /* @@ -1978,7 +2004,11 @@ CAMLOCK_2_ISPLOCK(isp); } isp_prt(isp, ISP_LOGDEBUG0, "kthread: waiting until called"); +#ifdef ISP_SMPLOCK cv_wait(&isp->isp_osinfo.kthread_cv, &isp->isp_lock); +#else + (void) tsleep(&isp->isp_osinfo.kthread_cv, PRIBIO, "fc_cv", 0); +#endif } } @@ -2077,7 +2107,11 @@ xpt_done(ccb); break; } +#ifdef ISP_SMPLOCK cv_signal(&isp->isp_osinfo.kthread_cv); +#else + wakeup(&isp->isp_osinfo.kthread_cv); +#endif isp_freeze_loopdown(isp, "isp_action(RQLATER)"); XS_SETERR(ccb, CAM_REQUEUE_REQ); ISPLOCK_2_CAMLOCK(isp); @@ -2855,7 +2889,11 @@ isp_prt(isp, ISP_LOGINFO, "Name Server Database Changed"); } +#ifdef ISP_SMPLOCK cv_signal(&isp->isp_osinfo.kthread_cv); +#else + wakeup(&isp->isp_osinfo.kthread_cv); +#endif break; case ISPASYNC_FABRIC_DEV: { ==== //depot/projects/ia64/sys/dev/isp/isp_freebsd.h#12 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.68 2002/08/22 16:14:19 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.69 2002/09/03 04:31:55 mjacob Exp $ */ /* * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 by Matthew Jacob @@ -73,7 +73,8 @@ #endif #define HANDLE_LOOPSTATE_IN_OUTER_LAYERS 1 -#define ISP_SMPLOCK 1 +/* turn this off for now */ +/* #define ISP_SMPLOCK 1 */ #ifdef ISP_SMPLOCK #define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE @@ -165,12 +166,19 @@ * Locking macros... */ +#ifdef ISP_SMPLOCK #define ISP_LOCK(x) mtx_lock(&(x)->isp_lock) #define ISP_UNLOCK(x) mtx_unlock(&(x)->isp_lock) #define ISPLOCK_2_CAMLOCK(isp) \ mtx_unlock(&(isp)->isp_lock); mtx_lock(&Giant) #define CAMLOCK_2_ISPLOCK(isp) \ mtx_unlock(&Giant); mtx_lock(&(isp)->isp_lock) +#else +#define ISP_LOCK(x) do { } while (0) +#define ISP_UNLOCK(x) do { } while (0) +#define ISPLOCK_2_CAMLOCK(isp) do { } while (0) +#define CAMLOCK_2_ISPLOCK(isp) do { } while (0) +#endif /* * Required Macros/Defines @@ -411,8 +419,13 @@ if (isp->isp_osinfo.intsok) { int lim = ((isp->isp_mbxwrk0)? 120 : 20) * hz; isp->isp_osinfo.mboxwaiting = 1; +#ifdef ISP_SMPLOCK (void) msleep(&isp->isp_mbxworkp, &isp->isp_lock, PRIBIO, "isp_mboxwaiting", lim); +#else + (void) tsleep(&isp->isp_mbxworkp, + PRIBIO, "isp_mboxwaiting", lim); +#endif if (isp->isp_mboxbsy != 0) { isp_prt(isp, ISP_LOGWARN, "Interrupting Mailbox Command (0x%x) Timeout", ==== //depot/projects/ia64/sys/ia64/include/signal.h#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/ia64/include/signal.h,v 1.6 2002/04/10 19:24:08 dfr Exp $ */ +/* $FreeBSD: src/sys/ia64/include/signal.h,v 1.7 2002/09/03 04:30:00 peter Exp $ */ /* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */ /* @@ -75,7 +75,7 @@ */ typedef unsigned int osigset_t; struct osigcontext { - int _not_used; + int _not_used; }; /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message