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