aboutsummaryrefslogtreecommitdiff
path: root/hw/intc
diff options
context:
space:
mode:
Diffstat (limited to 'hw/intc')
-rw-r--r--hw/intc/omap_intc.c38
-rw-r--r--hw/intc/xilinx_intc.c28
2 files changed, 32 insertions, 34 deletions
diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c
index d7183d0..647bf32 100644
--- a/hw/intc/omap_intc.c
+++ b/hw/intc/omap_intc.c
@@ -38,7 +38,7 @@ struct omap_intr_handler_bank_s {
unsigned char priority[32];
};
-struct omap_intr_handler_s {
+struct OMAPIntcState {
SysBusDevice parent_obj;
qemu_irq *pins;
@@ -60,7 +60,7 @@ struct omap_intr_handler_s {
struct omap_intr_handler_bank_s bank[3];
};
-static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq)
+static void omap_inth_sir_update(OMAPIntcState *s, int is_fiq)
{
int i, j, sir_intr, p_intr, p;
uint32_t level;
@@ -88,7 +88,7 @@ static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq)
s->sir_intr[is_fiq] = sir_intr;
}
-static inline void omap_inth_update(struct omap_intr_handler_s *s, int is_fiq)
+static inline void omap_inth_update(OMAPIntcState *s, int is_fiq)
{
int i;
uint32_t has_intr = 0;
@@ -109,7 +109,7 @@ static inline void omap_inth_update(struct omap_intr_handler_s *s, int is_fiq)
static void omap_set_intr(void *opaque, int irq, int req)
{
- struct omap_intr_handler_s *ih = (struct omap_intr_handler_s *) opaque;
+ OMAPIntcState *ih = opaque;
uint32_t rise;
struct omap_intr_handler_bank_s *bank = &ih->bank[irq >> 5];
@@ -136,7 +136,7 @@ static void omap_set_intr(void *opaque, int irq, int req)
/* Simplified version with no edge detection */
static void omap_set_intr_noedge(void *opaque, int irq, int req)
{
- struct omap_intr_handler_s *ih = (struct omap_intr_handler_s *) opaque;
+ OMAPIntcState *ih = opaque;
uint32_t rise;
struct omap_intr_handler_bank_s *bank = &ih->bank[irq >> 5];
@@ -156,7 +156,7 @@ static void omap_set_intr_noedge(void *opaque, int irq, int req)
static uint64_t omap_inth_read(void *opaque, hwaddr addr,
unsigned size)
{
- struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
+ OMAPIntcState *s = opaque;
int i, offset = addr;
int bank_no = offset >> 8;
int line_no;
@@ -234,7 +234,7 @@ static uint64_t omap_inth_read(void *opaque, hwaddr addr,
static void omap_inth_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
- struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
+ OMAPIntcState *s = opaque;
int i, offset = addr;
int bank_no = offset >> 8;
struct omap_intr_handler_bank_s *bank = &s->bank[bank_no];
@@ -336,7 +336,7 @@ static const MemoryRegionOps omap_inth_mem_ops = {
static void omap_inth_reset(DeviceState *dev)
{
- struct omap_intr_handler_s *s = OMAP_INTC(dev);
+ OMAPIntcState *s = OMAP_INTC(dev);
int i;
for (i = 0; i < s->nbanks; ++i){
@@ -366,7 +366,7 @@ static void omap_inth_reset(DeviceState *dev)
static void omap_intc_init(Object *obj)
{
DeviceState *dev = DEVICE(obj);
- struct omap_intr_handler_s *s = OMAP_INTC(obj);
+ OMAPIntcState *s = OMAP_INTC(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
s->nbanks = 1;
@@ -380,25 +380,25 @@ static void omap_intc_init(Object *obj)
static void omap_intc_realize(DeviceState *dev, Error **errp)
{
- struct omap_intr_handler_s *s = OMAP_INTC(dev);
+ OMAPIntcState *s = OMAP_INTC(dev);
if (!s->iclk) {
error_setg(errp, "omap-intc: clk not connected");
}
}
-void omap_intc_set_iclk(omap_intr_handler *intc, omap_clk clk)
+void omap_intc_set_iclk(OMAPIntcState *intc, omap_clk clk)
{
intc->iclk = clk;
}
-void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk)
+void omap_intc_set_fclk(OMAPIntcState *intc, omap_clk clk)
{
intc->fclk = clk;
}
static Property omap_intc_properties[] = {
- DEFINE_PROP_UINT32("size", struct omap_intr_handler_s, size, 0x100),
+ DEFINE_PROP_UINT32("size", OMAPIntcState, size, 0x100),
DEFINE_PROP_END_OF_LIST(),
};
@@ -423,7 +423,7 @@ static const TypeInfo omap_intc_info = {
static uint64_t omap2_inth_read(void *opaque, hwaddr addr,
unsigned size)
{
- struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
+ OMAPIntcState *s = opaque;
int offset = addr;
int bank_no, line_no;
struct omap_intr_handler_bank_s *bank = NULL;
@@ -504,7 +504,7 @@ static uint64_t omap2_inth_read(void *opaque, hwaddr addr,
static void omap2_inth_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
- struct omap_intr_handler_s *s = (struct omap_intr_handler_s *) opaque;
+ OMAPIntcState *s = opaque;
int offset = addr;
int bank_no, line_no;
struct omap_intr_handler_bank_s *bank = NULL;
@@ -622,7 +622,7 @@ static const MemoryRegionOps omap2_inth_mem_ops = {
static void omap2_intc_init(Object *obj)
{
DeviceState *dev = DEVICE(obj);
- struct omap_intr_handler_s *s = OMAP_INTC(obj);
+ OMAPIntcState *s = OMAP_INTC(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
s->level_only = 1;
@@ -637,7 +637,7 @@ static void omap2_intc_init(Object *obj)
static void omap2_intc_realize(DeviceState *dev, Error **errp)
{
- struct omap_intr_handler_s *s = OMAP_INTC(dev);
+ OMAPIntcState *s = OMAP_INTC(dev);
if (!s->iclk) {
error_setg(errp, "omap2-intc: iclk not connected");
@@ -650,7 +650,7 @@ static void omap2_intc_realize(DeviceState *dev, Error **errp)
}
static Property omap2_intc_properties[] = {
- DEFINE_PROP_UINT8("revision", struct omap_intr_handler_s,
+ DEFINE_PROP_UINT8("revision", OMAPIntcState,
revision, 0x21),
DEFINE_PROP_END_OF_LIST(),
};
@@ -676,7 +676,7 @@ static const TypeInfo omap2_intc_info = {
static const TypeInfo omap_intc_type_info = {
.name = TYPE_OMAP_INTC,
.parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(omap_intr_handler),
+ .instance_size = sizeof(OMAPIntcState),
.abstract = true,
};
diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c
index 4c4397b..6e5012e 100644
--- a/hw/intc/xilinx_intc.c
+++ b/hw/intc/xilinx_intc.c
@@ -42,10 +42,10 @@
#define R_MAX 8
#define TYPE_XILINX_INTC "xlnx.xps-intc"
-DECLARE_INSTANCE_CHECKER(struct xlx_pic, XILINX_INTC,
- TYPE_XILINX_INTC)
+typedef struct XpsIntc XpsIntc;
+DECLARE_INSTANCE_CHECKER(XpsIntc, XILINX_INTC, TYPE_XILINX_INTC)
-struct xlx_pic
+struct XpsIntc
{
SysBusDevice parent_obj;
@@ -62,7 +62,7 @@ struct xlx_pic
uint32_t irq_pin_state;
};
-static void update_irq(struct xlx_pic *p)
+static void update_irq(XpsIntc *p)
{
uint32_t i;
@@ -87,10 +87,9 @@ static void update_irq(struct xlx_pic *p)
qemu_set_irq(p->parent_irq, (p->regs[R_MER] & 1) && p->regs[R_IPR]);
}
-static uint64_t
-pic_read(void *opaque, hwaddr addr, unsigned int size)
+static uint64_t pic_read(void *opaque, hwaddr addr, unsigned int size)
{
- struct xlx_pic *p = opaque;
+ XpsIntc *p = opaque;
uint32_t r = 0;
addr >>= 2;
@@ -106,11 +105,10 @@ pic_read(void *opaque, hwaddr addr, unsigned int size)
return r;
}
-static void
-pic_write(void *opaque, hwaddr addr,
- uint64_t val64, unsigned int size)
+static void pic_write(void *opaque, hwaddr addr,
+ uint64_t val64, unsigned int size)
{
- struct xlx_pic *p = opaque;
+ XpsIntc *p = opaque;
uint32_t value = val64;
addr >>= 2;
@@ -154,7 +152,7 @@ static const MemoryRegionOps pic_ops = {
static void irq_handler(void *opaque, int irq, int level)
{
- struct xlx_pic *p = opaque;
+ XpsIntc *p = opaque;
/* edge triggered interrupt */
if (p->c_kind_of_intr & (1 << irq) && p->regs[R_MER] & 2) {
@@ -168,7 +166,7 @@ static void irq_handler(void *opaque, int irq, int level)
static void xilinx_intc_init(Object *obj)
{
- struct xlx_pic *p = XILINX_INTC(obj);
+ XpsIntc *p = XILINX_INTC(obj);
qdev_init_gpio_in(DEVICE(obj), irq_handler, 32);
sysbus_init_irq(SYS_BUS_DEVICE(obj), &p->parent_irq);
@@ -179,7 +177,7 @@ static void xilinx_intc_init(Object *obj)
}
static Property xilinx_intc_properties[] = {
- DEFINE_PROP_UINT32("kind-of-intr", struct xlx_pic, c_kind_of_intr, 0),
+ DEFINE_PROP_UINT32("kind-of-intr", XpsIntc, c_kind_of_intr, 0),
DEFINE_PROP_END_OF_LIST(),
};
@@ -193,7 +191,7 @@ static void xilinx_intc_class_init(ObjectClass *klass, void *data)
static const TypeInfo xilinx_intc_info = {
.name = TYPE_XILINX_INTC,
.parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(struct xlx_pic),
+ .instance_size = sizeof(XpsIntc),
.instance_init = xilinx_intc_init,
.class_init = xilinx_intc_class_init,
};