当前位置: 首页>>代码示例>>C++>>正文


C++ CPUThread类代码示例

本文整理汇总了C++中CPUThread的典型用法代码示例。如果您正苦于以下问题:C++ CPUThread类的具体用法?C++ CPUThread怎么用?C++ CPUThread使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CPUThread类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sys_spu_thread_get_exit_status

//165
s32 sys_spu_thread_get_exit_status(u32 id, mem32_t status)
{
	sc_spu.Warning("sys_spu_thread_get_exit_status(id=%d, status_addr=0x%x)", id, status.GetAddr());

	if (!status.IsGood())
	{
		return CELL_EFAULT;
	}

	CPUThread* thr = Emu.GetCPU().GetThread(id);

	if(!thr || (thr->GetType() != CPU_THREAD_SPU && thr->GetType() != CPU_THREAD_RAW_SPU))
	{
		return CELL_ESRCH;
	}

	u32 res;
	if (!(*(SPUThread*)thr).SPU.Out_MBox.Pop(res) || !thr->IsStopped())
	{
		return CELL_ESTAT;
	}

	status = res;
	return CELL_OK;
}
开发者ID:Smprvrd,项目名称:rpcs3,代码行数:26,代码来源:sys_spu.cpp

示例2: sys_spu_thread_connect_event

int sys_spu_thread_connect_event(u32 id, u32 eq, u32 et, u8 spup)
{
	sc_spu.Warning("sys_spu_thread_connect_event(id=0x%x,eq=0x%x,et=0x%x,spup=0x%x)", id, eq, et, spup);

	EventQueue* equeue;
	if(!sys_event.CheckId(eq, equeue))
	{
		return CELL_ESRCH;
	}

	if(spup > 63)
	{
		return CELL_EINVAL;
	}

	CPUThread* thr = Emu.GetCPU().GetThread(id);

	if(!thr || (thr->GetType() != CPU_THREAD_SPU && thr->GetType() != CPU_THREAD_RAW_SPU))
	{
		return CELL_ESRCH;
	}

	for(int j=0; j<equeue->pos; ++j)
	{
		if(!equeue->ports[j]->thread)
		{
			equeue->ports[j]->thread = thr;
			return CELL_OK;
		}
	}

	return CELL_EISCONN;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:33,代码来源:SC_SPU_Thread.cpp

示例3: sys_spu_thread_bind_queue

s32 sys_spu_thread_bind_queue(u32 id, u32 eq_id, u32 spuq_num)
{
	sc_spu.Warning("sys_spu_thread_bind_queue(id=%d, equeue_id=%d, spuq_num=0x%x)", id, eq_id, spuq_num);

	EventQueue* eq;
	if (!Emu.GetIdManager().GetIDData(eq_id, eq))
	{
		return CELL_ESRCH;
	}

	if (eq->type != SYS_SPU_QUEUE)
	{
		return CELL_EINVAL;
	}

	CPUThread* thr = Emu.GetCPU().GetThread(id);

	if(!thr || (thr->GetType() != CPU_THREAD_SPU && thr->GetType() != CPU_THREAD_RAW_SPU))
	{
		return CELL_ESRCH;
	}

	if (!(*(SPUThread*)thr).SPUQs.RegisterKey(eq, FIX_SPUQ(spuq_num)))
	{
		return CELL_EBUSY;
	}

	return CELL_OK;
}
开发者ID:Smprvrd,项目名称:rpcs3,代码行数:29,代码来源:sys_spu.cpp

示例4: sys_spu_thread_write_ls

//181
s32 sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type)
{
	sc_spu.Log("sys_spu_thread_write_ls(id=%d, address=0x%x, value=0x%llx, type=0x%x)",
		id, address, value, type);

	CPUThread* thr = Emu.GetCPU().GetThread(id);

	if(!thr || (thr->GetType() != CPU_THREAD_SPU && thr->GetType() != CPU_THREAD_RAW_SPU))
	{
		return CELL_ESRCH;
	}

	if (!thr->IsRunning())
	{
		return CELL_ESTAT;
	}

	if (!(*(SPUThread*)thr).IsGoodLSA(address) || (address % type)) // +check alignment
	{
		return CELL_EINVAL;
	}

	switch (type)
	{
	case 1: (*(SPUThread*)thr).WriteLS8(address, value); return CELL_OK;
	case 2: (*(SPUThread*)thr).WriteLS16(address, value); return CELL_OK;
	case 4: (*(SPUThread*)thr).WriteLS32(address, value); return CELL_OK;
	case 8: (*(SPUThread*)thr).WriteLS64(address, value); return CELL_OK;
	default: return CELL_EINVAL;
	}
}
开发者ID:Smprvrd,项目名称:rpcs3,代码行数:32,代码来源:sys_spu.cpp

示例5: lock

void CPUThreadManager::RemoveThread(const u32 id)
{
	std::lock_guard<std::mutex> lock(m_mtx_thread);

	for(u32 i=0; i<m_threads.GetCount(); ++i)
	{
		if(m_threads[i].m_wait_thread_id == id)
		{
			m_threads[i].Wait(false);
			m_threads[i].m_wait_thread_id = -1;
		}

		if(m_threads[i].GetId() != id) continue;

		CPUThread* thr = &m_threads[i];
#ifndef QT_UI
		wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
#endif
		thr->Close();

		m_threads.RemoveFAt(i);
		break;
	}

	Emu.GetIdManager().RemoveID(id);
	Emu.CheckStatus();
}
开发者ID:AMMAREN,项目名称:rpcs3,代码行数:27,代码来源:CPUThreadManager.cpp

示例6: sys_spu_thread_write_snr

//184
int sys_spu_thread_write_snr(u32 id, u32 number, u32 value)
{
	CPUThread* thr = Emu.GetCPU().GetThread(id);

	if(!thr || (thr->GetType() != CPU_THREAD_SPU && thr->GetType() != CPU_THREAD_RAW_SPU))
	{
		return CELL_ESRCH;
	}

	if (number > 1)
	{
		return CELL_EINVAL;
	}

	if ((*(SPUThread*)thr).cfg.value & ((u64)1<<number))
	{ //logical OR
		(*(SPUThread*)thr).SPU.SNR[number].PushUncond_OR(value);
	}
	else
	{ //overwrite
		(*(SPUThread*)thr).SPU.SNR[number].PushUncond(value);
	}

	return CELL_OK;
}
开发者ID:BagusThanatos,项目名称:rpcs3,代码行数:26,代码来源:SC_SPU_Thread.cpp

示例7: lock

void CPUThreadManager::RemoveThread(const u32 id)
{
	std::lock_guard<std::mutex> lock(m_mtx_thread);

	CPUThread* thr = nullptr;
	u32 thread_index = 0;

	for (u32 i = 0; i < m_threads.size(); ++i)
	{
		if (m_threads[i]->m_wait_thread_id == id)
		{
			m_threads[i]->Wait(false);
			m_threads[i]->m_wait_thread_id = -1;
		}

		if (m_threads[i]->GetId() != id) continue;

		thr = m_threads[i];
		thread_index = i;
	}

	if (thr)
	{
#ifndef QT_UI
		wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
#endif
		thr->Close();

		m_threads.erase(m_threads.begin() + thread_index);
	}

	// Removing the ID should trigger the actual deletion of the thread
	Emu.GetIdManager().RemoveID(id);
	Emu.CheckStatus();
}
开发者ID:ItzWarty,项目名称:rpcs3,代码行数:35,代码来源:CPUThreadManager.cpp

示例8: sys_ppu_thread_get_priority

s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
{
	sys_ppu_thread.Log("sys_ppu_thread_get_priority(thread_id=%lld, prio_addr=0x%x)", thread_id, prio_addr);

	CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
	if(!thr) return CELL_ESRCH;

	Memory.Write32(prio_addr, (s32)thr->GetPrio());

	return CELL_OK;
}
开发者ID:hminth,项目名称:rpcs3,代码行数:11,代码来源:sys_ppu_thread.cpp

示例9: GetCurrentPPCThread

PPCThread* GetCurrentPPCThread()
{
	CPUThread* thread = GetCurrentCPUThread();

	if(!thread || (thread->GetType() != CPU_THREAD_PPU && thread->GetType() != CPU_THREAD_SPU && thread->GetType() != CPU_THREAD_RAW_SPU))
	{
		throw wxString("GetCurrentPPCThread: bad thread");
	}

	return (PPCThread*)thread;
}
开发者ID:BlastarIndia,项目名称:rpcs3,代码行数:11,代码来源:PPCThread.cpp

示例10: sys_ppu_thread_set_priority

int sys_ppu_thread_set_priority(u32 thread_id, int prio)
{
    sysPrxForUser.Warning("sys_ppu_thread_set_priority(thread_id=%d, prio=%d)", thread_id, prio);

    CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
    if(!thr) return CELL_ESRCH;

    thr->SetPrio(prio);

    return CELL_OK;
}
开发者ID:ruharuha,项目名称:rpcs3,代码行数:11,代码来源:SC_PPU_Thread.cpp

示例11: sys_ppu_thread_stop

s32 sys_ppu_thread_stop(u64 thread_id)
{
	sysPrxForUser->Warning("sys_ppu_thread_stop(thread_id=%lld)", thread_id);

	CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
	if(!thr) return CELL_ESRCH;

	thr->Stop();

	return CELL_OK;
}
开发者ID:Smprvrd,项目名称:rpcs3,代码行数:11,代码来源:sys_ppu_thread.cpp

示例12: sys_ppu_thread_set_priority

s32 sys_ppu_thread_set_priority(u64 thread_id, s32 prio)
{
	sysPrxForUser->Log("sys_ppu_thread_set_priority(thread_id=%lld, prio=%d)", thread_id, prio);

	CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
	if(!thr) return CELL_ESRCH;

	thr->SetPrio(prio);

	return CELL_OK;
}
开发者ID:Smprvrd,项目名称:rpcs3,代码行数:11,代码来源:sys_ppu_thread.cpp

示例13: sys_ppu_thread_rename

s32 sys_ppu_thread_rename(u64 thread_id, vm::ptr<const char> name)
{
	sys_ppu_thread.Log("sys_ppu_thread_rename(thread_id=%d, name_addr=0x%x('%s'))", thread_id, name.addr(), name.get_ptr());

	CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
	if (!thr) {
		return CELL_ESRCH;
	}

	thr->SetThreadName(name.get_ptr());
	return CELL_OK;
}
开发者ID:hminth,项目名称:rpcs3,代码行数:12,代码来源:sys_ppu_thread.cpp

示例14: sys_ppu_thread_restart

s32 sys_ppu_thread_restart(u64 thread_id)
{
	sys_ppu_thread.Warning("sys_ppu_thread_restart(thread_id=%lld)", thread_id);

	CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
	if(!thr) return CELL_ESRCH;

	thr->Stop();
	thr->Run();

	return CELL_OK;
}
开发者ID:hminth,项目名称:rpcs3,代码行数:12,代码来源:sys_ppu_thread.cpp

示例15: sys_ppu_thread_restart

int sys_ppu_thread_restart(u32 thread_id)
{
    sysPrxForUser.Warning("sys_ppu_thread_restart(thread_id=%d)", thread_id);

    CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
    if(!thr) return CELL_ESRCH;

    thr->Stop();
    thr->Run();

    return CELL_OK;
}
开发者ID:ruharuha,项目名称:rpcs3,代码行数:12,代码来源:SC_PPU_Thread.cpp


注:本文中的CPUThread类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。