1 /* 2 * Raspberry Pi emulation (c) 2012 Gregory Estrade 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8 #ifndef BCM2835_MBOX_H 9 #define BCM2835_MBOX_H 10 11 #include "bcm2835_mbox_defs.h" 12 #include "hw/sysbus.h" 13 #include "qom/object.h" 14 15 #define TYPE_BCM2835_MBOX "bcm2835-mbox" 16 typedef struct BCM2835MboxState BCM2835MboxState; 17 DECLARE_INSTANCE_CHECKER(BCM2835MboxState, BCM2835_MBOX, 18 TYPE_BCM2835_MBOX) 19 20 typedef struct { 21 uint32_t reg[MBOX_SIZE]; 22 uint32_t count; 23 uint32_t status; 24 uint32_t config; 25 } BCM2835Mbox; 26 27 struct BCM2835MboxState { 28 /*< private >*/ 29 SysBusDevice busdev; 30 /*< public >*/ 31 MemoryRegion *mbox_mr; 32 AddressSpace mbox_as; 33 MemoryRegion iomem; 34 qemu_irq arm_irq; 35 36 bool mbox_irq_disabled; 37 bool available[MBOX_CHAN_COUNT]; 38 BCM2835Mbox mbox[2]; 39 }; 40 41 #endif 42