kern: svcOutputDebugString, svcGetThreadPriority, svcGetThreadId

This commit is contained in:
Michael Scire
2020-07-09 13:07:38 -07:00
parent 1a0696f8a3
commit a2eb93fde8
4 changed files with 93 additions and 15 deletions

View File

@@ -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);
}
}