Module Name: src
Committed By: dyoung
Date: Tue Dec 20 21:27:29 UTC 2011
Modified Files:
src/sys/dev/pci: if_wmreg.h
Log Message:
Mark all of the Rx descriptor fields 'volatile' so that the compiler
will not re-order accesses. Some versions of GCC (such as one in NetBSD
5.x) definitely do re-order reads from these fields if they're not
marked volatile.
To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/pci/if_wmreg.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_wmreg.h
diff -u src/sys/dev/pci/if_wmreg.h:1.45 src/sys/dev/pci/if_wmreg.h:1.46
--- src/sys/dev/pci/if_wmreg.h:1.45 Fri May 20 01:51:36 2011
+++ src/sys/dev/pci/if_wmreg.h Tue Dec 20 21:27:29 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wmreg.h,v 1.45 2011/05/20 01:51:36 msaitoh Exp $ */
+/* $NetBSD: if_wmreg.h,v 1.46 2011/12/20 21:27:29 dyoung Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -57,14 +57,14 @@ typedef struct wiseman_addr {
* and there must be an even multiple of 8 descriptors in the ring.
*/
typedef struct wiseman_rxdesc {
- wiseman_addr_t wrx_addr; /* buffer address */
+ volatile wiseman_addr_t wrx_addr; /* buffer address */
- uint16_t wrx_len; /* buffer length */
- uint16_t wrx_cksum; /* checksum (starting at PCSS) */
+ volatile uint16_t wrx_len; /* buffer length */
+ volatile uint16_t wrx_cksum; /* checksum (starting at PCSS)*/
- uint8_t wrx_status; /* Rx status */
- uint8_t wrx_errors; /* Rx errors */
- uint16_t wrx_special; /* special field (VLAN, etc.) */
+ volatile uint8_t wrx_status; /* Rx status */
+ volatile uint8_t wrx_errors; /* Rx errors */
+ volatile uint16_t wrx_special; /* special field (VLAN, etc.) */
} __packed wiseman_rxdesc_t;
/* wrx_status bits */