pci_irq.h revision 283927
1262617Sdelphij/*- 2262617Sdelphij * Copyright (c) 2014 Hudson River Trading LLC 3262617Sdelphij * Written by: John H. Baldwin <jhb@FreeBSD.org> 4262617Sdelphij * All rights reserved. 5262617Sdelphij * 6262617Sdelphij * Redistribution and use in source and binary forms, with or without 7262617Sdelphij * modification, are permitted provided that the following conditions 8262617Sdelphij * are met: 9262617Sdelphij * 1. Redistributions of source code must retain the above copyright 10262617Sdelphij * notice, this list of conditions and the following disclaimer. 11262617Sdelphij * 2. Redistributions in binary form must reproduce the above copyright 12262617Sdelphij * notice, this list of conditions and the following disclaimer in the 13262617Sdelphij * documentation and/or other materials provided with the distribution. 14262617Sdelphij * 15262617Sdelphij * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16262617Sdelphij * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17262617Sdelphij * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18262617Sdelphij * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19262617Sdelphij * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20262617Sdelphij * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21262617Sdelphij * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22262617Sdelphij * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23262617Sdelphij * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24262617Sdelphij * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25262617Sdelphij * SUCH DAMAGE. 26262617Sdelphij * 27262617Sdelphij * $FreeBSD: stable/10/usr.sbin/bhyve/pci_irq.h 283927 2015-06-02 19:20:39Z jhb $ 28262617Sdelphij */ 29262617Sdelphij 30262617Sdelphij#ifndef __PCI_IRQ_H__ 31262617Sdelphij#define __PCI_IRQ_H__ 32262617Sdelphij 33262617Sdelphijstruct pci_devinst; 34262617Sdelphij 35262617Sdelphijvoid pci_irq_assert(struct pci_devinst *pi); 36262617Sdelphijvoid pci_irq_deassert(struct pci_devinst *pi); 37262617Sdelphijvoid pci_irq_init(struct vmctx *ctx); 38262617Sdelphijvoid pci_irq_reserve(int irq); 39262617Sdelphijvoid pci_irq_use(int irq); 40262617Sdelphijint pirq_alloc_pin(struct vmctx *ctx); 41262617Sdelphijint pirq_irq(int pin); 42262617Sdelphijuint8_t pirq_read(int pin); 43262617Sdelphijvoid pirq_write(struct vmctx *ctx, int pin, uint8_t val); 44262617Sdelphij 45262617Sdelphij#endif 46262617Sdelphij