| Commit | Line | Data |
|---|---|---|
| 9e0e3f85 SZ |
1 | /* |
| 2 | * Copyright (c) 1991 The Regents of the University of California. | |
| 3 | * Copyright (c) 1996, by Steve Passe. All rights reserved. | |
| 4 | * Copyright (c) 2005,2008 The DragonFly Project. All rights reserved. | |
| 5 | * All rights reserved. | |
| 6 | * | |
| 7 | * This code is derived from software contributed to The DragonFly Project | |
| 8 | * by Matthew Dillon <dillon@backplane.com> | |
| 9 | * | |
| 10 | * This code is derived from software contributed to Berkeley by | |
| 11 | * William Jolitz. | |
| 12 | * | |
| 13 | * Redistribution and use in source and binary forms, with or without | |
| 14 | * modification, are permitted provided that the following conditions | |
| 15 | * are met: | |
| 16 | * | |
| 17 | * 1. Redistributions of source code must retain the above copyright | |
| 18 | * notice, this list of conditions and the following disclaimer. | |
| 19 | * 2. Redistributions in binary form must reproduce the above copyright | |
| 20 | * notice, this list of conditions and the following disclaimer in | |
| 21 | * the documentation and/or other materials provided with the | |
| 22 | * distribution. | |
| 23 | * 3. Neither the name of The DragonFly Project nor the names of its | |
| 24 | * contributors may be used to endorse or promote products derived | |
| 25 | * from this software without specific, prior written permission. | |
| 26 | * | |
| 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 28 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
| 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
| 31 | * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
| 32 | * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
| 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
| 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
| 35 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
| 36 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | |
| 37 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
| 38 | * SUCH DAMAGE. | |
| 39 | */ | |
| 40 | ||
| 41 | #ifndef _ARCH_APIC_IOAPIC_ABI_H_ | |
| 42 | #define _ARCH_APIC_IOAPIC_ABI_H_ | |
| 43 | ||
| 929c940f SZ |
44 | #ifndef _SYS_BUS_H_ |
| 45 | #include <sys/bus.h> | |
| 46 | #endif | |
| 47 | ||
| fa6eddaf SZ |
48 | /* |
| 49 | * NOTE: | |
| 7a54dec9 SZ |
50 | * - Keep size of ioapic_irqinfo power of 2 |
| 51 | * - Update IOAPIC_IRQI_SZSHIFT after changing ioapic_irqinfo size | |
| fa6eddaf | 52 | */ |
| 7a54dec9 SZ |
53 | struct ioapic_irqinfo { |
| 54 | uint32_t io_flags; /* IOAPIC_IRQI_FLAG_ */ | |
| 55 | volatile void *io_addr; | |
| 56 | int io_idx; | |
| 57 | uint32_t io_pad; | |
| fa6eddaf | 58 | }; |
| 7a54dec9 | 59 | #define IOAPIC_IRQI_SZSHIFT 4 |
| fa6eddaf | 60 | |
| 7a54dec9 SZ |
61 | #define IOAPIC_IRQI_FLAG_LEVEL 0x1 /* default to edge trigger */ |
| 62 | #define IOAPIC_IRQI_FLAG_MASKED 0x2 | |
| fa6eddaf | 63 | |
| 7a54dec9 | 64 | extern struct ioapic_irqinfo ioapic_irqs[]; |
| fa6eddaf | 65 | |
| 9e0e3f85 | 66 | extern struct machintr_abi MachIntrABI_IOAPIC; |
| 929c940f | 67 | |
| 027bbbfe SZ |
68 | int ioapic_conf_legacy_extint(int); |
| 69 | void ioapic_set_legacy_irqmap(int, int, enum intr_trigger, | |
| 70 | enum intr_polarity); | |
| 71 | void ioapic_fixup_legacy_irqmaps(void); | |
| 929c940f | 72 | |
| 027bbbfe SZ |
73 | int ioapic_find_legacy_by_gsi(int, enum intr_trigger, enum intr_polarity); |
| 74 | int ioapic_find_legacy_by_irq(int, enum intr_trigger, enum intr_polarity); | |
| e90e7ac4 | 75 | |
| 9e0e3f85 | 76 | #endif /* !_ARCH_APIC_IOAPIC_ABI_H_ */ |