/* The fault handler itself. All of the exception routines * eventually pass control to this function after saving * the processor state. */ void isr_fault_handler(struct regs *r) { char errno[20]; itoa(r->int_no,errno,20); if(r->int_no < 32) { /* Display Interrupt Description and Loop Endlessly */ putsp("\n[krnl]: ","FLAGRANT ERROR! ("); putsp(errno," - "); puts(exception_messages[r->int_no]); puts(") Computer Over.\n"); dump_cpu(); for(;;); } }
int notmain(){ initex(); addexc(IRQVECT, irq_handler); putsp(IRQMODE, 0x8000); putsp(SVCMODE, 0x8000000); for ( i= 0; i<6; i++ ) gpio_fsel(leds[i], OUTPUT); gpio_fsel(ALT, OUTPUT); systim_add(2, 1); systim_add(2, 3); irq_enable(C1INT); irq_enable(C3INT); cuenta= 5; int_globalenable(IRQ); while(1); }