Module Name:    src
Committed By:   cherry
Date:           Mon Oct  8 05:42:45 UTC 2018

Modified Files:
        src/sys/arch/xen/xen: pciback.c xpci_xenbus.c

Log Message:
Convert the last remaining users of event_set_handler() to
intr_establish_xname(,&xen_pic,...)


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/xen/pciback.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/xen/xpci_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/pciback.c
diff -u src/sys/arch/xen/xen/pciback.c:1.14 src/sys/arch/xen/xen/pciback.c:1.15
--- src/sys/arch/xen/xen/pciback.c:1.14	Sun Jun 24 20:15:00 2018
+++ src/sys/arch/xen/xen/pciback.c	Mon Oct  8 05:42:44 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: pciback.c,v 1.14 2018/06/24 20:15:00 jdolecek Exp $      */
+/*      $NetBSD: pciback.c,v 1.15 2018/10/08 05:42:44 cherry Exp $      */
 
 /*
  * Copyright (c) 2009 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.14 2018/06/24 20:15:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.15 2018/10/08 05:42:44 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -188,6 +188,7 @@ struct pb_xenbus_instance {
 	struct pciback_pci_devlist pbx_pb_pci_dev; /* list of exported PCI devices */
 	/* communication with the domU */
         unsigned int pbx_evtchn; /* our even channel */
+	struct intrhand *pbx_ih;
         struct xen_pci_sharedinfo *pbx_sh_info;
         struct xen_pci_op op;
         grant_handle_t pbx_shinfo_handle; /* to unmap shared page */
@@ -524,9 +525,7 @@ pciback_xenbus_destroy(void *arg)
 	int err;
 
 	hypervisor_mask_event(pbxi->pbx_evtchn);
-	event_remove_handler(pbxi->pbx_evtchn,
-	    pciback_xenbus_evthandler, pbxi);
-
+	intr_disestablish(pbxi->pbx_ih);
 	mutex_enter(&pb_xenbus_lock);
 	SLIST_REMOVE(&pb_xenbus_instances,
 	    pbxi, pb_xenbus_instance, pbx_next);
@@ -620,8 +619,9 @@ pciback_xenbus_frontend_changed(void *ar
 		x86_sfence();
 		xenbus_switch_state(xbusd, NULL, XenbusStateConnected);
 		x86_sfence();
-		event_set_handler(pbxi->pbx_evtchn, pciback_xenbus_evthandler,
-		    pbxi, IPL_BIO, "pciback", "pciback"); // XXX intr info?
+		pbxi->pbx_ih = intr_establish_xname(0, &xen_pic, pbxi->pbx_evtchn, IST_LEVEL, IPL_BIO,
+		    pciback_xenbus_evthandler, pbxi, true, "pciback");
+		KASSERT(pbxi->pbx_ih != NULL);
 		hypervisor_enable_event(pbxi->pbx_evtchn);
 		hypervisor_notify_via_evtchn(pbxi->pbx_evtchn);
 		break;

Index: src/sys/arch/xen/xen/xpci_xenbus.c
diff -u src/sys/arch/xen/xen/xpci_xenbus.c:1.18 src/sys/arch/xen/xen/xpci_xenbus.c:1.19
--- src/sys/arch/xen/xen/xpci_xenbus.c:1.18	Sun Aug 19 01:33:26 2018
+++ src/sys/arch/xen/xen/xpci_xenbus.c	Mon Oct  8 05:42:45 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: xpci_xenbus.c,v 1.18 2018/08/19 01:33:26 riastradh Exp $      */
+/*      $NetBSD: xpci_xenbus.c,v 1.19 2018/10/08 05:42:45 cherry Exp $      */
 
 /*
  * Copyright (c) 2009 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.18 2018/08/19 01:33:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.19 2018/10/08 05:42:45 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -188,8 +188,9 @@ xpci_xenbus_resume(void *p)
 	aprint_verbose_dev(sc->sc_dev, "using event channel %d\n",
 	    sc->sc_evtchn);
 #if 0
-	event_set_handler(sc->sc_evtchn, &xpci_handler, sc,
-	    IPL_BIO, device_xname(sc->sc_dev));
+	intr_establish_xname(0, &xen_pic, pbxi->pbx_evtchn, IST_LEVEL,
+	    IPL_BIO, &xpci_handler, sc, true,
+	    device_xname(sc->sc_dev));
 #endif
 
 again:

Reply via email to