void istate_decode(istate_t *istate) { printf("cs =%0#18" PRIx64 "\trip=%0#18" PRIx64 "\t" "rfl=%0#18" PRIx64 "\terr=%0#18" PRIx64 "\n", istate->cs, istate->rip, istate->rflags, istate->error_word); if (istate_from_uspace(istate)) printf("ss =%0#18" PRIx64 "\n", istate->ss); printf("rax=%0#18" PRIx64 "\trbx=%0#18" PRIx64 "\t" "rcx=%0#18" PRIx64 "\trdx=%0#18" PRIx64 "\n", istate->rax, istate->rbx, istate->rcx, istate->rdx); printf("rsi=%0#18" PRIx64 "\trdi=%0#18" PRIx64 "\t" "rbp=%0#18" PRIx64 "\trsp=%0#18" PRIx64 "\n", istate->rsi, istate->rdi, istate->rbp, istate_from_uspace(istate) ? istate->rsp : (uintptr_t) &istate->rsp); printf("r8 =%0#18" PRIx64 "\tr9 =%0#18" PRIx64 "\t" "r10=%0#18" PRIx64 "\tr11=%0#18" PRIx64 "\n", istate->r8, istate->r9, istate->r10, istate->r11); printf("r12=%0#18" PRIx64 "\tr13=%0#18" PRIx64 "\t" "r14=%0#18" PRIx64 "\tr15=%0#18" PRIx64 "\n", istate->r12, istate->r13, istate->r14, istate->r15); }
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; }