Пример #1
0
/**
 * \brief Stop the RIP.
 *
 * \param[in] bForcedShutdown If TRUE, stop RIP regardless of the shutdown mode.
 *                            Otherwise, shutdown the RIP if shutdown mode is
 *                            total shutdown.
 */
void OIL_StopRIP(int bForcedShutdown)
{
  /* check if system needs shutting down */
  if(g_SystemState.eCurrentState != OIL_Sys_Inactive)
  {
    if(bForcedShutdown || (g_NextJobConfiguration.g_eShutdownMode == OIL_RIPShutdownTotal))
    {
      g_SystemState.eCurrentState = OIL_Sys_Active;
#ifndef PMS_OIL_MERGE_DISABLE_JS
      Call_gps_InterpNotifyState(g_SystemState.eCurrentState);
#endif
    }
    else
    {
      GG_SHOW(GG_SHOW_OIL, "**RIP suspended\n");
      g_SystemState.eCurrentState = OIL_Sys_Suspended;
#ifndef PMS_OIL_MERGE_DISABLE_JS
      Call_gps_InterpNotifyState(g_SystemState.eCurrentState);
#endif
    }
  }

  /* This call doesn't do much if in partial shutdown mode */
  SysExit(OIL_Sys_Inactive);
}
Пример #2
0
void exit(int returnCode)
{
	int i;

	for (i=0; i<numExits; i++)
		exitFns[i].function();

	SysExit(returnCode);
}
Пример #3
0
static void Quit(void)
{
	// Exit PowerPC emulation
	exit_emul_ppc();

	// Stop 60Hz thread
	if (tick_thread_active) {
		tick_thread_cancel = true;
		wait_thread(tick_thread);
	}

	// Stop NVRAM watchdog thread
	if (nvram_thread_active) {
		nvram_thread_cancel = true;
		wait_thread(nvram_thread);
	}

	// Deinitialize everything
	ExitAll();

	// Delete SheepShaver globals
	SheepMem::Exit();

	// Delete RAM area
	if (ram_area_mapped)
		vm_mac_release(RAMBase, RAMSize);

	// Delete ROM area
	if (rom_area_mapped)
		vm_mac_release(ROMBase, ROM_AREA_SIZE);

	// Delete DR cache areas
	if (dr_emulator_area_mapped)
		vm_mac_release(DR_EMULATOR_BASE, DR_EMULATOR_SIZE);
	if (dr_cache_area_mapped)
		vm_mac_release(DR_CACHE_BASE, DR_CACHE_SIZE);

	// Delete Kernel Data area
	kernel_data_exit();

	// Exit system routines
	SysExit();

	// Exit preferences
	PrefsExit();

	// Release win32 libraries
	KernelExit();

#ifdef ENABLE_MON
	// Exit mon
	mon_exit();
#endif

	exit(0);
}
Пример #4
0
/**
 * \brief Start the RIP.
 *
 * \return @c TRUE if RIP started, @c FALSE otherwise.
 */
int OIL_StartRIP()
{
  /* check if system already started, start up as required */
  if(!SysInit(OIL_Sys_Active))
  {
    if(g_SystemState.eCurrentState == OIL_Sys_Active)
    {
      SysExit(OIL_Sys_Inactive);
    }
    return FALSE;
  }

  return TRUE;
}
Пример #5
0
void abort()
{
	printf("Abnormal program termination from %#X\n", __builtin_return_address(0));
	
	SysExit(1);
}