kern: svcOutputDebugString, svcGetThreadPriority, svcGetThreadId

This commit is contained in:
Michael Scire committed 2020-07-10 11:55:33 -07:00
1 parent 1a0696f8a3
commit a2eb93fde8
4 files changed
+93 -15

No files matched your search

@@ -21,20 +21,29 @@ namespace ams::kern::svc {
namespace {
Result OutputDebugString(KUserPointer<const char *> debug_str, size_t len) {
/* Succeed immediately if there's nothing to output. */
R_SUCCEED_IF(len == 0);
/* Ensure that the data being output is in range. */
R_UNLESS(GetCurrentProcess().GetPageTable().Contains(KProcessAddress(debug_str.GetUnsafePointer()), len), svc::ResultInvalidCurrentMemory());
/* Output the string. */
return KDebugLog::PrintUserString(debug_str, len);
}
}
/* ============================= 64 ABI ============================= */
Result OutputDebugString64(KUserPointer<const char *> debug_str, ams::svc::Size len) {
MESOSPHERE_PANIC("Stubbed SvcOutputDebugString64 was called.");
return OutputDebugString(debug_str, len);
}
/* ============================= 64From32 ABI ============================= */
Result OutputDebugString64From32(KUserPointer<const char *> debug_str, ams::svc::Size len) {
MESOSPHERE_PANIC("Stubbed SvcOutputDebugString64From32 was called.");
return OutputDebugString(debug_str, len);
}
}