Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen Add a glue function to inspect event channel<->...



details:   https://anonhg.NetBSD.org/src/rev/8886ee5e9f3f
branches:  trunk
changeset: 825469:8886ee5e9f3f
user:      cherry <cherry%NetBSD.org@localhost>
date:      Sun Jul 16 05:03:36 2017 +0000

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

diffstat:

 sys/arch/xen/include/evtchn.h |   3 ++-
 sys/arch/xen/xen/evtchn.c     |  24 ++++++++++++++++++++++--
 2 files changed, 24 insertions(+), 3 deletions(-)

diffs (62 lines):

diff -r ac96590bf838 -r 8886ee5e9f3f sys/arch/xen/include/evtchn.h
--- a/sys/arch/xen/include/evtchn.h     Sat Jul 15 23:52:30 2017 +0000
+++ b/sys/arch/xen/include/evtchn.h     Sun Jul 16 05:03:36 2017 +0000
@@ -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 @@
 
 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);
 
diff -r ac96590bf838 -r 8886ee5e9f3f sys/arch/xen/xen/evtchn.c
--- a/sys/arch/xen/xen/evtchn.c Sat Jul 15 23:52:30 2017 +0000
+++ b/sys/arch/xen/xen/evtchn.c Sun Jul 16 05:03:36 2017 +0000
@@ -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 @@
 
 #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;



Home | Main Index | Thread Index | Old Index