Added more svcGetInfo pairs

This commit is contained in:
David Marcec 2018-01-16 14:06:45 -08:00
parent c903372111
commit 68143af636
4 changed files with 29 additions and 2 deletions

View file

@ -131,6 +131,8 @@ public:
/// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse
/// this value from the process header. /// this value from the process header.
u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK; u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK;
u32 allowed_thread_priority_mask = 0xFFFFFFFF;
u32 is_virtual_address_memory_enabled = 0;
/// Current status of the process /// Current status of the process
ProcessStatus status; ProcessStatus status;

View file

@ -313,6 +313,15 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
case GetInfoType::AllowedCpuIdBitmask: case GetInfoType::AllowedCpuIdBitmask:
*result = g_current_process->allowed_processor_mask; *result = g_current_process->allowed_processor_mask;
break; 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::TotalMemoryUsage: case GetInfoType::TotalMemoryUsage:
*result = vm_manager.GetTotalMemoryUsage(); *result = vm_manager.GetTotalMemoryUsage();
break; break;
@ -334,6 +343,9 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id)
case GetInfoType::NewMapRegionSize: case GetInfoType::NewMapRegionSize:
*result = vm_manager.GetNewMapRegionSize(); *result = vm_manager.GetNewMapRegionSize();
break; break;
case GetInfoType::IsVirtualAddressMemoryEnabled:
*result = g_current_process->is_virtual_address_memory_enabled;
break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED();
} }

View file

@ -24,14 +24,27 @@ struct PageInfo {
enum class GetInfoType : u64 { enum class GetInfoType : u64 {
// 1.0.0+ // 1.0.0+
AllowedCpuIdBitmask = 0, AllowedCpuIdBitmask = 0,
AllowedThreadPrioBitmask = 1,
MapRegionBaseAddr = 2,
MapRegionSize = 3,
HeapRegionBaseAddr = 4,
HeapRegionSize = 5,
TotalMemoryUsage = 6, TotalMemoryUsage = 6,
TotalHeapUsage = 7, TotalHeapUsage = 7,
IsCurrentProcessBeingDebugged = 8,
ResourceHandleLimit = 9,
IdleTickCount = 10,
RandomEntropy = 11, RandomEntropy = 11,
PerformanceCounter = 0xF0000002,
// 2.0.0+ // 2.0.0+
AddressSpaceBaseAddr = 12, AddressSpaceBaseAddr = 12,
AddressSpaceSize = 13, AddressSpaceSize = 13,
NewMapRegionBaseAddr = 14, NewMapRegionBaseAddr = 14,
NewMapRegionSize = 15, NewMapRegionSize = 15,
// 3.0.0+
IsVirtualAddressMemoryEnabled = 16,
TitleId = 18,
PrivilegedProcessId = 19,
}; };
void CallSVC(u32 immediate); void CallSVC(u32 immediate);

View file

@ -356,12 +356,12 @@ void VMManager::UpdatePageTableForVMA(const VirtualMemoryArea& vma) {
u64 VMManager::GetTotalMemoryUsage() { u64 VMManager::GetTotalMemoryUsage() {
LOG_WARNING(Kernel, "(STUBBED) called"); LOG_WARNING(Kernel, "(STUBBED) called");
return 0x400000; return 0xBE000000;
} }
u64 VMManager::GetTotalHeapUsage() { u64 VMManager::GetTotalHeapUsage() {
LOG_WARNING(Kernel, "(STUBBED) called"); LOG_WARNING(Kernel, "(STUBBED) called");
return 0x10000; return 0x0;
} }
VAddr VMManager::GetAddressSpaceBaseAddr() { VAddr VMManager::GetAddressSpaceBaseAddr() {