From 3fe4f9fc4578a762620a7556197049968a66cd08 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Fri, 16 Feb 2007 13:43:00 +0000 Subject: [PATCH] Make DMA descriptors volatile to avoid unintended reordering which might cause some race condition. --- sys/dev/ic/smc83c170reg.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/ic/smc83c170reg.h b/sys/dev/ic/smc83c170reg.h index d24571702b62..71d6142af488 100644 --- a/sys/dev/ic/smc83c170reg.h +++ b/sys/dev/ic/smc83c170reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: smc83c170reg.h,v 1.11 2006/04/16 00:38:59 tsutsui Exp $ */ +/* $NetBSD: smc83c170reg.h,v 1.12 2007/02/16 13:43:00 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -49,10 +49,10 @@ * EPIC transmit descriptor. Must be 4-byte aligned. */ struct epic_txdesc { - uint32_t et_txstatus; /* transmit status; see below */ - uint32_t et_bufaddr; /* buffer address */ - uint32_t et_control; /* control word; see below */ - uint32_t et_nextdesc; /* next descriptor pointer */ + volatile uint32_t et_txstatus; /* transmit status; see below */ + volatile uint32_t et_bufaddr; /* buffer address */ + volatile uint32_t et_control; /* control word; see below */ + volatile uint32_t et_nextdesc; /* next descriptor pointer */ }; /* et_txstatus */ @@ -86,10 +86,10 @@ struct epic_txdesc { * EPIC receive descriptor. Must be 4-byte aligned. */ struct epic_rxdesc { - uint32_t er_rxstatus; /* receive status; see below */ - uint32_t er_bufaddr; /* buffer address */ - uint32_t er_control; /* control word; see below */ - uint32_t er_nextdesc; /* next descriptor pointer */ + volatile uint32_t er_rxstatus; /* receive status; see below */ + volatile uint32_t er_bufaddr; /* buffer address */ + volatile uint32_t er_control; /* control word; see below */ + volatile uint32_t er_nextdesc; /* next descriptor pointer */ }; /* er_rxstatus */ @@ -126,10 +126,10 @@ struct epic_rxdesc { * EPIC fraglist descriptor. */ struct epic_fraglist { - uint32_t ef_nfrags; /* number of frags in list */ + volatile uint32_t ef_nfrags; /* number of frags in list */ struct { - uint32_t ef_addr; /* address of frag */ - uint32_t ef_length; /* length of frag */ + volatile uint32_t ef_addr; /* address of frag */ + volatile uint32_t ef_length; /* length of frag */ } ef_frags[EPIC_NFRAGS]; };