aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-05-05 12:25:35 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-05-05 12:25:35 +0200
commit7a3161bafbda89f08701601a7b6d27329548ce62 (patch)
treeff6a174cf6649d53c4010e307c40170f76ed931d /hw
parent65a650c2a5ed2f33357ba9d29d0f56f6b131333a (diff)
downloadqemu-7a3161bafbda89f08701601a7b6d27329548ce62.zip
qemu-7a3161bafbda89f08701601a7b6d27329548ce62.tar.gz
qemu-7a3161bafbda89f08701601a7b6d27329548ce62.tar.bz2
ETRAX: Simplify interrupt signaling.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/etraxfs_dma.c6
-rw-r--r--hw/etraxfs_ser.c16
-rw-r--r--hw/etraxfs_timer.c5
3 files changed, 7 insertions, 20 deletions
diff --git a/hw/etraxfs_dma.c b/hw/etraxfs_dma.c
index 4723637..e4bc824 100644
--- a/hw/etraxfs_dma.c
+++ b/hw/etraxfs_dma.c
@@ -392,10 +392,8 @@ static void channel_update_irq(struct fs_dma_ctrl *ctrl, int c)
c,
ctrl->channels[c].regs[R_MASKED_INTR]));
- if (ctrl->channels[c].regs[R_MASKED_INTR])
- qemu_irq_raise(ctrl->channels[c].irq[0]);
- else
- qemu_irq_lower(ctrl->channels[c].irq[0]);
+ qemu_set_irq(ctrl->channels[c].irq[0],
+ !!ctrl->channels[c].regs[R_MASKED_INTR]);
}
static int channel_out_run(struct fs_dma_ctrl *ctrl, int c)
diff --git a/hw/etraxfs_ser.c b/hw/etraxfs_ser.c
index 8367386..ab104ba 100644
--- a/hw/etraxfs_ser.c
+++ b/hw/etraxfs_ser.c
@@ -67,24 +67,16 @@ struct etrax_serial_t
static void ser_update_irq(struct etrax_serial_t *s)
{
- uint32_t o_irq = s->r_masked_intr;
-
s->r_intr &= ~(s->rw_ack_intr);
s->r_masked_intr = s->r_intr & s->rw_intr_mask;
- if (o_irq != s->r_masked_intr) {
- D(printf("irq_mask=%x r_intr=%x rmi=%x airq=%x \n",
- s->rw_intr_mask, s->r_intr,
- s->r_masked_intr, s->rw_ack_intr));
- if (s->r_masked_intr)
- qemu_irq_raise(s->irq[0]);
- else
- qemu_irq_lower(s->irq[0]);
- }
+ D(printf("irq_mask=%x r_intr=%x rmi=%x airq=%x \n",
+ s->rw_intr_mask, s->r_intr,
+ s->r_masked_intr, s->rw_ack_intr));
+ qemu_set_irq(s->irq[0], !!s->r_masked_intr);
s->rw_ack_intr = 0;
}
-
static uint32_t ser_readb (void *opaque, target_phys_addr_t addr)
{
D(CPUState *env = opaque);
diff --git a/hw/etraxfs_timer.c b/hw/etraxfs_timer.c
index 1144369..6b3d17e 100644
--- a/hw/etraxfs_timer.c
+++ b/hw/etraxfs_timer.c
@@ -178,10 +178,7 @@ static void timer_update_irq(struct fs_timer_t *t)
t->r_masked_intr = t->r_intr & t->rw_intr_mask;
D(printf("%s: masked_intr=%x\n", __func__, t->r_masked_intr));
- if (t->r_masked_intr)
- qemu_irq_raise(t->irq[0]);
- else
- qemu_irq_lower(t->irq[0]);
+ qemu_set_irq(t->irq[0], !!t->r_masked_intr);
}
static void timer0_hit(void *opaque)