Exemple #1
0
void init_exceptions (void)
{
    _xtos_set_exception_handler(EXCCAUSE_UNALIGNED, exception_handler);
    _xtos_set_exception_handler(EXCCAUSE_ILLEGAL, exception_handler);
    _xtos_set_exception_handler(EXCCAUSE_INSTR_ERROR, exception_handler);
    _xtos_set_exception_handler(EXCCAUSE_LOAD_STORE_ERROR, exception_handler);
    _xtos_set_exception_handler(EXCCAUSE_LOAD_PROHIBITED, exception_handler);
    _xtos_set_exception_handler(EXCCAUSE_STORE_PROHIBITED, exception_handler);
    _xtos_set_exception_handler(EXCCAUSE_PRIVILEGED, exception_handler);
}
Exemple #2
0
void trap_init(void)
{
	_xtos_set_exception_handler(EXCCAUSE_UNALIGNED, default_exception_handler);
	_xtos_set_exception_handler(EXCCAUSE_ILLEGAL, default_exception_handler);
	_xtos_set_exception_handler(EXCCAUSE_INSTR_ERROR, default_exception_handler);
	_xtos_set_exception_handler(EXCCAUSE_LOAD_PROHIBITED, default_exception_handler);
	_xtos_set_exception_handler(EXCCAUSE_STORE_PROHIBITED, default_exception_handler);
	_xtos_set_exception_handler(EXCCAUSE_PRIVILEGED, default_exception_handler);

	_xtos_set_exception_handler(EXCCAUSE_LOAD_STORE_ERROR, unaligned_handler);
}
Exemple #3
0
NOINSTR void esp_exception_handler_init() {
#if defined(ESP_FLASH_BYTES_EMUL) || defined(ESP_GDB_SERVER) || \
    defined(ESP_COREDUMP)

  char causes[] = {EXCCAUSE_ILLEGAL,          EXCCAUSE_INSTR_ERROR,
                   EXCCAUSE_LOAD_STORE_ERROR, EXCCAUSE_DIVIDE_BY_ZERO,
                   EXCCAUSE_UNALIGNED,        EXCCAUSE_INSTR_PROHIBITED,
                   EXCCAUSE_LOAD_PROHIBITED,  EXCCAUSE_STORE_PROHIBITED};
  int i;
  for (i = 0; i < (int) sizeof(causes); i++) {
    _xtos_set_exception_handler(causes[i], esp_exception_handler);
  }

#ifdef ESP_FLASH_BYTES_EMUL
  /*
   * registers exception handlers that allow reading arbitrary data from
   * flash
   */
  flash_emul_init();
#endif

#endif
}