early-access version 1415

This commit is contained in:
pineappleEA
2021-02-05 02:47:15 +01:00
parent 67cf315423
commit ba262f74d0
8 changed files with 46 additions and 16 deletions

View File

@@ -120,7 +120,10 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
s32 user_value{};
R_UNLESS(UpdateIfEqual(system, std::addressof(user_value), addr, value, value + 1),
Svc::ResultInvalidCurrentMemory);
R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState);
if (user_value != value) {
return Svc::ResultInvalidState;
}
auto it = thread_tree.nfind_light({addr, -1});
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
@@ -211,7 +214,10 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
}
R_UNLESS(succeeded, Svc::ResultInvalidCurrentMemory);
R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState);
if (user_value != value) {
return Svc::ResultInvalidState;
}
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
(it->GetAddressArbiterKey() == addr)) {

View File

@@ -40,6 +40,14 @@ public:
return writable_event;
}
const std::shared_ptr<KReadableEvent>& GetReadableEvent() const {
return readable_event;
}
const std::shared_ptr<KWritableEvent>& GetWritableEvent() const {
return writable_event;
}
private:
std::shared_ptr<KReadableEvent> readable_event;
std::shared_ptr<KWritableEvent> writable_event;

View File

@@ -46,7 +46,9 @@ ResultCode KReadableEvent::Clear() {
ResultCode KReadableEvent::Reset() {
KScopedSchedulerLock lk{kernel};
R_UNLESS_NOLOG(is_signaled, Svc::ResultInvalidState);
if (!is_signaled) {
return Svc::ResultInvalidState;
}
is_signaled = false;
return RESULT_SUCCESS;