[Kernel] Cleaning up

This commit is contained in:
wheremyfoodat 2022-09-19 22:19:36 +03:00
parent 1c4348248d
commit ad07c70772
9 changed files with 21 additions and 37 deletions

View file

@ -7,6 +7,7 @@ void Kernel::getResourceLimit() {
const auto handlePointer = regs[0];
const auto pid = regs[1];
const auto process = getProcessFromPID(pid);
printf("GetResourceLimit (handle pointer = %08X, process: %s)\n", handlePointer, getProcessName(pid).c_str());
if (process == nullptr) [[unlikely]] {
regs[0] = SVCResult::BadHandle;
@ -15,10 +16,7 @@ void Kernel::getResourceLimit() {
const auto processData = static_cast<ProcessData*>(process->data);
printf("GetResourceLimit (handle pointer = %08X, process: %s)\n", handlePointer, getProcessName(pid).c_str());
mem.write32(handlePointer, processData->limits.handle);
regs[0] = SVCResult::Success;
// Is the handle meant to be output through both r1 and memory? Libctru breaks otherwise.
regs[1] = processData->limits.handle;
}