Merge pull request #3201 from lioncash/dump

kernel/svc: Provide implementations for svcDumpInfo/svcDumpInfoNew
This commit is contained in:
bunnei 2019-12-10 21:48:37 -05:00 committed by GitHub
commit 34f8881d3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View file

@ -1781,6 +1781,17 @@ static ResultCode SignalToAddress(Core::System& system, VAddr address, u32 type,
return address_arbiter.SignalToAddress(address, signal_type, value, num_to_wake); return address_arbiter.SignalToAddress(address, signal_type, value, num_to_wake);
} }
static void KernelDebug([[maybe_unused]] Core::System& system,
[[maybe_unused]] u32 kernel_debug_type, [[maybe_unused]] u64 param1,
[[maybe_unused]] u64 param2, [[maybe_unused]] u64 param3) {
// Intentionally do nothing, as this does nothing in released kernel binaries.
}
static void ChangeKernelTraceState([[maybe_unused]] Core::System& system,
[[maybe_unused]] u32 trace_state) {
// Intentionally do nothing, as this does nothing in released kernel binaries.
}
/// This returns the total CPU ticks elapsed since the CPU was powered-on /// This returns the total CPU ticks elapsed since the CPU was powered-on
static u64 GetSystemTick(Core::System& system) { static u64 GetSystemTick(Core::System& system) {
LOG_TRACE(Kernel_SVC, "called"); LOG_TRACE(Kernel_SVC, "called");
@ -2418,8 +2429,8 @@ static const FunctionDef SVC_Table[] = {
{0x39, nullptr, "Unknown"}, {0x39, nullptr, "Unknown"},
{0x3A, nullptr, "Unknown"}, {0x3A, nullptr, "Unknown"},
{0x3B, nullptr, "Unknown"}, {0x3B, nullptr, "Unknown"},
{0x3C, nullptr, "DumpInfo"}, {0x3C, SvcWrap<KernelDebug>, "KernelDebug"},
{0x3D, nullptr, "DumpInfoNew"}, {0x3D, SvcWrap<ChangeKernelTraceState>, "ChangeKernelTraceState"},
{0x3E, nullptr, "Unknown"}, {0x3E, nullptr, "Unknown"},
{0x3F, nullptr, "Unknown"}, {0x3F, nullptr, "Unknown"},
{0x40, nullptr, "CreateSession"}, {0x40, nullptr, "CreateSession"},

View file

@ -311,6 +311,17 @@ void SvcWrap(Core::System& system) {
func(system); func(system);
} }
template <void func(Core::System&, u32)>
void SvcWrap(Core::System& system) {
func(system, static_cast<u32>(Param(system, 0)));
}
template <void func(Core::System&, u32, u64, u64, u64)>
void SvcWrap(Core::System& system) {
func(system, static_cast<u32>(Param(system, 0)), Param(system, 1), Param(system, 2),
Param(system, 3));
}
template <void func(Core::System&, s64)> template <void func(Core::System&, s64)>
void SvcWrap(Core::System& system) { void SvcWrap(Core::System& system) {
func(system, static_cast<s64>(Param(system, 0))); func(system, static_cast<s64>(Param(system, 0)));