--- trunk/src/devices/dev_cpc700.c 2007/10/08 16:22:20 41 +++ trunk/src/devices/dev_cpc700.c 2007/10/08 16:22:32 42 @@ -25,9 +25,9 @@ * SUCH DAMAGE. * * - * $Id: dev_cpc700.c,v 1.10 2007/01/29 19:03:16 debug Exp $ - * - * IBM CPC700 bridge; PCI and interrupt controller. + * $Id: dev_cpc700.c,v 1.12 2007/06/15 18:13:04 debug Exp $ + * + * COMMENT: IBM CPC700 bridge (PCI and interrupt controller) */ #include @@ -37,6 +37,7 @@ #include "bus_pci.h" #include "cpu.h" #include "device.h" +#include "interrupt.h" #include "machine.h" #include "memory.h" #include "misc.h" @@ -57,14 +58,14 @@ void cpc700_interrupt_assert(struct interrupt *interrupt) { struct cpc700_data *d = interrupt->extra; - d->sr |= (1 << interrupt->line); + d->sr |= interrupt->line; if (d->sr & d->er) INTERRUPT_ASSERT(d->ppc_irq); } void cpc700_interrupt_deassert(struct interrupt *interrupt) { struct cpc700_data *d = interrupt->extra; - d->sr &= ~(1 << interrupt->line); + d->sr &= ~interrupt->line; if (!(d->sr & d->er)) INTERRUPT_DEASSERT(d->ppc_irq); } @@ -188,11 +189,7 @@ char tmp[300]; int i; - d = malloc(sizeof(struct cpc700_data)); - if (d == NULL) { - fprintf(stderr, "out of memory\n"); - exit(1); - } + CHECK_ALLOCATION(d = malloc(sizeof(struct cpc700_data))); memset(d, 0, sizeof(struct cpc700_data)); /* Connect to the CPU's interrupt pin: */ @@ -205,7 +202,7 @@ snprintf(n, sizeof(n), "%s.cpc700.%i", devinit->interrupt_path, i); memset(&template, 0, sizeof(template)); - template.line = i; + template.line = 1 << i; template.name = n; template.extra = d; template.interrupt_assert = cpc700_interrupt_assert;