Skip to content

Commit

Permalink
orbis-kernel: allow umtx_cv_wait with abs time
Browse files Browse the repository at this point in the history
workaround for wrong blockpool protection
  • Loading branch information
DHrpcs3 committed Nov 13, 2024
1 parent 6f80249 commit 00273aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 3 additions & 8 deletions orbis-kernel/src/umtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,13 @@ orbis::ErrorCode orbis::umtx_cv_wait(Thread *thread, ptr<ucond> cv,
ORBIS_LOG_FATAL("umtx_cv_wait: UNKNOWN wflags", wflags);
return ErrorCode::INVAL;
}
if ((wflags & kCvWaitClockId) != 0 && ut + 1 && cv->clockid != 0) {
if ((wflags & kCvWaitClockId) != 0 && ut + 1) {
ORBIS_LOG_WARNING("umtx_cv_wait: CLOCK_ID", wflags, cv->clockid);
// std::abort();
return ErrorCode::NOSYS;
}
if ((wflags & kCvWaitAbsTime) != 0 && ut + 1) {
ORBIS_LOG_WARNING("umtx_cv_wait: ABSTIME unimplemented", wflags);
ORBIS_LOG_WARNING("umtx_cv_wait: ABSTIME", wflags);
auto now = std::chrono::time_point_cast<std::chrono::microseconds>(
std::chrono::high_resolution_clock::now())
std::chrono::steady_clock::now())
.time_since_epoch()
.count();

Expand All @@ -337,9 +335,6 @@ orbis::ErrorCode orbis::umtx_cv_wait(Thread *thread, ptr<ucond> cv,
} else {
ut = ut - now;
}

std::abort();
return ErrorCode::NOSYS;
}

auto [chain, key, lock] = g_context.getUmtxChain0(thread, cv->flags, cv);
Expand Down
5 changes: 5 additions & 0 deletions rpcsx/iodev/blockpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ orbis::ErrorCode BlockPoolDevice::map(void **address, std::uint64_t len,
std::int32_t prot, std::int32_t flags,
orbis::Thread *thread) {
ORBIS_LOG_FATAL("blockpool device map", *address, len);
if (prot == 0) {
// FIXME: investigate it
prot = 0x33;
}

auto result = vm::map(*address, len, prot, flags);

if (result == (void *)-1) {
Expand Down

0 comments on commit 00273aa

Please sign in to comment.