--- trunk/src/devices/dev_adb.c 2007/10/08 16:20:26 28 +++ trunk/src/devices/dev_adb.c 2007/10/08 16:21:17 34 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Anders Gavare. All rights reserved. + * Copyright (C) 2005-2007 Anders Gavare. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_adb.c,v 1.10 2006/07/21 16:55:41 debug Exp $ + * $Id: dev_adb.c,v 1.12 2007/01/28 11:29:52 debug Exp $ * * ADB (Apple Desktop Bus) controller. * @@ -48,6 +48,7 @@ #include "console.h" #include "cpu.h" #include "device.h" +#include "interrupt.h" #include "machine.h" #include "memory.h" #include "misc.h" @@ -75,7 +76,7 @@ "vPCR", "vIFR", "vIER", "(unknown)" }; struct adb_data { - int irq_nr; + struct interrupt irq; int int_asserted; int kbd_dev; @@ -112,18 +113,18 @@ DEVICE_TICK(adb) { struct adb_data *d = extra; - int a; + int assert; - a = d->reg[vIFR >> VIA_REG_SHIFT] & IFR_ANY; - if (a == IFR_ANY && d->int_enable) - a = 1; + assert = d->reg[vIFR >> VIA_REG_SHIFT] & IFR_ANY; + if (assert == IFR_ANY && d->int_enable) + assert = 1; - if (a) - cpu_interrupt(cpu, d->irq_nr); + if (assert) + INTERRUPT_ASSERT(d->irq); else if (d->int_asserted) - cpu_interrupt_ack(cpu, d->irq_nr); + INTERRUPT_DEASSERT(d->irq); - d->int_asserted = a; + d->int_asserted = assert; } @@ -444,7 +445,8 @@ exit(1); } memset(d, 0, sizeof(struct adb_data)); - d->irq_nr = devinit->irq_nr; + + INTERRUPT_CONNECT(devinit->interrupt_path, d->irq); adb_reset(d);