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