mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-20 23:50:46 +01:00
[orbis-kernel] Fix sys_evf_create args
'initPattern'
This commit is contained in:
parent
4020bc1108
commit
3ace6a6b05
|
|
@ -56,12 +56,13 @@ public:
|
|||
void kfree(void *ptr, std::size_t size);
|
||||
|
||||
std::pair<EventFlag *, bool> createEventFlag(utils::kstring name,
|
||||
std::int32_t flags) {
|
||||
std::int32_t flags,
|
||||
std::uint64_t initPattern) {
|
||||
std::lock_guard lock(m_evf_mtx);
|
||||
|
||||
auto [it, inserted] = m_event_flags.try_emplace(std::move(name), nullptr);
|
||||
if (inserted) {
|
||||
it->second = knew<EventFlag>(flags);
|
||||
it->second = knew<EventFlag>(flags, initPattern);
|
||||
}
|
||||
|
||||
return {it->second.get(), inserted};
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ struct EventFlag {
|
|||
|
||||
enum class NotifyType { Set, Cancel, Destroy };
|
||||
|
||||
explicit EventFlag(std::int32_t attrs) : attrs(attrs) {}
|
||||
explicit EventFlag(std::int32_t attrs, std::uint64_t initPattern)
|
||||
: attrs(attrs), value(initPattern) {}
|
||||
|
||||
ErrorCode wait(Thread *thread, std::uint8_t waitMode,
|
||||
std::uint64_t bitPattern, std::uint64_t *patternSet,
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ SysResult sys_dl_get_list(Thread *thread /* TODO */);
|
|||
SysResult sys_dl_get_info(Thread *thread /* TODO */);
|
||||
SysResult sys_dl_notify_event(Thread *thread /* TODO */);
|
||||
SysResult sys_evf_create(Thread *thread, ptr<const char[32]> name, sint attrs,
|
||||
ptr<struct evFlag> evf);
|
||||
uint64_t initPattern);
|
||||
SysResult sys_evf_delete(Thread *thread, sint id);
|
||||
SysResult sys_evf_open(Thread *thread, ptr<const char[32]> name);
|
||||
SysResult sys_evf_close(Thread *thread, sint id);
|
||||
|
|
|
|||
|
|
@ -81,9 +81,9 @@ orbis::SysResult orbis::sys_dl_notify_event(Thread *thread /* TODO */) {
|
|||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_evf_create(Thread *thread, ptr<const char[32]> name,
|
||||
sint attrs, ptr<struct evFlag> evf) {
|
||||
ORBIS_LOG_WARNING(__FUNCTION__, name, attrs, evf);
|
||||
if (name == nullptr || evf != nullptr) {
|
||||
sint attrs, uint64_t initPattern) {
|
||||
ORBIS_LOG_WARNING(__FUNCTION__, name, attrs, initPattern);
|
||||
if (name == nullptr) {
|
||||
return ErrorCode::INVAL;
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ orbis::SysResult orbis::sys_evf_create(Thread *thread, ptr<const char[32]> name,
|
|||
EventFlag *eventFlag;
|
||||
if (attrs & kEvfAttrShared) {
|
||||
auto [insertedEvf, inserted] =
|
||||
thread->tproc->context->createEventFlag(_name, attrs);
|
||||
thread->tproc->context->createEventFlag(_name, attrs, initPattern);
|
||||
|
||||
if (!inserted) {
|
||||
return ErrorCode::EXIST; // FIXME: verify
|
||||
|
|
@ -129,7 +129,7 @@ orbis::SysResult orbis::sys_evf_create(Thread *thread, ptr<const char[32]> name,
|
|||
|
||||
eventFlag = insertedEvf;
|
||||
} else {
|
||||
eventFlag = knew<EventFlag>(attrs);
|
||||
eventFlag = knew<EventFlag>(attrs, initPattern);
|
||||
}
|
||||
|
||||
thread->retval[0] = thread->tproc->evfMap.insert(eventFlag);
|
||||
|
|
@ -156,7 +156,7 @@ orbis::SysResult orbis::sys_evf_open(Thread *thread, ptr<const char[32]> name) {
|
|||
|
||||
if (eventFlag == nullptr) {
|
||||
// HACK :)
|
||||
return sys_evf_create(thread, name, kEvfAttrShared, nullptr);
|
||||
return sys_evf_create(thread, name, kEvfAttrShared, 0);
|
||||
return ErrorCode::SRCH;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue