diff --git a/console/rarch_console_exec.c b/console/rarch_console_exec.c index 4234017c0e..4802f0accd 100644 --- a/console/rarch_console_exec.c +++ b/console/rarch_console_exec.c @@ -26,7 +26,8 @@ #elif defined(_XBOX) #include #elif defined(GEKKO) -#include +#include +#include #include "exec/dol.h" #endif @@ -67,7 +68,6 @@ void rarch_console_exec(const char *path) cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); cellSysmoduleUnloadModule(CELL_SYSMODULE_NET); #elif defined(GEKKO) - uint32_t level; FILE * fp = fopen(path, "rb"); if (fp == NULL) { @@ -77,18 +77,21 @@ void rarch_console_exec(const char *path) fseek(fp, 0, SEEK_END); size_t size = ftell(fp); fseek(fp, 0, SEEK_SET); - u8 *mem = (u8 *)0x92000000; // should be safe for this small program to use + uint8_t *mem = (uint8_t *)0x92000000; // should be safe for this small program to use fread(mem, 1, size, fp); fclose(fp); +#ifdef HW_RVL + fatUnmount("sd:"); + fatUnmount("usb:"); +#endif + fatUnmount("carda:"); + fatUnmount("cardb:"); void (*ep)() = (void(*)())load_dol_image(mem); - RARCH_LOG("jumping to 0x%08X\n", (unsigned int)ep); + RARCH_LOG("jumping to 0x%08X\n", (uint32_t)ep); - __IOS_ShutdownSubsystems(); - _CPU_ISR_Disable (level); - __exception_closeall (); - RARCH_LOG("__exception_closeall() done. Jumping to ep now...\n"); - ep(); - _CPU_ISR_Restore (level); + SYS_ResetSystem(SYS_SHUTDOWN,0,0); + + __lwp_thread_stopmultitasking(ep); #else RARCH_WARN("External loading of executables is not supported for this platform.\n"); #endif