// a basic interrupt handler void intr_handler(void) { exc_prologue(); LEDS += exc_get_source() & 0xf; exc_epilogue(); }
void __data_resp_handler(void) { exc_prologue(); int tmp = noc_fifo_data_read(); done[get_cpuid()] = 1; // if (get_cpuid() == NOC_MASTER) { // puts("Hello from interrupt handler"); // fflush(stdout); // } intr_clear_pending(exc_get_source()); exc_epilogue(); }
// a basic handler for faults void fault_handler(void) { unsigned source = exc_get_source(); LEDS = source; const char *msg = "FAULT"; switch(source) { case 0: msg = "Illegal operation"; break; case 1: msg = "Illegal memory access"; break; } puts(msg); // cannot recover from a fault abort(); }