Exemple #1
0
void Init(int cpu_core)
{
	FPURoundMode::SetPrecisionMode(FPURoundMode::PREC_53);

	memset(ppcState.sr, 0, sizeof(ppcState.sr));
	ppcState.pagetable_base = 0;
	ppcState.pagetable_hashmask = 0;

	for (int tlb = 0; tlb < 2; tlb++)
	{
		for (int set = 0; set < 64; set++)
		{
			ppcState.tlb[tlb][set].recent = 0;
			for (int way = 0; way < 2; way++)
			{
				ppcState.tlb[tlb][set].paddr[way] = 0;
				ppcState.tlb[tlb][set].pte[way] = 0;
				ppcState.tlb[tlb][set].tag[way] = TLB_TAG_INVALID;
			}
		}
	}

	ResetRegisters();
	PPCTables::InitTables(cpu_core);

	// We initialize the interpreter because
	// it is used on boot and code window independently.
	interpreter->Init();

	switch (cpu_core)
	{
	case PowerPC::CORE_INTERPRETER:
		cpu_core_base = interpreter;
		break;

	default:
		cpu_core_base = JitInterface::InitJitCore(cpu_core);
		if (!cpu_core_base) // Handle Situations where JIT core isn't available
		{
			WARN_LOG(POWERPC, "Jit core %d not available. Defaulting to interpreter.", cpu_core);
			cpu_core_base = interpreter;
		}
		break;
	}

	if (cpu_core_base != interpreter)
	{
		mode = MODE_JIT;
	}
	else
	{
		mode = MODE_INTERPRETER;
	}
	state = CPU_STEPPING;

	ppcState.iCache.Init();

	if (SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging)
		breakpoints.ClearAllTemporary();
}
Exemple #2
0
void Reset()
{
  ppcState.pagetable_base = 0;
  ppcState.pagetable_hashmask = 0;
  ppcState.tlb = {};

  ResetRegisters();
  ppcState.iCache.Reset();
}
Exemple #3
0
void Init(int cpu_core)
{
	FPURoundMode::SetPrecisionMode(FPURoundMode::PREC_53);

	memset(ppcState.mojs, 0, sizeof(ppcState.mojs));
	memset(ppcState.sr, 0, sizeof(ppcState.sr));
	ppcState.DebugCount = 0;
	ppcState.dtlb_last = 0;
	memset(ppcState.dtlb_va, 0, sizeof(ppcState.dtlb_va));
	memset(ppcState.dtlb_pa, 0, sizeof(ppcState.dtlb_pa));
	ppcState.itlb_last = 0;
	memset(ppcState.itlb_va, 0, sizeof(ppcState.itlb_va));
	memset(ppcState.itlb_pa, 0, sizeof(ppcState.itlb_pa));
	ppcState.pagetable_base = 0;
	ppcState.pagetable_hashmask = 0;

	ResetRegisters();
	PPCTables::InitTables(cpu_core);

	// We initialize the interpreter because
	// it is used on boot and code window independently.
	interpreter->Init();

	switch (cpu_core)
	{
		case 0:
		{
			cpu_core_base = interpreter;
			break;
		}
		default:
			cpu_core_base = JitInterface::InitJitCore(cpu_core);
			if (!cpu_core_base) // Handle Situations where JIT core isn't available
			{
				WARN_LOG(POWERPC, "Jit core %d not available. Defaulting to interpreter.", cpu_core);
				cpu_core_base = interpreter;
			}
		break;
	}

	if (cpu_core_base != interpreter)
	{
		mode = MODE_JIT;
	}
	else
	{
		mode = MODE_INTERPRETER;
	}
	state = CPU_STEPPING;

	ppcState.iCache.Init();
}
Exemple #4
0
void Init(int cpu_core)
{
  // NOTE: This function runs on EmuThread, not the CPU Thread.
  //   Changing the rounding mode has a limited effect.
  FPURoundMode::SetPrecisionMode(FPURoundMode::PREC_53);

  s_invalidate_cache_thread_safe =
      CoreTiming::RegisterEvent("invalidateEmulatedCache", InvalidateCacheThreadSafe);

  ppcState.pagetable_base = 0;
  ppcState.pagetable_hashmask = 0;
  ppcState.tlb = {};

  ResetRegisters();

  InitializeCPUCore(cpu_core);
  ppcState.iCache.Init();

  if (SConfig::GetInstance().bEnableDebugging)
    breakpoints.ClearAllTemporary();
}
Exemple #5
0
void Init(int cpu_core)
{
	// NOTE: This function runs on EmuThread, not the CPU Thread.
	//   Changing the rounding mode has a limited effect.
	FPURoundMode::SetPrecisionMode(FPURoundMode::PREC_53);

	s_invalidate_cache_thread_safe =
		CoreTiming::RegisterEvent("invalidateEmulatedCache", InvalidateCacheThreadSafe);

	memset(ppcState.sr, 0, sizeof(ppcState.sr));
	ppcState.pagetable_base = 0;
	ppcState.pagetable_hashmask = 0;

	for (int tlb = 0; tlb < 2; tlb++)
	{
		for (int set = 0; set < 64; set++)
		{
			ppcState.tlb[tlb][set].recent = 0;
			for (int way = 0; way < 2; way++)
			{
				ppcState.tlb[tlb][set].paddr[way] = 0;
				ppcState.tlb[tlb][set].pte[way] = 0;
				ppcState.tlb[tlb][set].tag[way] = TLB_TAG_INVALID;
			}
		}
	}

	ResetRegisters();
	PPCTables::InitTables(cpu_core);

	// We initialize the interpreter because
	// it is used on boot and code window independently.
	s_interpreter->Init();

	switch (cpu_core)
	{
	case PowerPC::CORE_INTERPRETER:
		s_cpu_core_base = s_interpreter;
		break;

	default:
		s_cpu_core_base = JitInterface::InitJitCore(cpu_core);
		if (!s_cpu_core_base)  // Handle Situations where JIT core isn't available
		{
			WARN_LOG(POWERPC, "Jit core %d not available. Defaulting to interpreter.", cpu_core);
			s_cpu_core_base = s_interpreter;
		}
		break;
	}

	if (s_cpu_core_base != s_interpreter)
	{
		s_mode = MODE_JIT;
	}
	else
	{
		s_mode = MODE_INTERPRETER;
	}

	ppcState.iCache.Init();

	if (SConfig::GetInstance().bEnableDebugging)
		breakpoints.ClearAllTemporary();
}