Home | History | Annotate | Line # | Download | only in include
intr.h revision 1.34.2.2
      1  1.34.2.2  jdolecek /*	$NetBSD: intr.h,v 1.34.2.2 2017/12/03 11:36:51 jdolecek Exp $	*/
      2       1.3    bouyer /*	NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp	*/
      3       1.3    bouyer 
      4       1.3    bouyer /*-
      5       1.3    bouyer  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
      6       1.3    bouyer  * All rights reserved.
      7       1.3    bouyer  *
      8       1.3    bouyer  * This code is derived from software contributed to The NetBSD Foundation
      9       1.3    bouyer  * by Charles M. Hannum, and by Jason R. Thorpe.
     10       1.3    bouyer  *
     11       1.3    bouyer  * Redistribution and use in source and binary forms, with or without
     12       1.3    bouyer  * modification, are permitted provided that the following conditions
     13       1.3    bouyer  * are met:
     14       1.3    bouyer  * 1. Redistributions of source code must retain the above copyright
     15       1.3    bouyer  *    notice, this list of conditions and the following disclaimer.
     16       1.3    bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     17       1.3    bouyer  *    notice, this list of conditions and the following disclaimer in the
     18       1.3    bouyer  *    documentation and/or other materials provided with the distribution.
     19       1.3    bouyer  *
     20       1.3    bouyer  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     21       1.3    bouyer  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     22       1.3    bouyer  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     23       1.3    bouyer  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     24       1.3    bouyer  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     25       1.3    bouyer  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     26       1.3    bouyer  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     27       1.3    bouyer  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     28       1.3    bouyer  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     29       1.3    bouyer  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     30       1.3    bouyer  * POSSIBILITY OF SUCH DAMAGE.
     31       1.3    bouyer  */
     32       1.1        cl 
     33       1.1        cl #ifndef _XEN_INTR_H_
     34       1.1        cl #define	_XEN_INTR_H_
     35       1.1        cl 
     36      1.22    bouyer #include <machine/intrdefs.h>
     37       1.1        cl 
     38       1.1        cl #ifndef _LOCORE
     39  1.34.2.2  jdolecek #include <xen/xen-public/xen.h>
     40  1.34.2.2  jdolecek #include <x86/intr.h>
     41      1.19    bouyer #include <xen/xen.h>
     42      1.19    bouyer #include <xen/hypervisor.h>
     43       1.3    bouyer #include <machine/pic.h>
     44      1.30    dyoung #include <sys/evcnt.h>
     45       1.3    bouyer 
     46      1.10    bouyer #include "opt_xen.h"
     47      1.10    bouyer 
     48      1.34    bouyer 
     49      1.34    bouyer struct cpu_info;
     50       1.3    bouyer /*
     51       1.3    bouyer  * Struct describing an event channel.
     52       1.3    bouyer  */
     53       1.3    bouyer 
     54       1.3    bouyer struct evtsource {
     55       1.3    bouyer 	int ev_maxlevel;		/* max. IPL for this source */
     56      1.24    cegger 	uint32_t ev_imask;		/* interrupt mask */
     57       1.3    bouyer 	struct intrhand *ev_handlers;	/* handler chain */
     58       1.3    bouyer 	struct evcnt ev_evcnt;		/* interrupt counter */
     59      1.33    cherry 	struct cpu_info *ev_cpu;        /* cpu on which this event is bound */
     60       1.3    bouyer 	char ev_evname[32];		/* event counter name */
     61       1.3    bouyer };
     62       1.3    bouyer 
     63       1.1        cl extern struct intrstub xenev_stubs[];
     64  1.34.2.2  jdolecek extern int irq2vect[256];
     65  1.34.2.2  jdolecek extern int vect2irq[256];
     66  1.34.2.2  jdolecek extern int irq2port[NR_EVENT_CHANNELS];
     67       1.1        cl 
     68      1.25    cegger #ifdef MULTIPROCESSOR
     69  1.34.2.2  jdolecek int xen_intr_biglock_wrapper(void *);
     70      1.25    cegger #endif
     71      1.25    cegger 
     72  1.34.2.2  jdolecek #if defined(DOM0OPS) || NPCI > 0
     73  1.34.2.2  jdolecek int xen_pirq_alloc(intr_handle_t *, int);
     74  1.34.2.2  jdolecek #endif /* defined(DOM0OPS) || NPCI > 0 */
     75      1.10    bouyer 
     76      1.32    cherry #ifdef MULTIPROCESSOR
     77      1.32    cherry void xen_ipi_init(void);
     78      1.32    cherry int xen_send_ipi(struct cpu_info *, uint32_t);
     79      1.32    cherry void xen_broadcast_ipi(uint32_t);
     80      1.32    cherry #else
     81      1.33    cherry #define xen_ipi_init(_1) ((void) 0) /* nothing */
     82      1.33    cherry #define xen_send_ipi(_i1, _i2) (0) /* nothing */
     83      1.33    cherry #define xen_broadcast_ipi(_i1) ((void) 0) /* nothing */
     84      1.32    cherry #endif /* MULTIPROCESSOR */
     85       1.3    bouyer #endif /* !_LOCORE */
     86       1.3    bouyer 
     87       1.1        cl #endif /* _XEN_INTR_H_ */
     88