Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Use atomic_ops to manipulate sc_intmask



details:   https://anonhg.NetBSD.org/src/rev/decf7faa543e
branches:  trunk
changeset: 782284:decf7faa543e
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Oct 26 05:11:34 2012 +0000

description:
Use atomic_ops to manipulate sc_intmask

diffstat:

 sys/arch/arm/broadcom/bcm53xx_eth.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (82 lines):

diff -r affaa99da323 -r decf7faa543e sys/arch/arm/broadcom/bcm53xx_eth.c
--- a/sys/arch/arm/broadcom/bcm53xx_eth.c       Fri Oct 26 04:46:06 2012 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_eth.c       Fri Oct 26 05:11:34 2012 +0000
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.12 2012/10/18 02:34:34 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_eth.c,v 1.13 2012/10/26 05:11:34 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -1582,7 +1582,7 @@
                if (intstatus & RCVINT) {
                        struct bcmeth_rxqueue * const rxq = &sc->sc_rxq;
                        intstatus &= ~RCVINT;
-                       sc->sc_intmask &= ~RCVINT;
+                       atomic_and_32(&sc->sc_intmask, (uint32_t)~RCVINT);
 
                        uint32_t rcvsts0 = bcmeth_read_4(sc, rxq->rxq_reg_rcvsts0);
                        uint32_t descs = __SHIFTOUT(rcvsts0, RCV_CURRDSCR);
@@ -1611,13 +1611,13 @@
 
                if (intstatus & XMTINT_0) {
                        intstatus &= ~XMTINT_0;
-                       sc->sc_intmask &= ~XMTINT_0;
+                       atomic_and_32(&sc->sc_intmask, (uint32_t)~XMTINT_0);
                        soft_flags |= SOFT_TXINTR;
                }
 
                if (intstatus & RCVDESCUF) {
                        intstatus &= ~RCVDESCUF;
-                       sc->sc_intmask &= ~RCVDESCUF;
+                       atomic_and_32(&sc->sc_intmask, (uint32_t)~RCVDESCUF);
                        work_flags |= WORK_RXUNDERFLOW;
                }
 
@@ -1639,7 +1639,7 @@
                            bcmeth_read_4(sc, sc->sc_txq.txq_reg_xmtsts0),
                            bcmeth_read_4(sc, sc->sc_txq.txq_reg_xmtsts1));
                        Debugger();
-                       sc->sc_intmask &= ~intstatus;
+                       atomic_and_32(&sc->sc_intmask, ~intstatus);
                        work_flags |= WORK_REINIT;
                        break;
                }
@@ -1695,7 +1695,7 @@
                } else {
                        ifp->if_flags &= ~IFF_OACTIVE;
                }
-               sc->sc_intmask |= XMTINT_0;
+               atomic_or_32(&sc->sc_intmask, XMTINT_0);
        }
 
        if (soft_flags & SOFT_RXINTR) {
@@ -1703,7 +1703,7 @@
                 * Let's consume 
                 */
                bcmeth_rxq_consume(sc, &sc->sc_rxq);
-               sc->sc_intmask |= RCVINT;
+               atomic_or_32(&sc->sc_intmask, RCVINT);
        }
 
        if (ifp->if_flags & IFF_RUNNING) {
@@ -1739,7 +1739,7 @@
                if (threshold >= rxq->rxq_last - rxq->rxq_first) {
                        threshold = rxq->rxq_last - rxq->rxq_first - 1;
                } else {
-                       sc->sc_intmask |= RCVDESCUF;
+                       atomic_or_32(&sc->sc_intmask, RCVDESCUF);
                }
                aprint_normal_dev(sc->sc_dev,
                    "increasing receive buffers from %zu to %zu\n",
@@ -1752,7 +1752,7 @@
                 * Let's consume 
                 */
                bcmeth_rxq_consume(sc, &sc->sc_rxq);
-               sc->sc_intmask |= RCVINT;
+               atomic_or_32(&sc->sc_intmask, RCVINT);
        }
 
        if (ifp->if_flags & IFF_RUNNING) {



Home | Main Index | Thread Index | Old Index