summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2007-06-14 12:52:13 +0000
committersimokawa <simokawa@FreeBSD.org>2007-06-14 12:52:13 +0000
commitb325dde99be727bd2862bde1914e4c08f915434d (patch)
tree861baae7eb8b4a3adf206bc268e66c1ae5035243 /sys/dev/firewire
parentb43d30ed2c855e05b02ead131136784ad708491e (diff)
downloadFreeBSD-src-b325dde99be727bd2862bde1914e4c08f915434d.zip
FreeBSD-src-b325dde99be727bd2862bde1914e4c08f915434d.tar.gz
- Suppress compiler optimization so that orb[1] must be written first.
We may need an explicit memory barrier for other architectures other than i386/amd64. MFC after: 3 days
Diffstat (limited to 'sys/dev/firewire')
-rw-r--r--sys/dev/firewire/sbp.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 6dc4de9..af70146 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -2829,8 +2829,13 @@ SBP_DEBUG(2)
(uintmax_t)prev2->bus_addr, (uintmax_t)ocb->bus_addr);
#endif
END_DEBUG
- prev2->orb[1] = htonl(ocb->bus_addr);
- prev2->orb[0] = 0;
+ /*
+ * Suppress compiler optimization so that orb[1] must be written first.
+ * XXX We may need an explicit memory barrier for other architectures
+ * other than i386/amd64.
+ */
+ *(volatile uint32_t *)&prev2->orb[1] = htonl(ocb->bus_addr);
+ *(volatile uint32_t *)&prev2->orb[0] = 0;
}
splx(s);
OpenPOWER on IntegriCloud