int cellSpursAttributeSetNamePrefix(mem_ptr_t<CellSpursAttribute> attr, const mem8_t prefix, u32 size) { cellSpurs->Warning("cellSpursAttributeSetNamePrefix(attr_addr=0x%x, prefix_addr=0x%x, size=0x%x)", attr.GetAddr(), prefix.GetAddr(), size); if (attr.GetAddr() % 8 != 0) { cellSpurs->Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_ALIGN"); return CELL_SPURS_CORE_ERROR_ALIGN; } if (!attr.IsGood() || !prefix.IsGood()) { cellSpurs->Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_NULL_POINTER"); return CELL_SPURS_CORE_ERROR_NULL_POINTER; } if (size > CELL_SPURS_NAME_MAX_LENGTH) { cellSpurs->Error("cellSpursAttributeSetNamePrefix : CELL_SPURS_CORE_ERROR_INVAL"); return CELL_SPURS_CORE_ERROR_INVAL; } attr->attr->_setNamePrefix(Memory.ReadString(prefix.GetAddr(), size).c_str(), size); return CELL_OK; }
int cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, mem8_t port, int isDynamic) { cellSpurs.Error("cellSpursAttachLv2EventQueue(spurs_addr=0x%x, queue=0x%x, port_addr=0x%x, isDynamic=%u)", spurs.GetAddr(), queue, port.GetAddr(), isDynamic); if(!spurs.IsGood() || !port.IsGood()) return CELL_SPURS_CORE_ERROR_NULL_POINTER; return CELL_OK; }
int cellPamfReaderGetStreamTypeAndChannel(mem_ptr_t<CellPamfReader> pSelf, mem8_t pType, mem8_t pCh) { cellPamf.Warning("cellPamfReaderGetStreamTypeAndChannel(pSelf=0x%x (stream=%d), pType_addr=0x%x, pCh_addr=0x%x", pSelf.GetAddr(), pSelf->stream, pType.GetAddr(), pCh.GetAddr()); if (!pSelf.IsGood() || !pCh.IsGood()) return CELL_PAMF_ERROR_INVALID_ARG; pType = pamfGetStreamType(pSelf, pSelf->stream); pCh = pamfGetStreamChannel(pSelf, pSelf->stream); return CELL_OK; }
int cellSpursAttributeSetNamePrefix(mem_ptr_t<CellSpursAttribute> attr, const mem8_t prefix, u32 size) { cellSpurs.Warning("cellSpursAttributeSetNamePrefix(attr_addr=0x%x, prefix_addr=0x%x, size=0x%x)", attr.GetAddr(), prefix.GetAddr(), size); if(!attr.IsGood() || !prefix.IsGood()) return CELL_SPURS_CORE_ERROR_NULL_POINTER; if(size > 15) return CELL_SPURS_CORE_ERROR_INVAL; attr->attr->_setNamePrefix(Memory.ReadString(prefix.GetAddr(), size), size); return CELL_OK; }
int cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset, u64 args, mem8_t priority, u32 maxContention) { cellSpurs.Error("cellSpursCreateTaskset(spurs_addr=0x%x, taskset_addr=0x%x, args=0x%x, priority_addr=0x%x, maxContention=%u)", spurs.GetAddr(), taskset.GetAddr(), args, priority.GetAddr(), maxContention); if(!spurs.IsGood() || !taskset.IsGood()) return CELL_SPURS_TASK_ERROR_NULL_POINTER; return CELL_OK; }
int cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, mem8_t port, int isDynamic) { cellSpurs->Warning("cellSpursAttachLv2EventQueue(spurs_addr=0x%x, queue=0x%x, port_addr=0x%x, isDynamic=%u)", spurs.GetAddr(), queue, port.GetAddr(), isDynamic); if (spurs.GetAddr() % 128 != 0) { cellSpurs->Error("cellSpursAttachLv2EventQueue : CELL_SPURS_CORE_ERROR_ALIGN"); return CELL_SPURS_CORE_ERROR_ALIGN; } if (!spurs.IsGood() || !port.IsGood()) { cellSpurs->Error("cellSpursAttachLv2EventQueue : CELL_SPURS_CORE_ERROR_NULL_POINTER"); return CELL_SPURS_CORE_ERROR_NULL_POINTER; } spurs->spurs->AttachLv2EventQueue(queue, port, isDynamic); return CELL_OK; }
s32 sys_spu_thread_group_connect_event_all_threads(u32 id, u32 eq_id, u64 req, mem8_t spup) { sc_spu.Warning("sys_spu_thread_group_connect_event_all_threads(id=%d, eq_id=%d, req=0x%llx, spup_addr=0x%x)", id, eq_id, req, spup.GetAddr()); if (!spup.IsGood()) { return CELL_EFAULT; } EventQueue* eq; if (!Emu.GetIdManager().GetIDData(eq_id, eq)) { return CELL_ESRCH; } if (!req) { return CELL_EINVAL; } SpuGroupInfo* group; if (!Emu.GetIdManager().GetIDData(id, group)) { return CELL_ESRCH; } std::vector<SPUThread*> threads; for (auto& v : group->list) { if (!v) continue; CPUThread* thr = Emu.GetCPU().GetThread(v); if (thr->GetType() != CPU_THREAD_SPU) { sc_spu.Error("sys_spu_thread_group_connect_event_all_threads(): CELL_ESTAT (wrong thread type)"); return CELL_ESTAT; } threads.push_back((SPUThread*)thr); } if (threads.size() != group->m_count) { sc_spu.Error("sys_spu_thread_group_connect_event_all_threads(): CELL_ESTAT (%d from %d)", (u32)threads.size(), group->m_count); return CELL_ESTAT; } for (u32 i = 0; i < 64; i++) // port number { bool found = true; if (req & (1ull << i)) { for (auto& t : threads) t->SPUPs[i].m_mutex.lock(); for (auto& t : threads) if (t->SPUPs[i].eq) found = false; if (found) { for (auto& t : threads) { eq->ports.add(&(t->SPUPs[i])); t->SPUPs[i].eq = eq; } spup = (u8)i; } for (auto& t : threads) t->SPUPs[i].m_mutex.unlock(); } else { found = false; } if (found) return CELL_OK; } return CELL_EISCONN; }
int cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset, u64 args, mem8_t priority, u32 maxContention) { cellSpurs->Todo("cellSpursCreateTaskset(spurs_addr=0x%x, taskset_addr=0x%x, args=0x%x, priority_addr=0x%x, maxContention=%u)", spurs.GetAddr(), taskset.GetAddr(), args, priority.GetAddr(), maxContention); if ((spurs.GetAddr() % 128 != 0) || (taskset.GetAddr() % 128 != 0)) { cellSpurs->Error("cellSpursCreateTaskset : CELL_SPURS_TASK_ERROR_ALIGN"); return CELL_SPURS_TASK_ERROR_ALIGN; } if (!spurs.IsGood() || !taskset.IsGood()) { cellSpurs->Error("cellSpursCreateTaskset : CELL_SPURS_TASK_ERROR_NULL_POINTER"); return CELL_SPURS_TASK_ERROR_NULL_POINTER; } SPURSManagerTasksetAttribute *tattr = new SPURSManagerTasksetAttribute(args, priority, maxContention); taskset->taskset = new SPURSManagerTaskset(taskset.GetAddr(), tattr); return CELL_OK; }