42,6 → 42,7 |
#include <ddi/device.h> |
#include <mm/page.h> |
#include <arch/machine.h> |
#include <arch/debug_print/print.h> |
|
/** Address of devices. */ |
#define GXEMUL_VIDEORAM 0x10000000 |
318,6 → 319,46 |
*(addr + GXEMUL_HALT_OFFSET) = '\0'; |
} |
|
void machine_irq_exception(int exc_no, istate_t *istate) |
{ |
uint32_t sources = gxemul_irqc_get_sources(); |
int i = 0; |
for (; i < GXEMUL_IRQC_MAX_IRQ; i++) { |
if (sources & (1 << i)) { |
irq_t *irq = irq_dispatch_and_lock(i); |
if (irq) { |
/* The IRQ handler was found. */ |
irq->handler(irq, irq->arg); |
spinlock_unlock(&irq->lock); |
} else { |
/* Spurious interrupt.*/ |
dprintf("cpu%d: spurious interrupt (inum=%d)\n", CPU->id, i); |
} |
} |
} |
/* TODO remove after testing the above code |
noirq = 0; |
if (i == CONSOLE_IRQ) { |
char readchar = *(char*)0x10000000; |
if (readchar == 0) { |
aux_puts("?"); |
} |
else { |
dprintf("%c", readchar); |
} |
|
} |
else if (i == TIMER_IRQ) { |
dprintf("\n.\n"); |
//acknowledge |
*(uint32_t*)0x15000110 = 0; |
} |
} |
} |
|
if (noirq) |
aux_puts("IRQ exception without source\n");*/ |
} |
|
/** @} |
*/ |