Annotation of src/sys/arch/xen/include/intr.h, Revision 1.57
1.57 ! jdolecek 1: /* $NetBSD: intr.h,v 1.56 2020/05/14 19:36:02 jdolecek Exp $ */
1.3 bouyer 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: */
1.1 cl 32:
33: #ifndef _XEN_INTR_H_
34: #define _XEN_INTR_H_
35:
1.55 bouyer 36: #include <xen/intrdefs.h>
1.1 cl 37:
38: #ifndef _LOCORE
1.52 cherry 39: #include <xen/include/public/xen.h>
40: #include <xen/include/public/event_channel.h>
1.42 cherry 41: #include <x86/intr.h>
1.19 bouyer 42: #include <xen/xen.h>
43: #include <xen/hypervisor.h>
1.3 bouyer 44: #include <machine/pic.h>
1.30 dyoung 45: #include <sys/evcnt.h>
1.3 bouyer 46:
1.10 bouyer 47: #include "opt_xen.h"
48:
1.34 bouyer 49:
50: struct cpu_info;
1.3 bouyer 51: /*
52: * Struct describing an event channel.
53: */
54:
55: struct evtsource {
56: int ev_maxlevel; /* max. IPL for this source */
1.24 cegger 57: uint32_t ev_imask; /* interrupt mask */
1.3 bouyer 58: struct intrhand *ev_handlers; /* handler chain */
59: struct evcnt ev_evcnt; /* interrupt counter */
1.33 cherry 60: struct cpu_info *ev_cpu; /* cpu on which this event is bound */
1.55 bouyer 61: char ev_intrname[INTRIDBUF]; /* interrupt string */
62: char ev_xname[INTRDEVNAMEBUF]; /* handler device list */
63: struct intrsource *ev_isl; /* entry in intr sources list */
1.3 bouyer 64: };
65:
1.1 cl 66: extern struct intrstub xenev_stubs[];
1.57 ! jdolecek 67: extern short irq2port[NR_EVENT_CHANNELS]; /* actually port + 1, so that 0 is invaid */
1.36 knakahar 68:
1.25 cegger 69: #ifdef MULTIPROCESSOR
1.42 cherry 70: int xen_intr_biglock_wrapper(void *);
1.25 cegger 71: #endif
72:
1.43 cherry 73: #if defined(DOM0OPS) || NPCI > 0
1.48 cherry 74: int xen_pic_to_gsi(struct pic *, int);
1.43 cherry 75: #endif /* defined(DOM0OPS) || NPCI > 0 */
1.10 bouyer 76:
1.32 cherry 77: #ifdef MULTIPROCESSOR
78: void xen_ipi_init(void);
79: int xen_send_ipi(struct cpu_info *, uint32_t);
80: void xen_broadcast_ipi(uint32_t);
81: #else
1.33 cherry 82: #define xen_ipi_init(_1) ((void) 0) /* nothing */
83: #define xen_send_ipi(_i1, _i2) (0) /* nothing */
84: #define xen_broadcast_ipi(_i1) ((void) 0) /* nothing */
1.32 cherry 85: #endif /* MULTIPROCESSOR */
1.50 cherry 86:
87: void *xen_intr_establish_xname(int, struct pic *, int, int, int, int (*)(void *),
88: void *, bool, const char *);
89: void *xen_intr_establish(int, struct pic *, int, int, int, int (*)(void *),
90: void *, bool);
1.53 thorpej 91: void xen_intr_mask(struct intrhand *);
92: void xen_intr_unmask(struct intrhand *);
1.50 cherry 93: void xen_intr_disestablish(struct intrhand *);
94:
1.54 jdolecek 95: struct intrsource *xen_intr_allocate_io_intrsource(const char *);
96: void xen_intr_free_io_intrsource(const char *);
97:
1.3 bouyer 98: #endif /* !_LOCORE */
99:
1.1 cl 100: #endif /* _XEN_INTR_H_ */
CVSweb <webmaster@jp.NetBSD.org>