11527f488SMark Cave-Ayland /* 21527f488SMark Cave-Ayland * QEMU Sun4m iommu emulation 31527f488SMark Cave-Ayland * 41527f488SMark Cave-Ayland * Copyright (c) 2003-2005 Fabrice Bellard 51527f488SMark Cave-Ayland * 61527f488SMark Cave-Ayland * Permission is hereby granted, free of charge, to any person obtaining a copy 71527f488SMark Cave-Ayland * of this software and associated documentation files (the "Software"), to deal 81527f488SMark Cave-Ayland * in the Software without restriction, including without limitation the rights 91527f488SMark Cave-Ayland * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 101527f488SMark Cave-Ayland * copies of the Software, and to permit persons to whom the Software is 111527f488SMark Cave-Ayland * furnished to do so, subject to the following conditions: 121527f488SMark Cave-Ayland * 131527f488SMark Cave-Ayland * The above copyright notice and this permission notice shall be included in 141527f488SMark Cave-Ayland * all copies or substantial portions of the Software. 151527f488SMark Cave-Ayland * 161527f488SMark Cave-Ayland * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 171527f488SMark Cave-Ayland * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 181527f488SMark Cave-Ayland * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 191527f488SMark Cave-Ayland * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 201527f488SMark Cave-Ayland * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 211527f488SMark Cave-Ayland * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 221527f488SMark Cave-Ayland * THE SOFTWARE. 231527f488SMark Cave-Ayland */ 241527f488SMark Cave-Ayland 251527f488SMark Cave-Ayland #ifndef SUN4M_IOMMU_H 261527f488SMark Cave-Ayland #define SUN4M_IOMMU_H 271527f488SMark Cave-Ayland 281527f488SMark Cave-Ayland #include "hw/sysbus.h" 29*db1015e9SEduardo Habkost #include "qom/object.h" 301527f488SMark Cave-Ayland 311527f488SMark Cave-Ayland #define IOMMU_NREGS (4 * 4096 / 4) 321527f488SMark Cave-Ayland 33*db1015e9SEduardo Habkost struct IOMMUState { 341527f488SMark Cave-Ayland SysBusDevice parent_obj; 351527f488SMark Cave-Ayland 361527f488SMark Cave-Ayland AddressSpace iommu_as; 371527f488SMark Cave-Ayland IOMMUMemoryRegion iommu; 381527f488SMark Cave-Ayland 391527f488SMark Cave-Ayland MemoryRegion iomem; 401527f488SMark Cave-Ayland uint32_t regs[IOMMU_NREGS]; 411527f488SMark Cave-Ayland hwaddr iostart; 421527f488SMark Cave-Ayland qemu_irq irq; 431527f488SMark Cave-Ayland uint32_t version; 44*db1015e9SEduardo Habkost }; 45*db1015e9SEduardo Habkost typedef struct IOMMUState IOMMUState; 461527f488SMark Cave-Ayland 471527f488SMark Cave-Ayland #define TYPE_SUN4M_IOMMU "sun4m-iommu" 481527f488SMark Cave-Ayland #define SUN4M_IOMMU(obj) OBJECT_CHECK(IOMMUState, (obj), TYPE_SUN4M_IOMMU) 491527f488SMark Cave-Ayland 501527f488SMark Cave-Ayland #define TYPE_SUN4M_IOMMU_MEMORY_REGION "sun4m-iommu-memory-region" 511527f488SMark Cave-Ayland 521527f488SMark Cave-Ayland #endif 53