/** * We currently only handle the page fault exception. * All other exceptions should be routed to the default exception handler. */ void exception_handler(tf_t *tf) { unsigned int cur_pid; unsigned int trapno; cur_pid = get_curid(); trapno = tf -> trapno; if (trapno == T_PGFLT) pgflt_handler(tf); else default_exception_handler(tf); }
void isr_common_handler(struct thread_regs *ctx) { const int intno = ctx->intno; if (intno < IDT_EXCEPTIONS) { default_exception_handler(ctx); return; } const int irqno = intno - IDT_EXCEPTIONS; const irq_t irq = handler[irqno]; mask_irq(irqno); ack_irq(irqno); if (irq) irq(irqno); unmask_irq(irqno); }