summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp46
1 files changed, 37 insertions, 9 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 9c60576c1..6401af35a 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -255,9 +255,8 @@ static ResultCode CancelSynchronization(Handle thread_handle) {
/// Attempts to locks a mutex, creating it if it does not already exist
static ResultCode LockMutex(Handle holding_thread_handle, VAddr mutex_addr,
Handle requesting_thread_handle) {
- LOG_TRACE(Kernel_SVC,
- "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, "
- "requesting_current_thread_handle=0x%08X",
+ LOG_TRACE(Kernel_SVC, "called holding_thread_handle=0x%08X, mutex_addr=0x%llx, "
+ "requesting_current_thread_handle=0x%08X",
holding_thread_handle, mutex_addr, requesting_thread_handle);
SharedPtr<Thread> holding_thread = g_handle_table.Get<Thread>(holding_thread_handle);
@@ -305,14 +304,27 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
LOG_TRACE(Kernel_SVC, "called info_id=0x%X, info_sub_id=0x%X, handle=0x%08X", info_id,
info_sub_id, handle);
- ASSERT(handle == 0 || handle == CurrentProcess);
-
auto& vm_manager = g_current_process->vm_manager;
switch (static_cast<GetInfoType>(info_id)) {
case GetInfoType::AllowedCpuIdBitmask:
*result = g_current_process->allowed_processor_mask;
break;
+ case GetInfoType::AllowedThreadPrioBitmask:
+ *result = g_current_process->allowed_thread_priority_mask;
+ break;
+ case GetInfoType::MapRegionBaseAddr:
+ *result = vm_manager.GetAddressSpaceBaseAddr();
+ break;
+ case GetInfoType::MapRegionSize:
+ *result = vm_manager.GetAddressSpaceSize();
+ break;
+ case GetInfoType::HeapRegionBaseAddr:
+ *result = vm_manager.GetNewMapRegionBaseAddr() + vm_manager.GetNewMapRegionSize();
+ break;
+ case GetInfoType::HeapRegionSize:
+ *result = Memory::HEAP_SIZE;
+ break;
case GetInfoType::TotalMemoryUsage:
*result = vm_manager.GetTotalMemoryUsage();
break;
@@ -334,6 +346,18 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
case GetInfoType::NewMapRegionSize:
*result = vm_manager.GetNewMapRegionSize();
break;
+ case GetInfoType::IsVirtualAddressMemoryEnabled:
+ *result = g_current_process->is_virtual_address_memory_enabled;
+ break;
+ case GetInfoType::TitleId:
+ LOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query titleid, returned 0");
+ *result = 0;
+ break;
+ case GetInfoType::PrivilegedProcessId:
+ LOG_WARNING(Kernel_SVC,
+ "(STUBBED) Attempted to query priviledged process id bounds, returned 0");
+ *result = 0;
+ break;
default:
UNIMPLEMENTED();
}
@@ -522,9 +546,8 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V
Core::System::GetInstance().PrepareReschedule();
- LOG_TRACE(Kernel_SVC,
- "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, "
- "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X",
+ LOG_TRACE(Kernel_SVC, "called entrypoint=0x%08X (%s), arg=0x%08X, stacktop=0x%08X, "
+ "threadpriority=0x%08X, processorid=0x%08X : created handle=0x%08X",
entry_point, name.c_str(), arg, stack_top, priority, processor_id, *out_handle);
return RESULT_SUCCESS;
@@ -709,6 +732,11 @@ static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32
return RESULT_SUCCESS;
}
+static ResultCode SetThreadCoreMask(u64, u64, u64) {
+ LOG_WARNING(Kernel_SVC, "(STUBBED) called");
+ return RESULT_SUCCESS;
+}
+
namespace {
struct FunctionDef {
using Func = void();
@@ -735,7 +763,7 @@ static const FunctionDef SVC_Table[] = {
{0x0C, SvcWrap<GetThreadPriority>, "GetThreadPriority"},
{0x0D, SvcWrap<SetThreadPriority>, "SetThreadPriority"},
{0x0E, nullptr, "GetThreadCoreMask"},
- {0x0F, nullptr, "SetThreadCoreMask"},
+ {0x0F, SvcWrap<SetThreadCoreMask>, "SetThreadCoreMask"},
{0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"},
{0x11, nullptr, "SignalEvent"},
{0x12, nullptr, "ClearEvent"},