--- trunk/src/devices/dev_8259.c 2007/10/08 16:19:37 22 +++ trunk/src/devices/dev_8259.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_8259.c,v 1.24 2006/02/09 20:02:58 debug Exp $ + * $Id: dev_8259.c,v 1.29 2006/12/30 13:30:57 debug Exp $ * * 8259 Programmable Interrupt Controller. * @@ -51,9 +51,6 @@ /* #define DEV_8259_DEBUG */ -/* - * dev_8259_access(): - */ DEVICE_ACCESS(8259) { struct pic8259_data *d = (struct pic8259_data *) extra; @@ -113,8 +110,12 @@ d->isr = 0; /* Recalculate interrupt assertions, if necessary: */ - if ((old_irr & ~d->ier) != (d->irr & ~d->ier)) - cpu_interrupt(cpu, d->irq_nr); + if ((old_irr & ~d->ier) != (d->irr & ~d->ier)) { + if (d->irr & ~d->ier) + INTERRUPT_ASSERT(d->irq); + else + INTERRUPT_DEASSERT(d->irq); + } } else if ((idata >= 0x21 && idata <= 0x27) || (idata >= 0x60 && idata <= 0x67) || (idata >= 0xe0 && idata <= 0xe7)) { @@ -123,8 +124,12 @@ d->irr &= ~(1 << (idata & 7)); d->isr &= ~(1 << (idata & 7)); /* Recalc. int assertions, if necessary: */ - if ((old_irr & ~d->ier) != (d->irr & ~d->ier)) - cpu_interrupt(cpu, d->irq_nr); + if ((old_irr & ~d->ier) != (d->irr & ~d->ier)) { + if (d->irr & ~d->ier) + INTERRUPT_ASSERT(d->irq); + else + INTERRUPT_DEASSERT(d->irq); + } } else if (idata == 0x68) { /* Set Special Mask Mode */ /* TODO */ @@ -211,8 +216,12 @@ /* Recalculate interrupt assertions, if necessary: */ - if ((d->irr & ~old_ier) != (d->irr & ~d->ier)) - cpu_interrupt(cpu, d->irq_nr); + if ((d->irr & ~old_ier) != (d->irr & ~d->ier)) { + if (d->irr & ~d->ier) + INTERRUPT_ASSERT(d->irq); + else + INTERRUPT_DEASSERT(d->irq); + } } else { odata = d->ier; } @@ -260,7 +269,8 @@ exit(1); } memset(d, 0, sizeof(struct pic8259_data)); - d->irq_nr = devinit->irq_nr; + + INTERRUPT_CONNECT(devinit->interrupt_path, d->irq); name2 = malloc(nlen); snprintf(name2, nlen, "%s", devinit->name);