Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga/dev detect a4000 hardware only once, then use...



details:   https://anonhg.NetBSD.org/src/rev/70934c8806b0
branches:  trunk
changeset: 337534:70934c8806b0
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Apr 18 14:21:41 2015 +0000

description:
detect a4000 hardware only once, then use the result.

diffstat:

 sys/arch/amiga/dev/wdc_amiga.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r d927b2bb1e68 -r 70934c8806b0 sys/arch/amiga/dev/wdc_amiga.c
--- a/sys/arch/amiga/dev/wdc_amiga.c    Sat Apr 18 14:09:32 2015 +0000
+++ b/sys/arch/amiga/dev/wdc_amiga.c    Sat Apr 18 14:21:41 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_amiga.c,v 1.37 2014/01/03 00:33:06 rkujawa Exp $ */
+/*     $NetBSD: wdc_amiga.c,v 1.38 2015/04/18 14:21:41 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.37 2014/01/03 00:33:06 rkujawa Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.38 2015/04/18 14:21:41 mlelstv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -61,6 +61,7 @@
        struct isr sc_isr;
        struct bus_space_tag cmd_iot;
        struct bus_space_tag ctl_iot;
+       bool gayle_intr;
 };
 
 int    wdc_amiga_probe(device_t, cfdata_t, void *);
@@ -95,8 +96,10 @@
 
        if (is_a4000()) {
                sc->cmd_iot.base = (bus_addr_t) ztwomap(GAYLE_IDE_BASE_A4000 + 2);
+               sc->gayle_intr = false;
        } else {
                sc->cmd_iot.base = (bus_addr_t) ztwomap(GAYLE_IDE_BASE + 2);
+               sc->gayle_intr = true;
        }
 
        sc->cmd_iot.absm = sc->ctl_iot.absm = &amiga_bus_stride_4swap;
@@ -142,7 +145,7 @@
        sc->sc_isr.isr_ipl = 2;
        add_isr (&sc->sc_isr);
 
-       if (!is_a4000())
+       if (sc->gayle_intr)
                gayle_intr_enable_set(GAYLE_INT_IDE);
 
        wdcattach(&sc->sc_channel);
@@ -160,7 +163,7 @@
        intreq = gayle_intr_status();
 
        if (intreq & GAYLE_INT_IDE) {
-               if (!is_a4000())
+               if (sc->gayle_intr)
                        gayle_intr_ack(0x7C | (intreq & GAYLE_INT_IDEACK));
                ret = wdcintr(&sc->sc_channel);
        }



Home | Main Index | Thread Index | Old Index