pci_emul.c (257767) | pci_emul.c (258075) |
---|---|
1/*- 2 * Copyright (c) 2011 NetApp, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2011 NetApp, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/usr.sbin/bhyve/pci_emul.c 257767 2013-11-06 22:35:52Z neel $ | 26 * $FreeBSD: head/usr.sbin/bhyve/pci_emul.c 258075 2013-11-12 22:51:03Z neel $ |
27 */ 28 29#include <sys/cdefs.h> | 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/usr.sbin/bhyve/pci_emul.c 257767 2013-11-06 22:35:52Z neel $"); | 30__FBSDID("$FreeBSD: head/usr.sbin/bhyve/pci_emul.c 258075 2013-11-12 22:51:03Z neel $"); |
31 32#include <sys/param.h> 33#include <sys/linker_set.h> 34#include <sys/errno.h> 35 36#include <ctype.h> 37#include <stdio.h> 38#include <stdlib.h> --- 5 unchanged lines hidden (view full) --- 44#include <machine/vmm.h> 45#include <vmmapi.h> 46 47#include "bhyverun.h" 48#include "inout.h" 49#include "legacy_irq.h" 50#include "mem.h" 51#include "pci_emul.h" | 31 32#include <sys/param.h> 33#include <sys/linker_set.h> 34#include <sys/errno.h> 35 36#include <ctype.h> 37#include <stdio.h> 38#include <stdlib.h> --- 5 unchanged lines hidden (view full) --- 44#include <machine/vmm.h> 45#include <vmmapi.h> 46 47#include "bhyverun.h" 48#include "inout.h" 49#include "legacy_irq.h" 50#include "mem.h" 51#include "pci_emul.h" |
52#include "ioapic.h" | |
53 54#define CONF1_ADDR_PORT 0x0cf8 55#define CONF1_DATA_PORT 0x0cfc 56 57#define CONF1_ENABLE 0x80000000ul 58 59#define CFGWRITE(pi,off,val,b) \ 60do { \ --- 1070 unchanged lines hidden (view full) --- 1131 return (0); 1132} 1133 1134void 1135pci_lintr_assert(struct pci_devinst *pi) 1136{ 1137 1138 assert(pi->pi_lintr_pin >= 0); | 52 53#define CONF1_ADDR_PORT 0x0cf8 54#define CONF1_DATA_PORT 0x0cfc 55 56#define CONF1_ENABLE 0x80000000ul 57 58#define CFGWRITE(pi,off,val,b) \ 59do { \ --- 1070 unchanged lines hidden (view full) --- 1130 return (0); 1131} 1132 1133void 1134pci_lintr_assert(struct pci_devinst *pi) 1135{ 1136 1137 assert(pi->pi_lintr_pin >= 0); |
1139 ioapic_assert_pin(pi->pi_vmctx, pi->pi_lintr_pin); | 1138 vm_ioapic_assert_irq(pi->pi_vmctx, pi->pi_lintr_pin); |
1140} 1141 1142void 1143pci_lintr_deassert(struct pci_devinst *pi) 1144{ 1145 1146 assert(pi->pi_lintr_pin >= 0); | 1139} 1140 1141void 1142pci_lintr_deassert(struct pci_devinst *pi) 1143{ 1144 1145 assert(pi->pi_lintr_pin >= 0); |
1147 ioapic_deassert_pin(pi->pi_vmctx, pi->pi_lintr_pin); | 1146 vm_ioapic_deassert_irq(pi->pi_vmctx, pi->pi_lintr_pin); |
1148} 1149 1150/* 1151 * Return 1 if the emulated device in 'slot' is a multi-function device. 1152 * Return 0 otherwise. 1153 */ 1154static int 1155pci_emul_is_mfdev(int slot) --- 451 unchanged lines hidden --- | 1147} 1148 1149/* 1150 * Return 1 if the emulated device in 'slot' is a multi-function device. 1151 * Return 0 otherwise. 1152 */ 1153static int 1154pci_emul_is_mfdev(int slot) --- 451 unchanged lines hidden --- |