Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2305 → Rev 2306

/branches/arm/kernel/arch/arm32/src/exception.c
38,17 → 38,17
#include <arch/memstr.h>
#include <arch/regutils.h>
#include <interrupt.h>
#include <arch/drivers/gxemul.h>
#include <arch/machine.h>
#include <arch/mm/page_fault.h>
#include <print.h>
#include <syscall/syscall.h>
 
#define PREFETCH_OFFSET 0x8
#define BRANCH_OPCODE 0xea000000
#define LDR_OPCODE 0xe59ff000
#define VALID_BRANCH_MASK 0xff000000
#define EXC_VECTORS_SIZE 0x20
#define EXC_VECTORS 0x8
#define PREFETCH_OFFSET 0x8
#define BRANCH_OPCODE 0xea000000
#define LDR_OPCODE 0xe59ff000
#define VALID_BRANCH_MASK 0xff000000
#define EXC_VECTORS_SIZE 0x20
#define EXC_VECTORS 0x8
 
extern uintptr_t supervisor_sp;
extern uintptr_t exc_stack;
263,47 → 263,7
*/
static void irq_exception(int exc_no, istate_t *istate)
{
// TODO: move somewhere to gxemul.c and use machine_irq_exception (or some similar
// name) to avoid using MACHINE == MACHINE_GXEMUL_TESTARM
#if MACHINE == MACHINE_GXEMUL_TESTARM
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);
}
}
}
#endif
/* 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");*/
machine_irq_exception(exc_no, istate);
}
 
/** Fills exception vectors with appropriate exception handlers.