void ras_check(unsigned int n, istate_t *istate) { bool restart_needed = false; uintptr_t restart_pc = 0; if (istate_from_uspace(istate)) { if (ras_page[RAS_START]) { if ((ras_page[RAS_START] < istate->pc) && (ras_page[RAS_END] > istate->pc)) { restart_needed = true; restart_pc = ras_page[RAS_START]; } ras_page[RAS_START] = 0; ras_page[RAS_END] = 0xffffffff; } } exc_dispatch(n, istate); if (restart_needed) istate->pc = restart_pc; }
void exc_entry(struct exc_state *exc_state, uint64_t id) { struct elx_state *elx = &exc_state->elx; struct regs *regs = &exc_state->regs; uint8_t elx_mode, elx_el; elx->spsr = raw_read_spsr_current(); elx_mode = get_mode_from_spsr(elx->spsr); elx_el = get_el_from_spsr(elx->spsr); if (elx_mode == SPSR_USE_H) { if (elx_el == get_current_el()) regs->sp = (uint64_t)&exc_state[1]; else regs->sp = raw_read_sp_elx(elx_el); } else { regs->sp = raw_read_sp_el0(); } elx->elr = raw_read_elr_current(); exc_dispatch(exc_state, id); }