Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/dev/ata Pullup rev 1.28 (requested by bouyer in tic...



details:   https://anonhg.NetBSD.org/src/rev/ebe36b5bb754
branches:  netbsd-2-0
changeset: 560444:ebe36b5bb754
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sun Apr 18 02:23:45 2004 +0000

description:
Pullup rev 1.28 (requested by bouyer in ticket #149)

Make wdc_channel->ch_flags volatile, and cast it to (void *) when used
in tsleep()/wakeup() to appease gcc. Otherwise, the ch_flags value may
be cached in a register in atabus_thread(), and when it sets the WDCF_TH_RUN
bit after tsleep() it may loose loose the changes made by an interrupt handler
or another thread.

diffstat:

 sys/dev/ata/ata.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r c8db4bad0d7c -r ebe36b5bb754 sys/dev/ata/ata.c
--- a/sys/dev/ata/ata.c Sun Apr 18 02:23:41 2004 +0000
+++ b/sys/dev/ata/ata.c Sun Apr 18 02:23:45 2004 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ata.c,v 1.27 2004/01/03 23:59:58 thorpej Exp $      */
+/*      $NetBSD: ata.c,v 1.27.2.1 2004/04/18 02:23:45 jmc Exp $      */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.27 2004/01/03 23:59:58 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.27.2.1 2004/04/18 02:23:45 jmc Exp $");
 
 #ifndef WDCDEBUG
 #define WDCDEBUG
@@ -165,7 +165,7 @@
                splx(s);
        }
        chp->ch_thread = NULL;
-       wakeup(&chp->ch_flags);
+       wakeup((void *)&chp->ch_flags);
        kthread_exit(0);
 }
 
@@ -307,7 +307,7 @@
        chp->ch_flags |= WDCF_SHUTDOWN;
        wakeup(&chp->ch_thread);
        while (chp->ch_thread != NULL)
-               (void) tsleep(&chp->ch_flags, PRIBIO, "atadown", 0);
+               (void) tsleep((void *)&chp->ch_flags, PRIBIO, "atadown", 0);
        
        /*
         * Detach atapibus and its children.



Home | Main Index | Thread Index | Old Index