1266125Sjhb/*- 2281887Sjhb * Copyright (c) 2014 Hudson River Trading LLC 3266125Sjhb * Written by: John H. Baldwin <jhb@FreeBSD.org> 4266125Sjhb * All rights reserved. 5266125Sjhb * 6266125Sjhb * Redistribution and use in source and binary forms, with or without 7266125Sjhb * modification, are permitted provided that the following conditions 8266125Sjhb * are met: 9266125Sjhb * 1. Redistributions of source code must retain the above copyright 10266125Sjhb * notice, this list of conditions and the following disclaimer. 11266125Sjhb * 2. Redistributions in binary form must reproduce the above copyright 12266125Sjhb * notice, this list of conditions and the following disclaimer in the 13266125Sjhb * documentation and/or other materials provided with the distribution. 14266125Sjhb * 15266125Sjhb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16266125Sjhb * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17266125Sjhb * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18266125Sjhb * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19266125Sjhb * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20266125Sjhb * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21266125Sjhb * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22266125Sjhb * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23266125Sjhb * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24266125Sjhb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25266125Sjhb * SUCH DAMAGE. 26266125Sjhb * 27266125Sjhb * $FreeBSD: releng/11.0/usr.sbin/bhyve/pci_irq.h 281887 2015-04-23 14:22:20Z jhb $ 28266125Sjhb */ 29266125Sjhb 30266125Sjhb#ifndef __PCI_IRQ_H__ 31266125Sjhb#define __PCI_IRQ_H__ 32266125Sjhb 33266125Sjhbstruct pci_devinst; 34266125Sjhb 35266125Sjhbvoid pci_irq_assert(struct pci_devinst *pi); 36266125Sjhbvoid pci_irq_deassert(struct pci_devinst *pi); 37266125Sjhbvoid pci_irq_init(struct vmctx *ctx); 38266125Sjhbvoid pci_irq_reserve(int irq); 39266125Sjhbvoid pci_irq_use(int irq); 40266125Sjhbint pirq_alloc_pin(struct vmctx *ctx); 41266125Sjhbint pirq_irq(int pin); 42266125Sjhbuint8_t pirq_read(int pin); 43266125Sjhbvoid pirq_write(struct vmctx *ctx, int pin, uint8_t val); 44266125Sjhb 45266125Sjhb#endif 46