Module Name:    src
Committed By:   pooka
Date:           Sun May 17 13:51:31 UTC 2015

Modified Files:
        src/sys/rump/dev/lib/libpci: rumpdev_pci.c
Added Files:
        src/sys/rump/dev/lib/libpci/opt: opt_pciide.h

Log Message:
Add pciide_machdep_compat_intr_establish().

Used by ... would you believe pciide?


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/libpci/rumpdev_pci.c
cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libpci/opt/opt_pciide.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/dev/lib/libpci/rumpdev_pci.c
diff -u src/sys/rump/dev/lib/libpci/rumpdev_pci.c:1.4 src/sys/rump/dev/lib/libpci/rumpdev_pci.c:1.5
--- src/sys/rump/dev/lib/libpci/rumpdev_pci.c:1.4	Tue Aug 26 10:58:13 2014
+++ src/sys/rump/dev/lib/libpci/rumpdev_pci.c	Sun May 17 13:51:31 2015
@@ -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 @@ pci_intr_disestablish(pci_chipset_tag_t 
 
 	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 */

Added files:

Index: src/sys/rump/dev/lib/libpci/opt/opt_pciide.h
diff -u /dev/null src/sys/rump/dev/lib/libpci/opt/opt_pciide.h:1.1
--- /dev/null	Sun May 17 13:51:31 2015
+++ src/sys/rump/dev/lib/libpci/opt/opt_pciide.h	Sun May 17 13:51:31 2015
@@ -0,0 +1 @@
+/*	$NetBSD: opt_pciide.h,v 1.1 2015/05/17 13:51:31 pooka Exp $	*/

Reply via email to