mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
[Kernel] Fix spontaneous r0 corruption
This commit is contained in:
parent
0add6b7d7a
commit
3529c9bf67
2 changed files with 12 additions and 7 deletions
|
@ -111,12 +111,15 @@ void Kernel::svcClearEvent() {
|
|||
void Kernel::svcSignalEvent() {
|
||||
const Handle handle = regs[0];
|
||||
logSVC("SignalEvent(event handle = %X)\n", handle);
|
||||
|
||||
if (!signalEvent(handle)) {
|
||||
KernelObject* object = getObject(handle, KernelObjectType::Event);
|
||||
|
||||
if (object == nullptr) {
|
||||
Helpers::panic("Signalled non-existent event: %X\n", handle);
|
||||
regs[0] = SVCResult::BadHandle;
|
||||
} else {
|
||||
// We must signalEvent after setting r0, otherwise the r0 of the new thread will ne corrupted
|
||||
regs[0] = SVCResult::Success;
|
||||
signalEvent(handle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue