Module Name:    src
Committed By:   cherry
Date:           Wed Oct 24 03:59:33 UTC 2018

Modified Files:
        src/sys/arch/xen/x86: xen_ipi.c
        src/sys/arch/xen/xen: clock.c if_xennet_xenbus.c pciback.c xbd_xenbus.c
            xbdback_xenbus.c xencons.c xenevt.c xennetback_xenbus.c
            xpci_xenbus.c
        src/sys/arch/xen/xenbus: xenbus_comms.c

Log Message:
When using the intr_establish_xname() interface to register
XEN events, follow established x86/intr.c conventions - set
the 'legacy' irq value to -1, to indicate that the pic, pin
combination (&xen_pic, port) is used for registration.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/xen/x86/xen_ipi.c
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/xen/xen/clock.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/xen/xen/pciback.c
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/xen/xen/xbd_xenbus.c
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/xen/xen/xbdback_xenbus.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/xen/xen/xencons.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/xen/xen/xenevt.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/xen/xen/xennetback_xenbus.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/xen/xen/xpci_xenbus.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/xenbus/xenbus_comms.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/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.26 src/sys/arch/xen/x86/xen_ipi.c:1.27
--- src/sys/arch/xen/x86/xen_ipi.c:1.26	Tue Jul 24 12:26:14 2018
+++ src/sys/arch/xen/x86/xen_ipi.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.26 2018/07/24 12:26:14 bouyer Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.27 2018/10/24 03:59:33 cherry Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.26 2018/07/24 12:26:14 bouyer Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.27 2018/10/24 03:59:33 cherry Exp $");
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.26 2018/07/24 12:26:14 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.27 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_ddb.h"
 
@@ -137,7 +137,7 @@ xen_ipi_init(void)
 	snprintf(intr_xname, sizeof(intr_xname), "%s ipi",
 	    device_xname(ci->ci_dev));
 
-	if (intr_establish_xname(0, &xen_pic, evtchn, IST_LEVEL, IPL_HIGH,
+	if (intr_establish_xname(-1, &xen_pic, evtchn, IST_LEVEL, IPL_HIGH,
 		xen_ipi_handler, ci, true, intr_xname) == NULL) {
 		panic("%s: unable to register ipi handler\n", __func__);
 		/* NOTREACHED */

Index: src/sys/arch/xen/xen/clock.c
diff -u src/sys/arch/xen/xen/clock.c:1.70 src/sys/arch/xen/xen/clock.c:1.71
--- src/sys/arch/xen/xen/clock.c:1.70	Sat Jun 30 14:59:38 2018
+++ src/sys/arch/xen/xen/clock.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.70 2018/06/30 14:59:38 riastradh Exp $	*/
+/*	$NetBSD: clock.c,v 1.71 2018/10/24 03:59:33 cherry Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2018 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.70 2018/06/30 14:59:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.71 2018/10/24 03:59:33 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -763,7 +763,7 @@ xen_resumeclocks(struct cpu_info *ci)
 	snprintf(intr_xname, sizeof(intr_xname), "%s clock",
 	    device_xname(ci->ci_dev));
 	/* XXX sketchy function pointer cast -- fix the API, please */
-	ci->ci_xen_timer_intrhand = intr_establish_xname(0, &xen_pic, evtch,
+	ci->ci_xen_timer_intrhand = intr_establish_xname(-1, &xen_pic, evtch,
 	    IST_LEVEL, IPL_CLOCK, (int (*)(void *))xen_timer_handler, ci, true,
 	    intr_xname);
 	if (ci->ci_xen_timer_intrhand == NULL)

Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.79 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.80
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.79	Mon Sep  3 16:29:29 2018
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.79 2018/09/03 16:29:29 riastradh Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.80 2018/10/24 03:59:33 cherry Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.79 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.80 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -517,7 +517,7 @@ xennet_xenbus_resume(device_t dev, const
 		goto abort_resume;
 	aprint_verbose_dev(dev, "using event channel %d\n",
 	    sc->sc_evtchn);
-	sc->sc_ih = intr_establish_xname(0, &xen_pic, sc->sc_evtchn, IST_LEVEL,
+	sc->sc_ih = intr_establish_xname(-1, &xen_pic, sc->sc_evtchn, IST_LEVEL,
 	    IPL_NET, &xennet_handler, sc, false, device_xname(dev));
 	KASSERT(sc->sc_ih != NULL);
 	return true;

Index: src/sys/arch/xen/xen/pciback.c
diff -u src/sys/arch/xen/xen/pciback.c:1.15 src/sys/arch/xen/xen/pciback.c:1.16
--- src/sys/arch/xen/xen/pciback.c:1.15	Mon Oct  8 05:42:44 2018
+++ src/sys/arch/xen/xen/pciback.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: pciback.c,v 1.15 2018/10/08 05:42:44 cherry Exp $      */
+/*      $NetBSD: pciback.c,v 1.16 2018/10/24 03:59:33 cherry Exp $      */
 
 /*
  * Copyright (c) 2009 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.15 2018/10/08 05:42:44 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciback.c,v 1.16 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -619,7 +619,7 @@ pciback_xenbus_frontend_changed(void *ar
 		x86_sfence();
 		xenbus_switch_state(xbusd, NULL, XenbusStateConnected);
 		x86_sfence();
-		pbxi->pbx_ih = intr_establish_xname(0, &xen_pic, pbxi->pbx_evtchn, IST_LEVEL, IPL_BIO,
+		pbxi->pbx_ih = intr_establish_xname(-1, &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);

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.88 src/sys/arch/xen/xen/xbd_xenbus.c:1.89
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.88	Sun Aug 26 21:04:16 2018
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.88 2018/08/26 21:04:16 jdolecek Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.89 2018/10/24 03:59:33 cherry Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.88 2018/08/26 21:04:16 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.89 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -465,7 +465,7 @@ xbd_xenbus_resume(device_t dev, const pm
 
 	aprint_verbose_dev(dev, "using event channel %d\n",
 	    sc->sc_evtchn);
-	sc->sc_ih = intr_establish_xname(0, &xen_pic, sc->sc_evtchn, IST_LEVEL,
+	sc->sc_ih = intr_establish_xname(-1, &xen_pic, sc->sc_evtchn, IST_LEVEL,
 	    IPL_BIO, &xbd_handler, sc, false, device_xname(dev));
 	KASSERT(sc->sc_ih != NULL);
 

Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.67 src/sys/arch/xen/xen/xbdback_xenbus.c:1.68
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.67	Sun Jun 24 20:28:58 2018
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.67 2018/06/24 20:28:58 jdolecek Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.68 2018/10/24 03:59:33 cherry Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.67 2018/06/24 20:28:58 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.68 2018/10/24 03:59:33 cherry Exp $");
 
 #include <sys/atomic.h>
 #include <sys/buf.h>
@@ -644,7 +644,7 @@ xbdback_connect(struct xbdback_instance 
 	XENPRINTF(("xbdback %s: connect evchannel %d\n", xbusd->xbusd_path, xbdi->xbdi_evtchn));
 	xbdi->xbdi_evtchn = evop.u.bind_interdomain.local_port;
 
-	xbdi->xbdi_ih = intr_establish_xname(0, &xen_pic, xbdi->xbdi_evtchn,
+	xbdi->xbdi_ih = intr_establish_xname(-1, &xen_pic, xbdi->xbdi_evtchn,
 	    IST_LEVEL, IPL_BIO, xbdback_evthandler, xbdi, false,
 	    xbdi->xbdi_name);
 	KASSERT(xbdi->xbdi_ih != NULL);

Index: src/sys/arch/xen/xen/xencons.c
diff -u src/sys/arch/xen/xen/xencons.c:1.44 src/sys/arch/xen/xen/xencons.c:1.45
--- src/sys/arch/xen/xen/xencons.c:1.44	Sun Jun 24 13:35:33 2018
+++ src/sys/arch/xen/xen/xencons.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xencons.c,v 1.44 2018/06/24 13:35:33 jdolecek Exp $	*/
+/*	$NetBSD: xencons.c,v 1.45 2018/10/24 03:59:33 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.44 2018/06/24 13:35:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.45 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -233,7 +233,7 @@ xencons_resume(device_t dev, const pmf_q
 		/* dom0 console resume is required only during first start-up */
 		if (cold) {
 			evtch = bind_virq_to_evtch(VIRQ_CONSOLE);
-			ih = intr_establish_xname(0, &xen_pic, evtch,
+			ih = intr_establish_xname(-1, &xen_pic, evtch,
 			    IST_LEVEL, IPL_TTY, xencons_intr,
 			    xencons_console_device, false,
 			    device_xname(dev));
@@ -241,7 +241,7 @@ xencons_resume(device_t dev, const pmf_q
 		}
 	} else {
 		evtch = xen_start_info.console_evtchn;
-		ih = intr_establish_xname(0, &xen_pic, evtch,
+		ih = intr_establish_xname(-1, &xen_pic, evtch,
 		    IST_LEVEL, IPL_TTY, xencons_handler,
 		    xencons_console_device, false, device_xname(dev));
 		KASSERT(ih != NULL);

Index: src/sys/arch/xen/xen/xenevt.c
diff -u src/sys/arch/xen/xen/xenevt.c:1.50 src/sys/arch/xen/xen/xenevt.c:1.51
--- src/sys/arch/xen/xen/xenevt.c:1.50	Wed Oct 17 03:43:24 2018
+++ src/sys/arch/xen/xen/xenevt.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: xenevt.c,v 1.50 2018/10/17 03:43:24 cherry Exp $      */
+/*      $NetBSD: xenevt.c,v 1.51 2018/10/24 03:59:33 cherry Exp $      */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.50 2018/10/17 03:43:24 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenevt.c,v 1.51 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_xen.h"
 #include <sys/param.h>
@@ -183,7 +183,7 @@ xenevtattach(int n)
 	evtchn_port_t evtchn = xenevt_alloc_event();
 
 	/* The real objective here is to wiggle into the ih callchain for IPL level */
-	ih = intr_establish_xname(0, &xen_pic, evtchn,  IST_LEVEL, level,
+	ih = intr_establish_xname(-1, &xen_pic, evtchn,  IST_LEVEL, level,
 	    xenevt_processevt, NULL, mpsafe, "xenevt");
 
 	KASSERT(ih != NULL);

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.69 src/sys/arch/xen/xen/xennetback_xenbus.c:1.70
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.69	Mon Sep  3 16:29:29 2018
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.69 2018/09/03 16:29:29 riastradh Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.70 2018/10/24 03:59:33 cherry Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.69 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.70 2018/10/24 03:59:33 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -556,7 +556,7 @@ xennetback_connect(struct xnetback_insta
 	xneti->xni_status = CONNECTED;
 	xen_wmb();
 
-	xneti->xni_ih = intr_establish_xname(0, &xen_pic, xneti->xni_evtchn,
+	xneti->xni_ih = intr_establish_xname(-1, &xen_pic, xneti->xni_evtchn,
 	    IST_LEVEL, IPL_NET, xennetback_evthandler, xneti, false,
 	    xneti->xni_if.if_xname);
 	KASSERT(xneti->xni_ih != NULL);

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

Index: src/sys/arch/xen/xenbus/xenbus_comms.c
diff -u src/sys/arch/xen/xenbus/xenbus_comms.c:1.18 src/sys/arch/xen/xenbus/xenbus_comms.c:1.19
--- src/sys/arch/xen/xenbus/xenbus_comms.c:1.18	Sun Jun 24 13:35:33 2018
+++ src/sys/arch/xen/xenbus/xenbus_comms.c	Wed Oct 24 03:59:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_comms.c,v 1.18 2018/06/24 13:35:33 jdolecek Exp $ */
+/* $NetBSD: xenbus_comms.c,v 1.19 2018/10/24 03:59:33 cherry Exp $ */
 /******************************************************************************
  * xenbus_comms.c
  *
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.18 2018/06/24 13:35:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.19 2018/10/24 03:59:33 cherry Exp $");
 
 #include <sys/types.h>
 #include <sys/null.h> 
@@ -221,7 +221,7 @@ xb_init_comms(device_t dev)
 
 	evtchn = xen_start_info.store_evtchn;
 
-	ih = intr_establish_xname(0, &xen_pic, evtchn, IST_LEVEL, IPL_TTY,
+	ih = intr_establish_xname(-1, &xen_pic, evtchn, IST_LEVEL, IPL_TTY,
 	    wake_waiting, NULL, false, device_xname(dev));
 
 	hypervisor_enable_event(evtchn);

Reply via email to