Use IPC:MakeHeader instead of hardcoded raw values for IPC command tables. (#6453)

* Use IPC:MakeHeader instead of hardcoded values for IPC command tables.

* Use u32 instead of unsigned int in MakeHeader function

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>

* Fix clang format

---------

Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
This commit is contained in:
PabloMK7
2023-04-28 07:31:03 +02:00
committed by GitHub
parent 9bd8c9290b
commit 63bc0b59bb
74 changed files with 1983 additions and 1896 deletions

View File

@@ -347,39 +347,39 @@ DSP_DSP::DSP_DSP(Core::System& system)
: ServiceFramework("dsp::DSP", DefaultMaxSessions), system(system) {
static const FunctionInfo functions[] = {
// clang-format off
{0x00010040, &DSP_DSP::RecvData, "RecvData"},
{0x00020040, &DSP_DSP::RecvDataIsReady, "RecvDataIsReady"},
{0x00030080, nullptr, "SendData"},
{0x00040040, nullptr, "SendDataIsEmpty"},
{0x000500C2, nullptr, "SendFifoEx"},
{0x000600C0, nullptr, "RecvFifoEx"},
{0x00070040, &DSP_DSP::SetSemaphore, "SetSemaphore"},
{0x00080000, nullptr, "GetSemaphore"},
{0x00090040, nullptr, "ClearSemaphore"},
{0x000A0040, nullptr, "MaskSemaphore"},
{0x000B0000, nullptr, "CheckSemaphoreRequest"},
{0x000C0040, &DSP_DSP::ConvertProcessAddressFromDspDram, "ConvertProcessAddressFromDspDram"},
{0x000D0082, &DSP_DSP::WriteProcessPipe, "WriteProcessPipe"},
{0x000E00C0, &DSP_DSP::ReadPipe, "ReadPipe"},
{0x000F0080, &DSP_DSP::GetPipeReadableSize, "GetPipeReadableSize"},
{0x001000C0, &DSP_DSP::ReadPipeIfPossible, "ReadPipeIfPossible"},
{0x001100C2, &DSP_DSP::LoadComponent, "LoadComponent"},
{0x00120000, &DSP_DSP::UnloadComponent, "UnloadComponent"},
{0x00130082, &DSP_DSP::FlushDataCache, "FlushDataCache"},
{0x00140082, &DSP_DSP::InvalidateDataCache, "InvalidateDCache"},
{0x00150082, &DSP_DSP::RegisterInterruptEvents, "RegisterInterruptEvents"},
{0x00160000, &DSP_DSP::GetSemaphoreEventHandle, "GetSemaphoreEventHandle"},
{0x00170040, &DSP_DSP::SetSemaphoreMask, "SetSemaphoreMask"},
{0x00180040, nullptr, "GetPhysicalAddress"},
{0x00190040, nullptr, "GetVirtualAddress"},
{0x001A0042, nullptr, "SetIirFilterI2S1_cmd1"},
{0x001B0042, nullptr, "SetIirFilterI2S1_cmd2"},
{0x001C0082, nullptr, "SetIirFilterEQ"},
{0x001D00C0, nullptr, "ReadMultiEx_SPI2"},
{0x001E00C2, nullptr, "WriteMultiEx_SPI2"},
{0x001F0000, &DSP_DSP::GetHeadphoneStatus, "GetHeadphoneStatus"},
{0x00200040, &DSP_DSP::ForceHeadphoneOut, "ForceHeadphoneOut"},
{0x00210000, nullptr, "GetIsDspOccupied"},
{IPC::MakeHeader(0x0001, 1, 0), &DSP_DSP::RecvData, "RecvData"},
{IPC::MakeHeader(0x0002, 1, 0), &DSP_DSP::RecvDataIsReady, "RecvDataIsReady"},
{IPC::MakeHeader(0x0003, 2, 0), nullptr, "SendData"},
{IPC::MakeHeader(0x0004, 1, 0), nullptr, "SendDataIsEmpty"},
{IPC::MakeHeader(0x0005, 3, 2), nullptr, "SendFifoEx"},
{IPC::MakeHeader(0x0006, 3, 0), nullptr, "RecvFifoEx"},
{IPC::MakeHeader(0x0007, 1, 0), &DSP_DSP::SetSemaphore, "SetSemaphore"},
{IPC::MakeHeader(0x0008, 0, 0), nullptr, "GetSemaphore"},
{IPC::MakeHeader(0x0009, 1, 0), nullptr, "ClearSemaphore"},
{IPC::MakeHeader(0x000A, 1, 0), nullptr, "MaskSemaphore"},
{IPC::MakeHeader(0x000B, 0, 0), nullptr, "CheckSemaphoreRequest"},
{IPC::MakeHeader(0x000C, 1, 0), &DSP_DSP::ConvertProcessAddressFromDspDram, "ConvertProcessAddressFromDspDram"},
{IPC::MakeHeader(0x000D, 2, 2), &DSP_DSP::WriteProcessPipe, "WriteProcessPipe"},
{IPC::MakeHeader(0x000E, 3, 0), &DSP_DSP::ReadPipe, "ReadPipe"},
{IPC::MakeHeader(0x000F, 2, 0), &DSP_DSP::GetPipeReadableSize, "GetPipeReadableSize"},
{IPC::MakeHeader(0x0010, 3, 0), &DSP_DSP::ReadPipeIfPossible, "ReadPipeIfPossible"},
{IPC::MakeHeader(0x0011, 3, 2), &DSP_DSP::LoadComponent, "LoadComponent"},
{IPC::MakeHeader(0x0012, 0, 0), &DSP_DSP::UnloadComponent, "UnloadComponent"},
{IPC::MakeHeader(0x0013, 2, 2), &DSP_DSP::FlushDataCache, "FlushDataCache"},
{IPC::MakeHeader(0x0014, 2, 2), &DSP_DSP::InvalidateDataCache, "InvalidateDCache"},
{IPC::MakeHeader(0x0015, 2, 2), &DSP_DSP::RegisterInterruptEvents, "RegisterInterruptEvents"},
{IPC::MakeHeader(0x0016, 0, 0), &DSP_DSP::GetSemaphoreEventHandle, "GetSemaphoreEventHandle"},
{IPC::MakeHeader(0x0017, 1, 0), &DSP_DSP::SetSemaphoreMask, "SetSemaphoreMask"},
{IPC::MakeHeader(0x0018, 1, 0), nullptr, "GetPhysicalAddress"},
{IPC::MakeHeader(0x0019, 1, 0), nullptr, "GetVirtualAddress"},
{IPC::MakeHeader(0x001A, 1, 2), nullptr, "SetIirFilterI2S1_cmd1"},
{IPC::MakeHeader(0x001B, 1, 2), nullptr, "SetIirFilterI2S1_cmd2"},
{IPC::MakeHeader(0x001C, 2, 2), nullptr, "SetIirFilterEQ"},
{IPC::MakeHeader(0x001D, 3, 0), nullptr, "ReadMultiEx_SPI2"},
{IPC::MakeHeader(0x001E, 3, 2), nullptr, "WriteMultiEx_SPI2"},
{IPC::MakeHeader(0x001F, 0, 0), &DSP_DSP::GetHeadphoneStatus, "GetHeadphoneStatus"},
{IPC::MakeHeader(0x0020, 1, 0), &DSP_DSP::ForceHeadphoneOut, "ForceHeadphoneOut"},
{IPC::MakeHeader(0x0021, 0, 0), nullptr, "GetIsDspOccupied"},
// clang-format on
};