yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

Merge pull request #1419 from mailwl/branch-gsp

Add gsp functions: SetAxiConfigQoSMode, UnregisterInterruptRelayQueue
This commit is contained in:
bunnei 2016-03-31 08:52:38 -04:00
commit 67c982be1b
1 changed files with 41 additions and 6 deletions

View File

@ -285,6 +285,22 @@ static void FlushDataCache(Service::Interface* self) {
address, size, process); address, size, process);
} }
/**
* GSP_GPU::SetAxiConfigQoSMode service function
* Inputs:
* 1 : Mode, unused in emulator
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
static void SetAxiConfigQoSMode(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 mode = cmd_buff[1];
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_GSP, "(STUBBED) called mode=0x%08X", mode);
}
/** /**
* GSP_GPU::RegisterInterruptRelayQueue service function * GSP_GPU::RegisterInterruptRelayQueue service function
* Inputs: * Inputs:
@ -302,6 +318,12 @@ static void RegisterInterruptRelayQueue(Service::Interface* self) {
g_interrupt_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[3]); g_interrupt_event = Kernel::g_handle_table.Get<Kernel::Event>(cmd_buff[3]);
ASSERT_MSG((g_interrupt_event != nullptr), "handle is not valid!"); ASSERT_MSG((g_interrupt_event != nullptr), "handle is not valid!");
g_interrupt_event->name = "GSP_GPU::interrupt_event";
using Kernel::MemoryPermission;
g_shared_memory = Kernel::SharedMemory::Create(0x1000, MemoryPermission::ReadWrite,
MemoryPermission::ReadWrite, "GSPSharedMem");
Handle shmem_handle = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom(); Handle shmem_handle = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom();
// This specific code is required for a successful initialization, rather than 0 // This specific code is required for a successful initialization, rather than 0
@ -313,6 +335,22 @@ static void RegisterInterruptRelayQueue(Service::Interface* self) {
g_interrupt_event->Signal(); // TODO(bunnei): Is this correct? g_interrupt_event->Signal(); // TODO(bunnei): Is this correct?
} }
/**
* GSP_GPU::UnregisterInterruptRelayQueue service function
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
static void UnregisterInterruptRelayQueue(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
g_shared_memory = nullptr;
g_interrupt_event = nullptr;
cmd_buff[1] = RESULT_SUCCESS.raw;
LOG_WARNING(Service_GSP, "called");
}
/** /**
* Signals that the specified interrupt type has occurred to userland code * Signals that the specified interrupt type has occurred to userland code
* @param interrupt_id ID of interrupt that is being signalled * @param interrupt_id ID of interrupt that is being signalled
@ -591,11 +629,11 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x000D0140, nullptr, "SetDisplayTransfer"}, {0x000D0140, nullptr, "SetDisplayTransfer"},
{0x000E0180, nullptr, "SetTextureCopy"}, {0x000E0180, nullptr, "SetTextureCopy"},
{0x000F0200, nullptr, "SetMemoryFill"}, {0x000F0200, nullptr, "SetMemoryFill"},
{0x00100040, nullptr, "SetAxiConfigQoSMode"}, {0x00100040, SetAxiConfigQoSMode, "SetAxiConfigQoSMode"},
{0x00110040, nullptr, "SetPerfLogMode"}, {0x00110040, nullptr, "SetPerfLogMode"},
{0x00120000, nullptr, "GetPerfLog"}, {0x00120000, nullptr, "GetPerfLog"},
{0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"}, {0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"},
{0x00140000, nullptr, "UnregisterInterruptRelayQueue"}, {0x00140000, UnregisterInterruptRelayQueue, "UnregisterInterruptRelayQueue"},
{0x00150002, nullptr, "TryAcquireRight"}, {0x00150002, nullptr, "TryAcquireRight"},
{0x00160042, nullptr, "AcquireRight"}, {0x00160042, nullptr, "AcquireRight"},
{0x00170000, nullptr, "ReleaseRight"}, {0x00170000, nullptr, "ReleaseRight"},
@ -616,10 +654,7 @@ Interface::Interface() {
Register(FunctionTable); Register(FunctionTable);
g_interrupt_event = nullptr; g_interrupt_event = nullptr;
g_shared_memory = nullptr;
using Kernel::MemoryPermission;
g_shared_memory = Kernel::SharedMemory::Create(0x1000, MemoryPermission::ReadWrite,
MemoryPermission::ReadWrite, "GSPSharedMem");
g_thread_id = 0; g_thread_id = 0;
} }