xref: /freebsd/usr.sbin/bhyve/amd64/ioapic.h (revision 55c13f6e7a412cc4bd0ea3fc183cd7c5c2348f01)
1*55c13f6eSMark Johnston /*-
2*55c13f6eSMark Johnston  * SPDX-License-Identifier: BSD-2-Clause
3*55c13f6eSMark Johnston  *
4*55c13f6eSMark Johnston  * Copyright (c) 2014 Hudson River Trading LLC
5*55c13f6eSMark Johnston  * Written by: John H. Baldwin <jhb@FreeBSD.org>
6*55c13f6eSMark Johnston  * All rights reserved.
7*55c13f6eSMark Johnston  *
8*55c13f6eSMark Johnston  * Redistribution and use in source and binary forms, with or without
9*55c13f6eSMark Johnston  * modification, are permitted provided that the following conditions
10*55c13f6eSMark Johnston  * are met:
11*55c13f6eSMark Johnston  * 1. Redistributions of source code must retain the above copyright
12*55c13f6eSMark Johnston  *    notice, this list of conditions and the following disclaimer.
13*55c13f6eSMark Johnston  * 2. Redistributions in binary form must reproduce the above copyright
14*55c13f6eSMark Johnston  *    notice, this list of conditions and the following disclaimer in the
15*55c13f6eSMark Johnston  *    documentation and/or other materials provided with the distribution.
16*55c13f6eSMark Johnston  *
17*55c13f6eSMark Johnston  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18*55c13f6eSMark Johnston  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*55c13f6eSMark Johnston  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*55c13f6eSMark Johnston  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21*55c13f6eSMark Johnston  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*55c13f6eSMark Johnston  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*55c13f6eSMark Johnston  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*55c13f6eSMark Johnston  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*55c13f6eSMark Johnston  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*55c13f6eSMark Johnston  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*55c13f6eSMark Johnston  * SUCH DAMAGE.
28*55c13f6eSMark Johnston  */
29*55c13f6eSMark Johnston 
30*55c13f6eSMark Johnston #ifndef _IOAPIC_H_
31*55c13f6eSMark Johnston #define	_IOAPIC_H_
32*55c13f6eSMark Johnston 
33*55c13f6eSMark Johnston struct pci_devinst;
34*55c13f6eSMark Johnston 
35*55c13f6eSMark Johnston /*
36*55c13f6eSMark Johnston  * Allocate a PCI IRQ from the I/O APIC.
37*55c13f6eSMark Johnston  */
38*55c13f6eSMark Johnston void	ioapic_init(struct vmctx *ctx);
39*55c13f6eSMark Johnston int	ioapic_pci_alloc_irq(struct pci_devinst *pi);
40*55c13f6eSMark Johnston 
41*55c13f6eSMark Johnston #endif
42