aboutsummaryrefslogtreecommitdiff
path: root/hw/esp.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-27 16:36:10 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-05-27 16:36:10 +0000
commit70c0de96a3ed38d9e9a67bddea0f35a871aac095 (patch)
treef744654ac2d82ab4ba9f9ab7a3aabce4892f771c /hw/esp.c
parent2bc1abb7cd9b1f9a275f57221e76a2cd52ce6168 (diff)
Use qemu_irqs between dma controllers and esp, lance
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2873 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/esp.c')
-rw-r--r--hw/esp.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/hw/esp.c b/hw/esp.c
index 627d90cabd..5a7e4ac6b6 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -51,6 +51,7 @@ do { printf("ESP: " fmt , ##args); } while (0)
typedef struct ESPState ESPState;
struct ESPState {
+ qemu_irq irq;
BlockDriverState **bd;
uint8_t rregs[ESP_REGS];
uint8_t wregs[ESP_REGS];
@@ -126,7 +127,7 @@ static int get_cmd(ESPState *s, uint8_t *buf)
s->rregs[4] = STAT_IN;
s->rregs[5] = INTR_DC;
s->rregs[6] = SEQ_0;
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
return 0;
}
s->current_dev = s->scsi_dev[target];
@@ -156,7 +157,7 @@ static void do_cmd(ESPState *s, uint8_t *buf)
}
s->rregs[5] = INTR_BS | INTR_FC;
s->rregs[6] = SEQ_CD;
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
}
static void handle_satn(ESPState *s)
@@ -178,7 +179,7 @@ static void handle_satn_stop(ESPState *s)
s->rregs[4] = STAT_IN | STAT_TC | STAT_CD;
s->rregs[5] = INTR_BS | INTR_FC;
s->rregs[6] = SEQ_CD;
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
}
}
@@ -198,7 +199,7 @@ static void write_response(ESPState *s)
s->ti_wptr = 0;
s->rregs[7] = 2;
}
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
}
static void esp_dma_done(ESPState *s)
@@ -209,7 +210,7 @@ static void esp_dma_done(ESPState *s)
s->rregs[7] = 0;
s->rregs[0] = 0;
s->rregs[1] = 0;
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
}
static void esp_do_dma(ESPState *s)
@@ -362,7 +363,7 @@ static uint32_t esp_mem_readb(void *opaque, target_phys_addr_t addr)
} else {
s->rregs[2] = s->ti_buf[s->ti_rptr++];
}
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
}
if (s->ti_size == 0) {
s->ti_rptr = 0;
@@ -373,7 +374,7 @@ static uint32_t esp_mem_readb(void *opaque, target_phys_addr_t addr)
// interrupt
// Clear interrupt/error status bits
s->rregs[4] &= ~(STAT_IN | STAT_GE | STAT_PE);
- espdma_clear_irq(s->dma_opaque);
+ qemu_irq_lower(s->irq);
break;
default:
break;
@@ -436,7 +437,7 @@ static void esp_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
DPRINTF("Bus reset (%2.2x)\n", val);
s->rregs[5] = INTR_RST;
if (!(s->wregs[8] & 0x40)) {
- espdma_raise_irq(s->dma_opaque);
+ qemu_irq_raise(s->irq);
}
break;
case 0x10:
@@ -565,7 +566,7 @@ void esp_scsi_attach(void *opaque, BlockDriverState *bd, int id)
}
void *esp_init(BlockDriverState **bd, target_phys_addr_t espaddr,
- void *dma_opaque)
+ void *dma_opaque, qemu_irq irq)
{
ESPState *s;
int esp_io_memory;
@@ -575,6 +576,7 @@ void *esp_init(BlockDriverState **bd, target_phys_addr_t espaddr,
return NULL;
s->bd = bd;
+ s->irq = irq;
s->dma_opaque = dma_opaque;
sparc32_dma_set_reset_data(dma_opaque, esp_reset, s);