aboutsummaryrefslogtreecommitdiff
path: root/hw/slavio_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/slavio_misc.c')
-rw-r--r--hw/slavio_misc.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/hw/slavio_misc.c b/hw/slavio_misc.c
index 1f4128e3fe..9e7629ebb2 100644
--- a/hw/slavio_misc.c
+++ b/hw/slavio_misc.c
@@ -36,19 +36,15 @@
#ifdef DEBUG_MISC
#define MISC_DPRINTF(fmt, args...) \
do { printf("MISC: " fmt , ##args); } while (0)
-#define pic_set_irq_new(intctl, irq, level) \
- do { printf("MISC: set_irq(%d): %d\n", (irq), (level)); \
- pic_set_irq_new((intctl), (irq),(level));} while (0)
#else
#define MISC_DPRINTF(fmt, args...)
#endif
typedef struct MiscState {
- int irq;
+ qemu_irq irq;
uint8_t config;
uint8_t aux1, aux2;
uint8_t diag, mctrl, sysctrl;
- void *intctl;
} MiscState;
#define MISC_MAXADDR 1
@@ -58,9 +54,11 @@ static void slavio_misc_update_irq(void *opaque)
MiscState *s = opaque;
if ((s->aux2 & 0x4) && (s->config & 0x8)) {
- pic_set_irq_new(s->intctl, s->irq, 1);
+ MISC_DPRINTF("Raise IRQ\n");
+ qemu_irq_raise(s->irq);
} else {
- pic_set_irq_new(s->intctl, s->irq, 0);
+ MISC_DPRINTF("Lower IRQ\n");
+ qemu_irq_lower(s->irq);
}
}
@@ -184,8 +182,10 @@ static CPUWriteMemoryFunc *slavio_misc_mem_write[3] = {
static void slavio_misc_save(QEMUFile *f, void *opaque)
{
MiscState *s = opaque;
+ int tmp;
- qemu_put_be32s(f, &s->irq);
+ tmp = 0;
+ qemu_put_be32s(f, &tmp); /* ignored, was IRQ. */
qemu_put_8s(f, &s->config);
qemu_put_8s(f, &s->aux1);
qemu_put_8s(f, &s->aux2);
@@ -197,11 +197,12 @@ static void slavio_misc_save(QEMUFile *f, void *opaque)
static int slavio_misc_load(QEMUFile *f, void *opaque, int version_id)
{
MiscState *s = opaque;
+ int tmp;
if (version_id != 1)
return -EINVAL;
- qemu_get_be32s(f, &s->irq);
+ qemu_get_be32s(f, &tmp);
qemu_get_8s(f, &s->config);
qemu_get_8s(f, &s->aux1);
qemu_get_8s(f, &s->aux2);
@@ -211,7 +212,7 @@ static int slavio_misc_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
-void *slavio_misc_init(uint32_t base, int irq, void *intctl)
+void *slavio_misc_init(uint32_t base, qemu_irq irq)
{
int slavio_misc_io_memory;
MiscState *s;
@@ -237,7 +238,6 @@ void *slavio_misc_init(uint32_t base, int irq, void *intctl)
cpu_register_physical_memory(base + 0xa000000, MISC_MAXADDR, slavio_misc_io_memory);
s->irq = irq;
- s->intctl = intctl;
register_savevm("slavio_misc", base, 1, slavio_misc_save, slavio_misc_load, s);
qemu_register_reset(slavio_misc_reset, s);