summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>1998-02-11 01:27:30 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>1998-02-11 01:27:30 +0000
commit6206d519a4d9d51d2be6bf08af045a6921be0604 (patch)
treef616aeaf0412268ee70a9eb639c7125ded34f638 /sys/arch
parent2203688ff516ce2e93770314d6309c08b579b576 (diff)
From NetBSD: sun4m anti crash code in IOMMU_FLUSH{PAGE,ALL}
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/sparc/iommureg.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/sparc/sparc/iommureg.h b/sys/arch/sparc/sparc/iommureg.h
index c1021afcc55..8d49bf68b3f 100644
--- a/sys/arch/sparc/sparc/iommureg.h
+++ b/sys/arch/sparc/sparc/iommureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iommureg.h,v 1.3 1997/09/17 06:47:17 downsj Exp $ */
+/* $OpenBSD: iommureg.h,v 1.4 1998/02/11 01:27:29 marc Exp $ */
/* $NetBSD: iommureg.h,v 1.3 1997/09/14 19:16:04 pk Exp $ */
/*
@@ -60,11 +60,19 @@ struct iommureg {
#define IOMMU_FLPG_VADDR 0xfffff000
#define IOMMU_FLUSH_MASK 0xfffff000
+/*
+ * Read something back from the IOMMU control space after writing
+ * to a flush register to drain write buffers (?). This seems to
+ * avoid utter lossage on some machines (SS4s & SS5s) where our caller
+ * would see some of its local (`%lx') registers trashed.
+ */
#define IOMMU_FLUSHPAGE(sc, va) do { \
(sc)->sc_reg->io_flushpage = (va) & IOMMU_FLUSH_MASK; \
+ (*(volatile u_int32_t *)&(sc)->sc_reg->io_bar); \
} while (0);
#define IOMMU_FLUSHALL(sc) do { \
(sc)->sc_reg->io_flashclear = 0; \
+ (*(volatile u_int32_t *)&(sc)->sc_reg->io_bar); \
} while (0)
/* to pte.h ? */