[orbis-kernel] Fix sys_evf_create args

'initPattern'
This commit is contained in:
Ivan Chikish 2023-07-11 18:25:54 +03:00
parent 4020bc1108
commit 3ace6a6b05
4 changed files with 12 additions and 10 deletions

View file

@ -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};

View file

@ -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,

View file

@ -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);