/////////////////////////////////////////////////////////////////////////////////// // File : exc_handler.c // Date : 01/04/2012 // Author : alain greiner and joel porquet // Copyright (c) UPMC-LIP6 /////////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include /////////////////////////////////////////////////////////////////////////////////// // Prototypes of exception handlers. /////////////////////////////////////////////////////////////////////////////////// static void _cause_ukn(); static void _cause_adel(); static void _cause_ades(); static void _cause_ibe(); static void _cause_dbe(); static void _cause_bp(); static void _cause_ri(); static void _cause_cpu(); static void _cause_ovf(); extern void _int_handler(); extern void _sys_handler(); /////////////////////////////////////////////////////////////////////////////////// // Initialize the exception vector indexed by the CR XCODE field /////////////////////////////////////////////////////////////////////////////////// __attribute__((section(".kdata"))) const _exc_func_t _cause_vector[16] = { &_int_handler, /* 0000 : external interrupt */ &_cause_ukn, /* 0001 : undefined exception */ &_cause_ukn, /* 0010 : undefined exception */ &_cause_ukn, /* 0011 : undefined exception */ &_cause_adel, /* 0100 : illegal address read exception */ &_cause_ades, /* 0101 : illegal address write exception */ &_cause_ibe, /* 0110 : instruction bus error exception */ &_cause_dbe, /* 0111 : data bus error exception */ &_sys_handler, /* 1000 : system call */ &_cause_bp, /* 1001 : breakpoint exception */ &_cause_ri, /* 1010 : illegal codop exception */ &_cause_cpu, /* 1011 : illegal coprocessor access */ &_cause_ovf, /* 1100 : arithmetic overflow exception */ &_cause_ukn, /* 1101 : undefined exception */ &_cause_ukn, /* 1110 : undefined exception */ &_cause_ukn, /* 1111 : undefined exception */ }; /////////////////////////////////////////////// static void _display_cause( unsigned int type ) { unsigned int gpid = _get_procid(); unsigned int cluster_xy = gpid >> P_WIDTH; unsigned int x = cluster_xy >> Y_WIDTH; unsigned int y = cluster_xy & ((1<