diff options
| author | 2018-01-16 18:27:48 -0500 | |
|---|---|---|
| committer | 2018-01-16 18:27:48 -0500 | |
| commit | 1aa4cdc3c8326e5db875c8a26afe14d6fbffdc3d (patch) | |
| tree | 160c4a53715012ad8cb16c0738240d9530af4739 /src/core/hle/kernel | |
| parent | Merge pull request #45 from FearlessTobi/patch-1 (diff) | |
| parent | Update memory.h (diff) | |
| download | yuzu-1aa4cdc3c8326e5db875c8a26afe14d6fbffdc3d.tar.gz yuzu-1aa4cdc3c8326e5db875c8a26afe14d6fbffdc3d.tar.xz yuzu-1aa4cdc3c8326e5db875c8a26afe14d6fbffdc3d.zip | |
Merge pull request #52 from ogniK5377/fsp
added more svcGetInfo pairs for 3.0.0+ support, Changed HEAP_SIZE and TLS_AREA_VADDR. changed mem usage & heap usage stub added, ISelfController, IApplication function stubs. Added SetThreadCoreMask
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/process.h | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 19 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.h | 13 | ||||
| -rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 4 |
4 files changed, 35 insertions, 3 deletions
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 20b4e401c..add98472f 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h | |||
| @@ -131,6 +131,8 @@ public: | |||
| 131 | /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse | 131 | /// Bitmask of allowed CPUs that this process' threads can run on. TODO(Subv): Actually parse |
| 132 | /// this value from the process header. | 132 | /// this value from the process header. |
| 133 | u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK; | 133 | u32 allowed_processor_mask = THREADPROCESSORID_DEFAULT_MASK; |
| 134 | u32 allowed_thread_priority_mask = 0xFFFFFFFF; | ||
| 135 | u32 is_virtual_address_memory_enabled = 0; | ||
| 134 | /// Current status of the process | 136 | /// Current status of the process |
| 135 | ProcessStatus status; | 137 | ProcessStatus status; |
| 136 | 138 | ||
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 6b3fd13c9..056ba28ef 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -312,6 +312,15 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 312 | case GetInfoType::AllowedCpuIdBitmask: | 312 | case GetInfoType::AllowedCpuIdBitmask: |
| 313 | *result = g_current_process->allowed_processor_mask; | 313 | *result = g_current_process->allowed_processor_mask; |
| 314 | break; | 314 | break; |
| 315 | case GetInfoType::AllowedThreadPrioBitmask: | ||
| 316 | *result = g_current_process->allowed_thread_priority_mask; | ||
| 317 | break; | ||
| 318 | case GetInfoType::MapRegionBaseAddr: | ||
| 319 | *result = vm_manager.GetAddressSpaceBaseAddr(); | ||
| 320 | break; | ||
| 321 | case GetInfoType::MapRegionSize: | ||
| 322 | *result = vm_manager.GetAddressSpaceSize(); | ||
| 323 | break; | ||
| 315 | case GetInfoType::TotalMemoryUsage: | 324 | case GetInfoType::TotalMemoryUsage: |
| 316 | *result = vm_manager.GetTotalMemoryUsage(); | 325 | *result = vm_manager.GetTotalMemoryUsage(); |
| 317 | break; | 326 | break; |
| @@ -333,6 +342,9 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) | |||
| 333 | case GetInfoType::NewMapRegionSize: | 342 | case GetInfoType::NewMapRegionSize: |
| 334 | *result = vm_manager.GetNewMapRegionSize(); | 343 | *result = vm_manager.GetNewMapRegionSize(); |
| 335 | break; | 344 | break; |
| 345 | case GetInfoType::IsVirtualAddressMemoryEnabled: | ||
| 346 | *result = g_current_process->is_virtual_address_memory_enabled; | ||
| 347 | break; | ||
| 336 | default: | 348 | default: |
| 337 | UNIMPLEMENTED(); | 349 | UNIMPLEMENTED(); |
| 338 | } | 350 | } |
| @@ -707,6 +719,11 @@ static ResultCode CreateTransferMemory(Handle* handle, VAddr addr, u64 size, u32 | |||
| 707 | return RESULT_SUCCESS; | 719 | return RESULT_SUCCESS; |
| 708 | } | 720 | } |
| 709 | 721 | ||
| 722 | static ResultCode SetThreadCoreMask(u64, u64, u64) { | ||
| 723 | LOG_WARNING(Kernel_SVC, "(STUBBED) called"); | ||
| 724 | return RESULT_SUCCESS; | ||
| 725 | } | ||
| 726 | |||
| 710 | namespace { | 727 | namespace { |
| 711 | struct FunctionDef { | 728 | struct FunctionDef { |
| 712 | using Func = void(); | 729 | using Func = void(); |
| @@ -733,7 +750,7 @@ static const FunctionDef SVC_Table[] = { | |||
| 733 | {0x0C, SvcWrap<GetThreadPriority>, "GetThreadPriority"}, | 750 | {0x0C, SvcWrap<GetThreadPriority>, "GetThreadPriority"}, |
| 734 | {0x0D, SvcWrap<SetThreadPriority>, "SetThreadPriority"}, | 751 | {0x0D, SvcWrap<SetThreadPriority>, "SetThreadPriority"}, |
| 735 | {0x0E, nullptr, "GetThreadCoreMask"}, | 752 | {0x0E, nullptr, "GetThreadCoreMask"}, |
| 736 | {0x0F, nullptr, "SetThreadCoreMask"}, | 753 | {0x0F, SvcWrap<SetThreadCoreMask>, "SetThreadCoreMask"}, |
| 737 | {0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"}, | 754 | {0x10, SvcWrap<GetCurrentProcessorNumber>, "GetCurrentProcessorNumber"}, |
| 738 | {0x11, nullptr, "SignalEvent"}, | 755 | {0x11, nullptr, "SignalEvent"}, |
| 739 | {0x12, nullptr, "ClearEvent"}, | 756 | {0x12, nullptr, "ClearEvent"}, |
diff --git a/src/core/hle/kernel/svc.h b/src/core/hle/kernel/svc.h index 610cd1d7d..a56fd3602 100644 --- a/src/core/hle/kernel/svc.h +++ b/src/core/hle/kernel/svc.h | |||
| @@ -24,14 +24,27 @@ struct PageInfo { | |||
| 24 | enum class GetInfoType : u64 { | 24 | enum class GetInfoType : u64 { |
| 25 | // 1.0.0+ | 25 | // 1.0.0+ |
| 26 | AllowedCpuIdBitmask = 0, | 26 | AllowedCpuIdBitmask = 0, |
| 27 | AllowedThreadPrioBitmask = 1, | ||
| 28 | MapRegionBaseAddr = 2, | ||
| 29 | MapRegionSize = 3, | ||
| 30 | HeapRegionBaseAddr = 4, | ||
| 31 | HeapRegionSize = 5, | ||
| 27 | TotalMemoryUsage = 6, | 32 | TotalMemoryUsage = 6, |
| 28 | TotalHeapUsage = 7, | 33 | TotalHeapUsage = 7, |
| 34 | IsCurrentProcessBeingDebugged = 8, | ||
| 35 | ResourceHandleLimit = 9, | ||
| 36 | IdleTickCount = 10, | ||
| 29 | RandomEntropy = 11, | 37 | RandomEntropy = 11, |
| 38 | PerformanceCounter = 0xF0000002, | ||
| 30 | // 2.0.0+ | 39 | // 2.0.0+ |
| 31 | AddressSpaceBaseAddr = 12, | 40 | AddressSpaceBaseAddr = 12, |
| 32 | AddressSpaceSize = 13, | 41 | AddressSpaceSize = 13, |
| 33 | NewMapRegionBaseAddr = 14, | 42 | NewMapRegionBaseAddr = 14, |
| 34 | NewMapRegionSize = 15, | 43 | NewMapRegionSize = 15, |
| 44 | // 3.0.0+ | ||
| 45 | IsVirtualAddressMemoryEnabled = 16, | ||
| 46 | TitleId = 18, | ||
| 47 | PrivilegedProcessId = 19, | ||
| 35 | }; | 48 | }; |
| 36 | 49 | ||
| 37 | void CallSVC(u32 immediate); | 50 | void CallSVC(u32 immediate); |
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 650d47925..bf261699e 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp | |||
| @@ -357,12 +357,12 @@ void VMManager::UpdatePageTableForVMA(const VirtualMemoryArea& vma) { | |||
| 357 | 357 | ||
| 358 | u64 VMManager::GetTotalMemoryUsage() { | 358 | u64 VMManager::GetTotalMemoryUsage() { |
| 359 | LOG_WARNING(Kernel, "(STUBBED) called"); | 359 | LOG_WARNING(Kernel, "(STUBBED) called"); |
| 360 | return 0x400000; | 360 | return 0xBE000000; |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | u64 VMManager::GetTotalHeapUsage() { | 363 | u64 VMManager::GetTotalHeapUsage() { |
| 364 | LOG_WARNING(Kernel, "(STUBBED) called"); | 364 | LOG_WARNING(Kernel, "(STUBBED) called"); |
| 365 | return 0x10000; | 365 | return 0x0; |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | VAddr VMManager::GetAddressSpaceBaseAddr() { | 368 | VAddr VMManager::GetAddressSpaceBaseAddr() { |