11b255677SAlistair Francis /* 21b255677SAlistair Francis * QEMU IRQ/GPIO common code. 31b255677SAlistair Francis * 41b255677SAlistair Francis * Copyright (c) 2016 Alistair Francis <alistair@alistair23.me>. 51b255677SAlistair Francis * 61b255677SAlistair Francis * Permission is hereby granted, free of charge, to any person obtaining a copy 71b255677SAlistair Francis * of this software and associated documentation files (the "Software"), to deal 81b255677SAlistair Francis * in the Software without restriction, including without limitation the rights 91b255677SAlistair Francis * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 101b255677SAlistair Francis * copies of the Software, and to permit persons to whom the Software is 111b255677SAlistair Francis * furnished to do so, subject to the following conditions: 121b255677SAlistair Francis * 131b255677SAlistair Francis * The above copyright notice and this permission notice shall be included in 141b255677SAlistair Francis * all copies or substantial portions of the Software. 151b255677SAlistair Francis * 161b255677SAlistair Francis * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 171b255677SAlistair Francis * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 181b255677SAlistair Francis * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 191b255677SAlistair Francis * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 201b255677SAlistair Francis * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 211b255677SAlistair Francis * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 221b255677SAlistair Francis * THE SOFTWARE. 231b255677SAlistair Francis */ 241b255677SAlistair Francis 25439f122fSPeter Maydell #ifndef HW_OR_IRQ_H 26439f122fSPeter Maydell #define HW_OR_IRQ_H 27439f122fSPeter Maydell 281b255677SAlistair Francis #include "hw/sysbus.h" 291b255677SAlistair Francis #include "qom/object.h" 301b255677SAlistair Francis 311b255677SAlistair Francis #define TYPE_OR_IRQ "or-irq" 321b255677SAlistair Francis 33f81804a5SPeter Maydell /* This can safely be increased if necessary without breaking 34f81804a5SPeter Maydell * migration compatibility (as long as it remains greater than 15). 35f81804a5SPeter Maydell */ 36ddf59e9cSGuenter Roeck #define MAX_OR_LINES 48 371b255677SAlistair Francis 38*60d3ccfbSPhilippe Mathieu-Daudé OBJECT_DECLARE_SIMPLE_TYPE(OrIRQState, OR_IRQ) 391b255677SAlistair Francis 401b255677SAlistair Francis struct OrIRQState { 411b255677SAlistair Francis DeviceState parent_obj; 421b255677SAlistair Francis 431b255677SAlistair Francis qemu_irq out_irq; 441b255677SAlistair Francis bool levels[MAX_OR_LINES]; 451b255677SAlistair Francis uint16_t num_lines; 461b255677SAlistair Francis }; 47439f122fSPeter Maydell 48439f122fSPeter Maydell #endif 49