[GSP] Add interrupt relay event

This commit is contained in:
wheremyfoodat 2023-04-21 02:27:28 +03:00
parent d0db2eefce
commit 5daade05d8
4 changed files with 25 additions and 5 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include <cstring>
#include <optional>
#include "PICA/gpu.hpp"
#include "helpers.hpp"
#include "kernel_types.hpp"
@ -16,16 +17,21 @@ enum class GPUInterrupt : u8 {
DMA = 6
};
// More circular dependencies
class Kernel;
class GPUService {
Handle handle = KernelHandles::GPU;
Memory& mem;
GPU& gpu;
Kernel& kernel;
u32& currentPID; // Process ID of the current process
u8* sharedMem; // Pointer to GSP shared memory
// At any point in time only 1 process has privileges to use rendering functions
// This is the PID of that process
u32 privilegedProcess;
std::optional<Handle> interruptEvent;
MAKE_LOG_FUNCTION(log, gspGPULogger)
void processCommandBuffer();
@ -51,7 +57,8 @@ class GPUService {
void flushCacheRegions(u32* cmd);
public:
GPUService(Memory& mem, GPU& gpu, u32& currentPID) : mem(mem), gpu(gpu), currentPID(currentPID) {}
GPUService(Memory& mem, GPU& gpu, Kernel& kernel, u32& currentPID) : mem(mem), gpu(gpu),
kernel(kernel), currentPID(currentPID) {}
void reset();
void handleSyncRequest(u32 messagePointer);
void requestInterrupt(GPUInterrupt type);