mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-10 06:01:52 +00:00
kern: complete final SVC stubs (KernelDebug/Trace debug-impl still TODO)
This commit is contained in:
parent
5d462c626c
commit
3fd4002bc9
4 changed files with 69 additions and 7 deletions
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ams::kern::svc::CallCallSecureMonitor64From32() */
|
||||
.section .text._ZN3ams4kern3svc29CallCallSecureMonitor64From32Ev, "ax", %progbits
|
||||
.global _ZN3ams4kern3svc29CallCallSecureMonitor64From32Ev
|
||||
.type _ZN3ams4kern3svc29CallCallSecureMonitor64From32Ev, %function
|
||||
_ZN3ams4kern3svc29CallCallSecureMonitor64From32Ev:
|
||||
/* Secure Monitor 64-from-32 ABI is not supported. */
|
||||
mov x0, xzr
|
||||
mov x1, xzr
|
||||
mov x2, xzr
|
||||
mov x3, xzr
|
||||
mov x4, xzr
|
||||
mov x5, xzr
|
||||
mov x6, xzr
|
||||
mov x7, xzr
|
||||
|
||||
ret
|
|
@ -33,6 +33,9 @@ namespace ams::kern::svc {
|
|||
void CallReturnFromException64();
|
||||
void CallReturnFromException64From32();
|
||||
|
||||
/* Declare special prototype for (unsupported) CallCallSecureMonitor64From32. */
|
||||
void CallCallSecureMonitor64From32();
|
||||
|
||||
namespace {
|
||||
|
||||
#ifndef MESOSPHERE_USE_STUBBED_SVC_TABLES
|
||||
|
@ -75,6 +78,8 @@ namespace ams::kern::svc {
|
|||
|
||||
table[svc::SvcId_ReturnFromException] = CallReturnFromException64From32;
|
||||
|
||||
table[svc::SvcId_CallSecureMonitor] = CallCallSecureMonitor64From32;
|
||||
|
||||
return table;
|
||||
}();
|
||||
|
||||
|
|
|
@ -21,28 +21,55 @@ namespace ams::kern::svc {
|
|||
|
||||
namespace {
|
||||
|
||||
void KernelDebug(ams::svc::KernelDebugType kern_debug_type, uint64_t arg0, uint64_t arg1, uint64_t arg2) {
|
||||
#ifdef ATMOSPHERE_BUILD_FOR_DEBUGGING
|
||||
{
|
||||
/* TODO: Implement Kernel Debugging. */
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ChangeKernelTraceState(ams::svc::KernelTraceState kern_trace_state) {
|
||||
#ifdef ATMOSPHERE_BUILD_FOR_DEBUGGING
|
||||
{
|
||||
switch (kern_trace_state) {
|
||||
case ams::svc::KernelTraceState_Enabled:
|
||||
{
|
||||
/* TODO: MESOSPHERE_KTRACE_RESUME(); */
|
||||
}
|
||||
break;
|
||||
case ams::svc::KernelTraceState_Disabled:
|
||||
{
|
||||
/* TODO: MESOSPHERE_KTRACE_PAUSE(); */
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ============================= 64 ABI ============================= */
|
||||
|
||||
void KernelDebug64(ams::svc::KernelDebugType kern_debug_type, uint64_t arg0, uint64_t arg1, uint64_t arg2) {
|
||||
MESOSPHERE_PANIC("Stubbed SvcKernelDebug64 was called.");
|
||||
return KernelDebug(kern_debug_type, arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
void ChangeKernelTraceState64(ams::svc::KernelTraceState kern_trace_state) {
|
||||
MESOSPHERE_PANIC("Stubbed SvcChangeKernelTraceState64 was called.");
|
||||
return ChangeKernelTraceState(kern_trace_state);
|
||||
}
|
||||
|
||||
/* ============================= 64From32 ABI ============================= */
|
||||
|
||||
void KernelDebug64From32(ams::svc::KernelDebugType kern_debug_type, uint64_t arg0, uint64_t arg1, uint64_t arg2) {
|
||||
MESOSPHERE_PANIC("Stubbed SvcKernelDebug64From32 was called.");
|
||||
return KernelDebug(kern_debug_type, arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
void ChangeKernelTraceState64From32(ams::svc::KernelTraceState kern_trace_state) {
|
||||
MESOSPHERE_PANIC("Stubbed SvcChangeKernelTraceState64From32 was called.");
|
||||
return ChangeKernelTraceState(kern_trace_state);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@ namespace ams::kern::svc {
|
|||
|
||||
/* ============================= 64From32 ABI ============================= */
|
||||
|
||||
void CallSecureMonitor64From32(ams::svc::ilp32::SecureMonitorArguments *args) {
|
||||
MESOSPHERE_PANIC("Stubbed SvcCallSecureMonitor64From32 was called.");
|
||||
}
|
||||
/* CallSecureMonitor64From32 is not supported. */
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue