Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci pass clockframe aropund in voyager_intr()



details:   https://anonhg.NetBSD.org/src/rev/070a6f402185
branches:  trunk
changeset: 348940:070a6f402185
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Nov 16 22:05:19 2016 +0000

description:
pass clockframe aropund in voyager_intr()

diffstat:

 sys/dev/pci/voyager.c |  19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diffs (68 lines):

diff -r 0a2fa830f016 -r 070a6f402185 sys/dev/pci/voyager.c
--- a/sys/dev/pci/voyager.c     Wed Nov 16 21:36:22 2016 +0000
+++ b/sys/dev/pci/voyager.c     Wed Nov 16 22:05:19 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: voyager.c,v 1.11 2016/01/01 20:48:15 macallan Exp $    */
+/*     $NetBSD: voyager.c,v 1.12 2016/11/16 22:05:19 macallan Exp $    */
 
 /*
  * Copyright (c) 2009, 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.11 2016/01/01 20:48:15 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.12 2016/11/16 22:05:19 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -88,6 +88,8 @@
        struct voyager_intr sc_intrs[32];
 };
 
+void *voyager_cookie = NULL;
+
 static int     voyager_match(device_t, cfdata_t, void *);
 static void    voyager_attach(device_t, device_t, void *);
 static int     voyager_print(void *, const char *);
@@ -162,6 +164,8 @@
        sc->sc_iot = pa->pa_iot;
        sc->sc_dev = self;
 
+       voyager_cookie = sc;
+
        pci_aprint_devinfo(pa, NULL);
 
        if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM, 0,
@@ -195,7 +199,8 @@
        }
 
        intrstr = pci_intr_string(sc->sc_pc, ih, intrbuf, sizeof(intrbuf));
-       sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_AUDIO, voyager_intr, sc);
+       sc->sc_ih = pci_intr_establish(sc->sc_pc, ih, IPL_VM,
+           voyager_intr, NULL); /* so we get the clock frame instead */
        if (sc->sc_ih == NULL) {
                aprint_error_dev(self, "couldn't establish interrupt");
                if (intrstr != NULL)
@@ -389,7 +394,7 @@
 static int
 voyager_intr(void *cookie)
 {
-       struct voyager_softc *sc = cookie;
+       struct voyager_softc *sc = voyager_cookie;
        struct voyager_intr *ih;
        uint32_t intrs;
        uint32_t mask, bit;
@@ -405,7 +410,11 @@
                intrs &= ~bit;
                ih = &sc->sc_intrs[num];
                if (ih->vih_func != NULL) {
-                       ih->vih_func(ih->vih_arg);
+                       if (ih->vih_arg == NULL) {
+                               ih->vih_func(cookie);
+                       } else {
+                               ih->vih_func(ih->vih_arg);
+                       }
                }
                ih->vih_count.ev_count++;
        }



Home | Main Index | Thread Index | Old Index