Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/dev/lib/libpci Add pciide_machdep_compat_intr_estab...



details:   https://anonhg.NetBSD.org/src/rev/818d0a5afc79
branches:  trunk
changeset: 808438:818d0a5afc79
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun May 17 13:51:31 2015 +0000

description:
Add pciide_machdep_compat_intr_establish().

Used by ... would you believe pciide?

diffstat:

 sys/rump/dev/lib/libpci/opt/opt_pciide.h |   1 +
 sys/rump/dev/lib/libpci/rumpdev_pci.c    |  27 +++++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r ec0cc5e69c22 -r 818d0a5afc79 sys/rump/dev/lib/libpci/opt/opt_pciide.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libpci/opt/opt_pciide.h  Sun May 17 13:51:31 2015 +0000
@@ -0,0 +1,1 @@
+/*     $NetBSD: opt_pciide.h,v 1.1 2015/05/17 13:51:31 pooka Exp $     */
diff -r ec0cc5e69c22 -r 818d0a5afc79 sys/rump/dev/lib/libpci/rumpdev_pci.c
--- a/sys/rump/dev/lib/libpci/rumpdev_pci.c     Sun May 17 13:45:37 2015 +0000
+++ b/sys/rump/dev/lib/libpci/rumpdev_pci.c     Sun May 17 13:51:31 2015 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpdev_pci.c,v 1.4 2014/08/26 10:58:13 pooka Exp $   */
+/*      $NetBSD: rumpdev_pci.c,v 1.5 2015/05/17 13:51:31 pooka Exp $   */
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpdev_pci.c,v 1.4 2014/08/26 10:58:13 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpdev_pci.c,v 1.5 2015/05/17 13:51:31 pooka Exp $");
 
 #include <sys/cdefs.h>
 #include <sys/param.h>
@@ -166,3 +166,26 @@
 
        panic("%s: unimplemented", __func__);
 }
+
+#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pciidereg.h>
+#include <dev/pci/pciidevar.h>
+
+void *
+pciide_machdep_compat_intr_establish(device_t dev,
+       const struct pci_attach_args *pa, int chan,
+       int (*func)(void *), void *arg)
+{
+       pci_intr_handle_t ih;
+       struct pci_attach_args mypa = *pa;
+
+       mypa.pa_intrline = PCIIDE_COMPAT_IRQ(chan);
+       if (pci_intr_map(&mypa, &ih) != 0)
+               return NULL;
+       return rumpcomp_pci_irq_establish(ih, func, arg);
+}
+
+__strong_alias(pciide_machdep_compat_intr_disestablish,pci_intr_disestablish);
+#endif /* __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH */



Home | Main Index | Thread Index | Old Index