Module Name:    src
Committed By:   cherry
Date:           Sun Jul 16 05:03:37 UTC 2017

Modified Files:
        src/sys/arch/xen/include: evtchn.h
        src/sys/arch/xen/xen: evtchn.c

Log Message:
Add a glue function to inspect event channel<->legacy IRQ mappings.
This is towards getting xen to use more x86/ "native" code.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/xen/include/evtchn.h
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/xen/xen/evtchn.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/include/evtchn.h
diff -u src/sys/arch/xen/include/evtchn.h:1.23 src/sys/arch/xen/include/evtchn.h:1.24
--- src/sys/arch/xen/include/evtchn.h:1.23	Sat Mar 14 10:49:36 2015
+++ src/sys/arch/xen/include/evtchn.h	Sun Jul 16 05:03:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.h,v 1.23 2015/03/14 10:49:36 bouyer Exp $	*/
+/*	$NetBSD: evtchn.h,v 1.24 2017/07/16 05:03:36 cherry Exp $	*/
 
 /*
  *
@@ -53,6 +53,7 @@ extern int xen_debug_handler(void *);
 
 int bind_virq_to_evtch(int);
 int bind_pirq_to_evtch(int);
+int get_pirq_to_evtch(int);
 int unbind_pirq_from_evtch(int);
 int unbind_virq_from_evtch(int);
 

Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.71 src/sys/arch/xen/xen/evtchn.c:1.72
--- src/sys/arch/xen/xen/evtchn.c:1.71	Sat Mar 14 10:49:36 2015
+++ src/sys/arch/xen/xen/evtchn.c	Sun Jul 16 05:03:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.71 2015/03/14 10:49:36 bouyer Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.72 2017/07/16 05:03:36 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.71 2015/03/14 10:49:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.72 2017/07/16 05:03:36 cherry Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -480,6 +480,26 @@ unbind_virq_from_evtch(int virq)
 
 #if NPCI > 0 || NISA > 0
 int
+get_pirq_to_evtch(int pirq)
+{
+	int evtchn;
+
+	if (pirq == -1) /* Match previous behaviour */
+		return -1;
+	
+	if (pirq >= NR_PIRQS) {
+		panic("pirq %d out of bound, increase NR_PIRQS", pirq);
+	}
+	mutex_spin_enter(&evtchn_lock);
+
+	evtchn = pirq_to_evtch[pirq];
+
+	mutex_spin_exit(&evtchn_lock);
+
+	return evtchn;
+}
+
+int
 bind_pirq_to_evtch(int pirq)
 {
 	evtchn_op_t op;

Reply via email to