[Midnightbsd-cvs] src [8835] trunk/sys/dev/twe/twe_compat.h: fixup file

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon Sep 26 00:01:48 EDT 2016


Revision: 8835
          http://svnweb.midnightbsd.org/src/?rev=8835
Author:   laffer1
Date:     2016-09-26 00:01:48 -0400 (Mon, 26 Sep 2016)
Log Message:
-----------
fixup file

Modified Paths:
--------------
    trunk/sys/dev/twe/twe_compat.h

Modified: trunk/sys/dev/twe/twe_compat.h
===================================================================
--- trunk/sys/dev/twe/twe_compat.h	2016-09-26 03:59:24 UTC (rev 8834)
+++ trunk/sys/dev/twe/twe_compat.h	2016-09-26 04:01:48 UTC (rev 8835)
@@ -1,4 +1,3 @@
-/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2000 Michael Smith
  * Copyright (c) 2003 Paul Saab
@@ -27,15 +26,15 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $MidnightBSD$
  */
 /*
  * Portability and compatibility interfaces.
  */
 
-#if defined(__FreeBSD__) || defined(__MidnightBSD__)
+#if defined(__MidnightBSD__) || defined(__FreeBSD__)
 /******************************************************************************
- * FreeBSD or MidnightBSD
+ * FreeBSD
  */
 #define TWE_SUPPORTED_PLATFORM
 
@@ -112,26 +111,12 @@
 #define twe_printf(sc, fmt, args...)	device_printf(sc->twe_dev, fmt , ##args)
 #define twed_printf(twed, fmt, args...)	device_printf(twed->twed_dev, fmt , ##args)
 
-#include <sys/bio.h>
-#include <geom/geom_disk.h>
-typedef struct bio			twe_bio;
-typedef struct bio_queue_head		twe_bioq;
-#define TWE_BIO_QINIT(bq)		bioq_init(&bq);
-#define TWE_BIO_QINSERT(bq, bp)	bioq_insert_tail(&bq, bp)
-#define TWE_BIO_QFIRST(bq)		bioq_first(&bq)
-#define TWE_BIO_QREMOVE(bq, bp)	bioq_remove(&bq, bp)
-#define TWE_BIO_IS_READ(bp)		((bp)->bio_cmd == BIO_READ)
-#define TWE_BIO_DATA(bp)		(bp)->bio_data
-#define TWE_BIO_LENGTH(bp)		(bp)->bio_bcount
-#define TWE_BIO_LBA(bp)		(bp)->bio_pblkno
-#define TWE_BIO_SOFTC(bp)		(bp)->bio_disk->d_drv1
-#define TWE_BIO_UNIT(bp)		*(int *)(bp->bio_driver1)
-#define TWE_BIO_SET_ERROR(bp, err)	do { (bp)->bio_error = err; (bp)->bio_flags |= BIO_ERROR;} while(0)
-#define TWE_BIO_HAS_ERROR(bp)		((bp)->bio_flags & BIO_ERROR)
-#define TWE_BIO_RESID(bp)		(bp)->bio_resid
-#define TWE_BIO_DONE(bp)		biodone(bp)
-#define TWE_BIO_STATS_START(bp)
-#define TWE_BIO_STATS_END(bp)
+#define	TWE_IO_LOCK(sc)			mtx_lock(&(sc)->twe_io_lock)
+#define	TWE_IO_UNLOCK(sc)		mtx_unlock(&(sc)->twe_io_lock)
+#define	TWE_IO_ASSERT_LOCKED(sc)	mtx_assert(&(sc)->twe_io_lock, MA_OWNED)
+#define	TWE_CONFIG_LOCK(sc)		sx_xlock(&(sc)->twe_config_lock)
+#define	TWE_CONFIG_UNLOCK(sc)		sx_xunlock(&(sc)->twe_config_lock)
+#define	TWE_CONFIG_ASSERT_LOCKED(sc)	sx_assert(&(sc)->twe_config_lock, SA_XLOCKED)
 
 #endif /* FreeBSD */
 



More information about the Midnightbsd-cvs mailing list