Index: alpha/alpha/busdma_machdep.c
===================================================================
RCS file: /space2/ncvs/src/sys/alpha/alpha/busdma_machdep.c,v
retrieving revision 1.33
diff -u -p -r1.33 busdma_machdep.c
--- alpha/alpha/busdma_machdep.c	20 Mar 2003 19:45:26 -0000	1.33
+++ alpha/alpha/busdma_machdep.c	8 Apr 2003 00:25:07 -0000
@@ -788,7 +788,7 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b
 }
 
 void
-_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
+_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, int op)
 {
 	struct bounce_page *bpage;
 
@@ -799,28 +799,22 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus
 		 * want to add support for invalidating
 		 * the caches on broken hardware
 		 */
-		switch (op) {
-		case BUS_DMASYNC_PREWRITE:
+		if (op & BUS_DMASYNC_PREWRITE) {
 			while (bpage != NULL) {
 				bcopy((void *)bpage->datavaddr,
 				      (void *)bpage->vaddr,
 				      bpage->datacount);
 				bpage = STAILQ_NEXT(bpage, links);
 			}
-			break;
+		}
 
-		case BUS_DMASYNC_POSTREAD:
+		if (op & BUS_DMASYNC_POSTREAD) {
 			while (bpage != NULL) {
 				bcopy((void *)bpage->vaddr,
 				      (void *)bpage->datavaddr,
 				      bpage->datacount);
 				bpage = STAILQ_NEXT(bpage, links);
 			}
-			break;
-		case BUS_DMASYNC_PREREAD:
-		case BUS_DMASYNC_POSTWRITE:
-			/* No-ops */
-			break;
 		}
 	}
 }
Index: alpha/include/bus.h
===================================================================
RCS file: /space2/ncvs/src/sys/alpha/include/bus.h,v
retrieving revision 1.17
diff -u -p -r1.17 bus.h
--- alpha/include/bus.h	26 Feb 2003 02:16:05 -0000	1.17
+++ alpha/include/bus.h	8 Apr 2003 00:27:37 -0000
@@ -480,16 +480,12 @@ struct mbuf;
 struct uio;
 
 /*
- *	bus_dmasync_op_t
- *
  *	Operations performed by bus_dmamap_sync().
  */
-typedef enum {
-	BUS_DMASYNC_PREREAD,
-	BUS_DMASYNC_POSTREAD,
-	BUS_DMASYNC_PREWRITE,
-	BUS_DMASYNC_POSTWRITE
-} bus_dmasync_op_t;
+#define	BUS_DMASYNC_PREREAD	1
+#define	BUS_DMASYNC_POSTREAD	2
+#define	BUS_DMASYNC_PREWRITE	4
+#define	BUS_DMASYNC_POSTWRITE	8
 
 /*
  *	bus_dma_tag_t
@@ -625,7 +621,7 @@ int bus_dmamap_load_uio(bus_dma_tag_t dm
 /*
  * Perform a syncronization operation on the given map.
  */
-void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_dmasync_op_t);
+void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, int);
 #define bus_dmamap_sync(dmat, dmamap, op) 		\
 	if ((dmamap) != NULL)				\
 		_bus_dmamap_sync(dmat, dmamap, op)
Index: i386/i386/busdma_machdep.c
===================================================================
RCS file: /space2/ncvs/src/sys/i386/i386/busdma_machdep.c,v
retrieving revision 1.39
diff -u -p -r1.39 busdma_machdep.c
--- i386/i386/busdma_machdep.c	7 Apr 2003 16:08:32 -0000	1.39
+++ i386/i386/busdma_machdep.c	7 Apr 2003 17:18:23 -0000
@@ -784,39 +784,32 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b
 }
 
 void
-_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
+_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, int op)
 {
 	struct bounce_page *bpage;
 
 	if ((bpage = STAILQ_FIRST(&map->bpages)) != NULL) {
-		
 		/*
 		 * Handle data bouncing.  We might also
 		 * want to add support for invalidating
 		 * the caches on broken hardware
 		 */
-		switch (op) {
-		case BUS_DMASYNC_PREWRITE:
+		if (op & BUS_DMASYNC_PREWRITE) {
 			while (bpage != NULL) {
 				bcopy((void *)bpage->datavaddr,
 				      (void *)bpage->vaddr,
 				      bpage->datacount);
 				bpage = STAILQ_NEXT(bpage, links);
 			}
-			break;
+		}
 
-		case BUS_DMASYNC_POSTREAD:
+		if (op & BUS_DMASYNC_POSTREAD) {
 			while (bpage != NULL) {
 				bcopy((void *)bpage->vaddr,
 				      (void *)bpage->datavaddr,
 				      bpage->datacount);
 				bpage = STAILQ_NEXT(bpage, links);
 			}
-			break;
-		case BUS_DMASYNC_PREREAD:
-		case BUS_DMASYNC_POSTWRITE:
-			/* No-ops */
-			break;
 		}
 	}
 }
Index: i386/include/bus_dma.h
===================================================================
RCS file: /space2/ncvs/src/sys/i386/include/bus_dma.h,v
retrieving revision 1.17
diff -u -p -r1.17 bus_dma.h
--- i386/include/bus_dma.h	29 Jan 2003 07:25:26 -0000	1.17
+++ i386/include/bus_dma.h	5 Apr 2003 15:33:29 -0000
@@ -89,16 +89,12 @@ struct mbuf;
 struct uio;
 
 /*
- *	bus_dmasync_op_t
- *
- *	Operations performed by bus_dmamap_sync().
+ * Operations performed by bus_dmamap_sync().
  */
-typedef enum {
-	BUS_DMASYNC_PREREAD,
-	BUS_DMASYNC_POSTREAD,
-	BUS_DMASYNC_PREWRITE,
-	BUS_DMASYNC_POSTWRITE
-} bus_dmasync_op_t;
+#define	BUS_DMASYNC_PREREAD	1
+#define	BUS_DMASYNC_POSTREAD	2
+#define	BUS_DMASYNC_PREWRITE	4
+#define	BUS_DMASYNC_POSTWRITE	8
 
 /*
  *	bus_dma_tag_t
@@ -234,7 +230,7 @@ int bus_dmamap_load_uio(bus_dma_tag_t dm
 /*
  * Perform a syncronization operation on the given map.
  */
-void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, bus_dmasync_op_t);
+void _bus_dmamap_sync(bus_dma_tag_t, bus_dmamap_t, int);
 #define bus_dmamap_sync(dmat, dmamap, op) 		\
 	if ((dmamap) != NULL)				\
 		_bus_dmamap_sync(dmat, dmamap, op)
Index: ia64/ia64/busdma_machdep.c
===================================================================
RCS file: /space2/ncvs/src/sys/ia64/ia64/busdma_machdep.c,v
retrieving revision 1.21
diff -u -p -r1.21 busdma_machdep.c
--- ia64/ia64/busdma_machdep.c	20 Mar 2003 19:45:26 -0000	1.21
+++ ia64/ia64/busdma_machdep.c	8 Apr 2003 00:28:45 -0000
@@ -766,7 +766,7 @@ _bus_dmamap_unload(bus_dma_tag_t dmat, b
 }
 
 void
-_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
+_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, int op)
 {
 	struct bounce_page *bpage;
 
@@ -777,28 +777,22 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus
 		 * want to add support for invalidating
 		 * the caches on broken hardware
 		 */
-		switch (op) {
-		case BUS_DMASYNC_PREWRITE:
+		if (op & BUS_DMASYNC_PREWRITE) {
 			while (bpage != NULL) {
 				bcopy((void *)bpage->datavaddr,
 				      (void *)bpage->vaddr,
 				      bpage->datacount);
 				bpage = STAILQ_NEXT(bpage, links);
 			}
-			break;
+		}
 
-		case BUS_DMASYNC_POSTREAD:
+		if (op & BUS_DMASYNC_POSTREAD) {
 			while (bpage != NULL) {
 				bcopy((void *)bpage->vaddr,
 				      (void *)bpage->datavaddr,
 				      bpage->datacount);
 				bpage = STAILQ_NEXT(bpage, links);
 			}
-			break;
-		case BUS_DMASYNC_PREREAD:
-		case BUS_DMASYNC_POSTWRITE:
-			/* No-ops */
-			break;
 		}
 	}
 }
Index: powerpc/powerpc/busdma_machdep.c
===================================================================
RCS file: /space2/ncvs/src/sys/powerpc/powerpc/busdma_machdep.c,v
retrieving revision 1.11
diff -u -p -r1.11 busdma_machdep.c
--- powerpc/powerpc/busdma_machdep.c	3 Apr 2003 21:36:33 -0000	1.11
+++ powerpc/powerpc/busdma_machdep.c	8 Apr 2003 00:31:47 -0000
@@ -522,7 +522,7 @@ bus_dmamap_unload(bus_dma_tag_t dmat, bu
 }
 
 void
-bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op)
+bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, int op)
 {
 
 	return;
Index: sparc64/include/bus.h
===================================================================
RCS file: /space2/ncvs/src/sys/sparc64/include/bus.h,v
retrieving revision 1.22
diff -u -p -r1.22 bus.h
--- sparc64/include/bus.h	26 Feb 2003 02:16:06 -0000	1.22
+++ sparc64/include/bus.h	8 Apr 2003 00:18:45 -0000
@@ -905,12 +905,10 @@ memsetw(void *d, int val, size_t size)
 struct mbuf;
 struct uio;
 
-typedef enum {
-	BUS_DMASYNC_PREREAD,
-	BUS_DMASYNC_POSTREAD,
-	BUS_DMASYNC_PREWRITE,
-	BUS_DMASYNC_POSTWRITE,
-} bus_dmasync_op_t;
+#define	BUS_DMASYNC_PREREAD	1
+#define	BUS_DMASYNC_POSTREAD	2
+#define	BUS_DMASYNC_PREWRITE	4
+#define	BUS_DMASYNC_POSTWRITE	8
 
 /*
  * A function that returns 1 if the address cannot be accessed by
@@ -977,7 +975,7 @@ struct bus_dma_tag {
 	    bus_dmamap_t, struct uio *, bus_dmamap_callback2_t *, void *, int);
 	void	(*dt_dmamap_unload)(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
 	void	(*dt_dmamap_sync)(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
-	    bus_dmasync_op_t);
+	    int);
 
 	/*
 	 * DMA memory utility functions.
@@ -1086,8 +1084,7 @@ sparc64_dmamap_unload(bus_dma_tag_t pt, 
 	sparc64_dmamap_unload((t), (t), (p))
 
 static __inline void
-sparc64_dmamap_sync(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t m,
-    bus_dmasync_op_t op)
+sparc64_dmamap_sync(bus_dma_tag_t pt, bus_dma_tag_t dt, bus_dmamap_t m, int op)
 {
 	bus_dma_tag_t lt;
 
Index: sparc64/pci/psycho.c
===================================================================
RCS file: /space2/ncvs/src/sys/sparc64/pci/psycho.c,v
retrieving revision 1.29
diff -u -p -r1.29 psycho.c
--- sparc64/pci/psycho.c	19 Feb 2003 05:47:44 -0000	1.29
+++ sparc64/pci/psycho.c	8 Apr 2003 00:18:52 -0000
@@ -111,8 +111,7 @@ static int psycho_dmamap_load_mbuf(bus_d
 static int psycho_dmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
     struct uio *, bus_dmamap_callback2_t *, void *, int);
 static void psycho_dmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
-static void psycho_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
-    bus_dmasync_op_t);
+static void psycho_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, int);
 static int psycho_dmamem_alloc_size(bus_dma_tag_t, bus_dma_tag_t, void **, int,
     bus_dmamap_t *, bus_size_t size);
 static int psycho_dmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
@@ -1429,7 +1428,7 @@ psycho_dmamap_unload(bus_dma_tag_t pdmat
 
 static void
 psycho_dmamap_sync(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
-    bus_dmasync_op_t op)
+    int op)
 {
 	struct psycho_softc *sc;
 
Index: sparc64/sbus/sbus.c
===================================================================
RCS file: /space2/ncvs/src/sys/sparc64/sbus/sbus.c,v
retrieving revision 1.14
diff -u -p -r1.14 sbus.c
--- sparc64/sbus/sbus.c	19 Feb 2003 05:47:44 -0000	1.14
+++ sparc64/sbus/sbus.c	8 Apr 2003 00:19:17 -0000
@@ -242,8 +242,7 @@ static int sbus_dmamap_load_mbuf(bus_dma
 static int sbus_dmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
     struct uio *, bus_dmamap_callback2_t *, void *, int);
 static void sbus_dmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
-static void sbus_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
-    bus_dmasync_op_t);
+static void sbus_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, int);
 static int sbus_dmamem_alloc_size(bus_dma_tag_t, bus_dma_tag_t, void **, int,
     bus_dmamap_t *, bus_size_t size);
 static int sbus_dmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
@@ -986,7 +985,7 @@ sbus_dmamap_unload(bus_dma_tag_t pdmat, 
 
 static void
 sbus_dmamap_sync(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
-    bus_dmasync_op_t op)
+    int)
 {
 	struct sbus_softc *sc = (struct sbus_softc *)pdmat->dt_cookie;
 
Index: sparc64/sparc64/bus_machdep.c
===================================================================
RCS file: /space2/ncvs/src/sys/sparc64/sparc64/bus_machdep.c,v
retrieving revision 1.24
diff -u -p -r1.24 bus_machdep.c
--- sparc64/sparc64/bus_machdep.c	20 Mar 2003 19:45:26 -0000	1.24
+++ sparc64/sparc64/bus_machdep.c	8 Apr 2003 00:31:31 -0000
@@ -169,8 +169,7 @@ static int nexus_dmamap_load_mbuf(bus_dm
 static int nexus_dmamap_load_uio(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
     struct uio *, bus_dmamap_callback2_t *, void *, int);
 static void nexus_dmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
-static void nexus_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t,
-    bus_dmasync_op_t);
+static void nexus_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, int);
 static int nexus_dmamem_alloc_size(bus_dma_tag_t, bus_dma_tag_t, void **, int,
     bus_dmamap_t *, u_long size);
 static int nexus_dmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
@@ -556,7 +555,7 @@ nexus_dmamap_unload(bus_dma_tag_t pdmat,
  */
 static void
 nexus_dmamap_sync(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, bus_dmamap_t map,
-    bus_dmasync_op_t op)
+    int op)
 {
 
 	/*
@@ -564,7 +563,7 @@ nexus_dmamap_sync(bus_dma_tag_t pdmat, b
 	 *
 	 * Actually a #Sync is expensive.  We should optimize.
 	 */
-	if ((op == BUS_DMASYNC_PREREAD) || (op == BUS_DMASYNC_PREWRITE)) {
+	if ((op & BUS_DMASYNC_PREREAD) || (op & BUS_DMASYNC_PREWRITE)) {
 		/* 
 		 * Don't really need to do anything, but flush any pending
 		 * writes anyway. 
@@ -573,12 +572,12 @@ nexus_dmamap_sync(bus_dma_tag_t pdmat, b
 	}
 #if 0
 	/* Should not be needed. */
-	if (op == BUS_DMASYNC_POSTREAD) {
+	if (op & BUS_DMASYNC_POSTREAD) {
 		ecache_flush((vm_offset_t)map->buf,
 		    (vm_offset_t)map->buf + map->buflen - 1);
 	}
 #endif
-	if (op == BUS_DMASYNC_POSTWRITE) {
+	if (op & BUS_DMASYNC_POSTWRITE) {
 		/* Nothing to do.  Handled by the bus controller. */
 	}
 }
Index: sparc64/sparc64/iommu.c
===================================================================
RCS file: /space2/ncvs/src/sys/sparc64/sparc64/iommu.c,v
retrieving revision 1.21
diff -u -p -r1.21 iommu.c
--- sparc64/sparc64/iommu.c	26 Feb 2003 15:02:55 -0000	1.21
+++ sparc64/sparc64/iommu.c	8 Apr 2003 00:34:40 -0000
@@ -1011,18 +1011,16 @@ iommu_dvmamap_unload(bus_dma_tag_t pt, b
 
 void
 iommu_dvmamap_sync(bus_dma_tag_t pt, bus_dma_tag_t dt, struct iommu_state *is,
-    bus_dmamap_t map, bus_dmasync_op_t op)
+    bus_dmamap_t map, int op)
 {
 	struct bus_dmamap_res *r;
 	vm_offset_t va;
 	vm_size_t len;
 
-	switch (op) {
-	case BUS_DMASYNC_PREREAD:
+	/* XXX This is probably bogus. */
+	if (op & BUS_DMASYNC_PREREAD)
 		membar(Sync);
-		break;
-	case BUS_DMASYNC_POSTREAD:
-	case BUS_DMASYNC_PREWRITE:
+	if ((op & BUS_DMASYNC_POSTREAD) || (op & BUS_DMASYNC_PREWRITE)) {
 		SLIST_FOREACH(r, &map->dm_reslist, dr_link) {
 			va = (vm_offset_t)BDR_START(r);
 			len = r->dr_used;
@@ -1034,14 +1032,8 @@ iommu_dvmamap_sync(bus_dma_tag_t pt, bus
 				va += IO_PAGE_SIZE;
 			}
 		}
-		if (op == BUS_DMASYNC_PREWRITE)
+		if (op & BUS_DMASYNC_PREWRITE)
 			membar(Sync);
-		break;
-	case BUS_DMASYNC_POSTWRITE:
-		/* Nothing to do. */
-		break;
-	default:
-		panic("iommu_dvmamap_sync: bogus op %d", op);
 	}
 }
 
