1
0
Fork 0

service/csnd: Stubbed DataCache functions

This commit is contained in:
NarcolepticK 2018-07-01 16:16:34 -04:00
parent 41d5b31a76
commit 1f345642c4
2 changed files with 114 additions and 7 deletions

View File

@ -44,8 +44,10 @@ void CSND_SND::Initialize(Kernel::HLERequestContext& ctx) {
void CSND_SND::Shutdown(Kernel::HLERequestContext& ctx) { void CSND_SND::Shutdown(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x02, 0, 0); IPC::RequestParser rp(ctx, 0x02, 0, 0);
if (shared_memory) shared_memory = nullptr; if (mutex)
if (mutex) mutex = nullptr; mutex = nullptr;
if (shared_memory)
shared_memory = nullptr;
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
@ -87,6 +89,54 @@ void CSND_SND::AcquireSoundChannels(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_CSND, "(STUBBED) called"); LOG_WARNING(Service_CSND, "(STUBBED) called");
} }
void CSND_SND::ReleaseSoundChannels(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x06, 0, 0);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS);
LOG_WARNING(Service_CSND, "(STUBBED) called");
}
void CSND_SND::FlushDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x9, 2, 2);
u32 address = rp.Pop<u32>();
u32 size = rp.Pop<u32>();
auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_CSND, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address,
size, process->process_id);
}
void CSND_SND::StoreDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0xA, 2, 2);
u32 address = rp.Pop<u32>();
u32 size = rp.Pop<u32>();
auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_CSND, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address,
size, process->process_id);
}
void CSND_SND::InvalidateDataCache(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0xB, 2, 2);
u32 address = rp.Pop<u32>();
u32 size = rp.Pop<u32>();
auto process = rp.PopObject<Kernel::Process>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_CSND, "(STUBBED) called address=0x{:08X}, size=0x{:08X}, process={}", address,
size, process->process_id);
}
CSND_SND::CSND_SND() : ServiceFramework("csnd:SND", 4) { CSND_SND::CSND_SND() : ServiceFramework("csnd:SND", 4) {
static const FunctionInfo functions[] = { static const FunctionInfo functions[] = {
// clang-format off // clang-format off
@ -95,12 +145,12 @@ CSND_SND::CSND_SND() : ServiceFramework("csnd:SND", 4) {
{0x00030040, &CSND_SND::ExecuteCommands, "ExecuteCommands"}, {0x00030040, &CSND_SND::ExecuteCommands, "ExecuteCommands"},
{0x00040080, nullptr, "ExecuteType1Commands"}, {0x00040080, nullptr, "ExecuteType1Commands"},
{0x00050000, &CSND_SND::AcquireSoundChannels, "AcquireSoundChannels"}, {0x00050000, &CSND_SND::AcquireSoundChannels, "AcquireSoundChannels"},
{0x00060000, nullptr, "ReleaseSoundChannels"}, {0x00060000, &CSND_SND::ReleaseSoundChannels, "ReleaseSoundChannels"},
{0x00070000, nullptr, "AcquireCaptureDevice"}, {0x00070000, nullptr, "AcquireCaptureDevice"},
{0x00080040, nullptr, "ReleaseCaptureDevice"}, {0x00080040, nullptr, "ReleaseCaptureDevice"},
{0x00090082, nullptr, "FlushDataCache"}, {0x00090082, &CSND_SND::FlushDataCache, "FlushDataCache"},
{0x000A0082, nullptr, "StoreDataCache"}, {0x000A0082, &CSND_SND::StoreDataCache, "StoreDataCache"},
{0x000B0082, nullptr, "InvalidateDataCache"}, {0x000B0082, &CSND_SND::InvalidateDataCache, "InvalidateDataCache"},
{0x000C0000, nullptr, "Reset"}, {0x000C0000, nullptr, "Reset"},
// clang-format on // clang-format on
}; };

View File

@ -64,8 +64,65 @@ private:
*/ */
void AcquireSoundChannels(Kernel::HLERequestContext& ctx); void AcquireSoundChannels(Kernel::HLERequestContext& ctx);
Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr; /**
* CSND_SND::ReleaseSoundChannels service function
* Inputs:
* 0 : Header Code[0x00060000]
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void ReleaseSoundChannels(Kernel::HLERequestContext& ctx);
/**
* CSND_SND::FlushDataCache service function
*
* This Function is a no-op, We aren't emulating the CPU cache any time soon.
*
* Inputs:
* 0 : Header Code[0x00090082]
* 1 : Address
* 2 : Size
* 3 : Value 0, some descriptor for the KProcess Handle
* 4 : KProcess handle
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void FlushDataCache(Kernel::HLERequestContext& ctx);
/**
* CSND_SND::StoreDataCache service function
*
* This Function is a no-op, We aren't emulating the CPU cache any time soon.
*
* Inputs:
* 0 : Header Code[0x000A0082]
* 1 : Address
* 2 : Size
* 3 : Value 0, some descriptor for the KProcess Handle
* 4 : KProcess handle
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void StoreDataCache(Kernel::HLERequestContext& ctx);
/**
* CSND_SND::InvalidateDataCache service function
*
* This Function is a no-op, We aren't emulating the CPU cache any time soon.
*
* Inputs:
* 0 : Header Code[0x000B0082]
* 1 : Address
* 2 : Size
* 3 : Value 0, some descriptor for the KProcess Handle
* 4 : KProcess handle
* Outputs:
* 1 : Result of function, 0 on success, otherwise error code
*/
void InvalidateDataCache(Kernel::HLERequestContext& ctx);
Kernel::SharedPtr<Kernel::Mutex> mutex = nullptr; Kernel::SharedPtr<Kernel::Mutex> mutex = nullptr;
Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr;
}; };
/// Initializes the CSND_SND Service /// Initializes the CSND_SND Service