mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +12:00
Add GSP::GPU::AcquireRight
This commit is contained in:
parent
a56b67f3ba
commit
68698ae7a7
6 changed files with 49 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace GPUCommands {
|
||||
enum : u32 {
|
||||
AcquireRight = 0x00160042
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -11,11 +12,32 @@ namespace Result {
|
|||
};
|
||||
}
|
||||
|
||||
void GPUService::reset() {}
|
||||
void GPUService::reset() {
|
||||
privilegedProcess = 0xFFFFFFFF; // Set the privileged process to an invalid handle
|
||||
}
|
||||
|
||||
void GPUService::handleSyncRequest(u32 messagePointer) {
|
||||
const u32 command = mem.read32(messagePointer);
|
||||
switch (command) {
|
||||
default: Helpers::panic("GPU service requested. Command: %08X\n", command);
|
||||
case GPUCommands::AcquireRight: acquireRight(messagePointer); break;
|
||||
; default: Helpers::panic("GPU service requested. Command: %08X\n", command);
|
||||
}
|
||||
}
|
||||
|
||||
void GPUService::acquireRight(u32 messagePointer) {
|
||||
const u32 flag = mem.read32(messagePointer + 4);
|
||||
const u32 pid = mem.read32(messagePointer + 12);
|
||||
printf("GSP::GPU::acquireRight (flag = %d, pid = %X)\n", flag, pid);
|
||||
|
||||
if (flag != 0) {
|
||||
Helpers::panic("GSP::GPU::acquireRight with flag != 0 needs to perform additional initialization");
|
||||
}
|
||||
|
||||
if (pid == KernelHandles::CurrentProcess) {
|
||||
privilegedProcess = currentPID;
|
||||
} else {
|
||||
privilegedProcess = pid;
|
||||
}
|
||||
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
}
|
|
@ -1,8 +1,7 @@
|
|||
#include "services/service_manager.hpp"
|
||||
|
||||
ServiceManager::ServiceManager(std::array<u32, 16>& regs, Memory& mem) : regs(regs), mem(mem),
|
||||
apt(mem), hid(mem), fs(mem),
|
||||
gsp_gpu(mem), gsp_lcd(mem) {}
|
||||
ServiceManager::ServiceManager(std::array<u32, 16>& regs, Memory& mem, u32& currentPID)
|
||||
: regs(regs), mem(mem), apt(mem), hid(mem), fs(mem), gsp_gpu(mem, currentPID), gsp_lcd(mem) {}
|
||||
|
||||
void ServiceManager::reset() {
|
||||
apt.reset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue