void reboot(void) { task_done(); #ifdef CONFIG_DEBUG log(LF_OTHER, LVL_DEBUG, "Rebooting the system"); #endif arch_reboot(); halt(); }
void reboot(void) { task_done(); #ifdef CONFIG_DEBUG printf("Rebooting the system\n"); #endif arch_reboot(); halt(); }
int run_mainMenu() { #if defined(AUTO_RUN) || defined(AUTO_FRAMERATE) || defined(AUTO_PROFILER) return 1; #else #if !defined(DEBUG_UAE4ALL) && !defined(PROFILER_UAE4ALL) static enum MainMenuEntry c = MAIN_MENU_ENTRY_LOAD; #else static enum MainMenuEntry c = MAIN_MENU_ENTRY_SOUND; #endif while (1) { enum MainMenuEntry action = MAIN_MENU_ENTRY_NONE; raise_mainMenu(); while (action == MAIN_MENU_ENTRY_NONE) { draw_mainMenu(c); action = key_mainMenu(&c); } unraise_mainMenu(); switch (action) { case MAIN_MENU_ENTRY_SAVED_STATES: #ifndef NO_SAVE_MENU run_menuSave(); if (savestate_state == STATE_DORESTORE || savestate_state == STATE_DOSAVE) return 1; /* leave, returning to the emulation */ #endif break; case MAIN_MENU_ENTRY_LOAD: run_menuDfSel(); break; case MAIN_MENU_ENTRY_RESET_EMULATION: if (emulating) return 2; /* leave, resetting */ /* Fall through */ case MAIN_MENU_ENTRY_RETURN_TO_EMULATION: return 1; /* leave, returning to the emulation */ case MAIN_MENU_ENTRY_EXIT_UAE: storeConfig(); #ifdef DREAMCAST //malloc(16*1024*1024); arch_reboot(); #else do_leave_program(); exit(0); #endif break; } } #endif }
void StateManager::popState() { if (!states.empty()) { states.back()->cleanup(); states.pop_back(); } if (!states.empty()) { states.back()->paused = false; } else arch_reboot(); }
/** Shutdown and reboot */ void shutdown(int type) { #ifdef VFS delete Managers::Instance->vfsManager; #endif #ifdef NETWORK delete Managers::Instance->netManager; #endif #ifdef PCIBUS delete Managers::Instance->pciBus; #endif #ifdef UI delete Managers::Instance->uiManager; #endif #ifdef PRINT delete Managers::Instance->printManager; #endif #ifdef MEDIA delete Managers::Instance->mediaManager; #endif #ifdef SECURITY delete Managers::Instance->securityManager; #endif arch_ksetcl(12); printf("\nThe system is going down: "); arch_ksetcl(0x0F); switch(type) { case 1: puts("Shutdown.\n"); arch_shutdown(); break; case 2: puts("Reboot.\n"); arch_reboot(); break; } while(1); }
static void interact() { char tmp[16]; char *buf; int cnt=0; curdir[0] = '/'; curdir[1] = 0; while(1) { sprintf(tmp, "%d", cnt); dbgio_write_str(tmp); dbgio_write(' '); dbgio_write_str(curdir); dbgio_write('>'); /*write_str("%d %s> ", cnt, curdir); */ buf = read_line(); if (buf[0] == 0) { cnt++; continue; } if (!strcmp(buf, "quit") || !strcmp(buf, "exit")) { break; } else if (!strcmp(buf, "die")) { arch_exit(); } else if (!strcmp(buf, "ps")) { thd_pslist(); } else if (!strcmp(buf, "reboot")) { arch_reboot(); } else if (!strcmp(buf, "menu")) { (*(void(**)())0x8c0000e0)(1); } else { dbgio_write_str("commands: die quit/exit reboot menu ps\n"); } cnt++; } }
void ArchManager::Reboot() { arch_reboot(); }
static void guard_irq_handler(irq_t source, irq_context_t *context) { dbglog(DBG_INFO, "\n=============== CATCHING EXCEPTION ===============\n"); irq_context_t *irq_ctx = irq_get_context(); if (source == EXC_FPU) { /* Display user friendly informations */ export_sym_t * symb; symb = export_lookup_by_addr(irq_ctx->pc); if (symb) { dbglog(DBG_INFO, "FPU EXCEPTION PC = %s + 0x%08x (0x%08x)\n", symb->name, ((int)irq_ctx->pc) - ((int)symb->ptr), (int)irq_ctx->pc); } /* skip the offending FPU instruction */ int *ptr = (int *)&irq_ctx->r[0x40/4]; *ptr += 4; return; } /* Display user friendly informations */ export_sym_t * symb; int i; uint32 *stk = (uint32 *)irq_ctx->r[15]; for (i = 15; i >= 0; i--) { if((stk[i] < 0x8c000000) || (stk[i] > 0x8d000000) || !(symb = export_lookup_by_addr(stk[i])) || ((int)stk[i] - ((int)symb->ptr) > 0x800)) { dbglog(DBG_INFO, "STACK#%2d = 0x%08x\n", i, (int)stk[i]); } else { dbglog(DBG_INFO, "STACK#%2d = 0x%08x (%s + 0x%08x)\n", i, (int)stk[i], symb->name, (int)stk[i] - ((int)symb->ptr)); } } symb = export_lookup_by_addr(irq_ctx->pc); if (symb && (int)stk[i] - ((int)symb->ptr) < 0x800) { dbglog(DBG_INFO, " PC = %s + 0x%08x (0x%08x)\n", symb->name, ((int)irq_ctx->pc) - ((int)symb->ptr), (int)irq_ctx->pc); } else { dbglog(DBG_INFO, " PC = 0x%08x\n", (int)irq_ctx->pc); } symb = export_lookup_by_addr(irq_ctx->pr); if (symb && (int)stk[i] - ((int)symb->ptr) < 0x800) { dbglog(DBG_INFO, " PR = %s + 0x%08x (0x%08x)\n", symb->name, ((int)irq_ctx->pr) - ((int)symb->ptr), (int)irq_ctx->pr); } else { dbglog(DBG_INFO, " PR = 0x%08x\n", (int)irq_ctx->pr); } uint32 *regs = irq_ctx->r; dbglog(DBG_INFO, " R0-R3 = %08lx %08lx %08lx %08lx\n", regs[0], regs[1], regs[2], regs[3]); dbglog(DBG_INFO, " R4-R7 = %08lx %08lx %08lx %08lx\n", regs[4], regs[5], regs[6], regs[7]); dbglog(DBG_INFO, " R8-R11 = %08lx %08lx %08lx %08lx\n", regs[8], regs[9], regs[10], regs[11]); dbglog(DBG_INFO, " R12-R15 = %08lx %08lx %08lx %08lx\n", regs[12], regs[13], regs[14], regs[15]); //arch_stk_trace_at(regs[14], 0); for (i = 0; exceptions_code[i].code; i++) { if (exceptions_code[i].code == source) { dbglog(DBG_INFO, " EVENT = %s (0x%08x)\n", exceptions_code[i].name, (int)source); break; } } expt_quard_stack_t *s = NULL; s = (expt_quard_stack_t *) kthread_getspecific(expt_key); if (s && s->pos >= 0) { // Simulate a call to longjmp by directly changing stored // context of the exception irq_ctx->pc = (uint32)longjmp; irq_ctx->r[4] = (uint32)s->jump[s->pos]; irq_ctx->r[5] = (uint32)(void *) -1; } else { //malloc_stats(); //texture_memstats(); /* not handled --> panic !! */ //irq_dump_regs(0, source); dbgio_set_dev_fb(); vid_clear(0, 0, 0); ConsoleInformation *con = GetConsole(); for(i = 16; i > 0; i--) { dbglog(DBG_INFO, "%s\n", con->ConsoleLines[i]); } dbglog(DBG_ERROR, "Unhandled Exception. Reboot after 10 seconds."); //panic("Unhandled IRQ/Exception"); timer_spin_sleep(10000); arch_reboot(); // asic_sys_reset(); } }