summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index ff9d9248b..0b39f2955 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -137,9 +137,10 @@ std::shared_ptr<ResourceLimit> Process::GetResourceLimit() const {
137} 137}
138 138
139u64 Process::GetTotalPhysicalMemoryAvailable() const { 139u64 Process::GetTotalPhysicalMemoryAvailable() const {
140 const u64 capacity{resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory) + 140 const u64 capacity{
141 page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + 141 static_cast<u64>(resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory)) +
142 main_thread_stack_size}; 142 page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size +
143 main_thread_stack_size};
143 144
144 if (capacity < memory_usage_capacity) { 145 if (capacity < memory_usage_capacity) {
145 return capacity; 146 return capacity;
@@ -279,12 +280,12 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata,
279 // Set initial resource limits 280 // Set initial resource limits
280 resource_limit->SetLimitValue( 281 resource_limit->SetLimitValue(
281 ResourceType::PhysicalMemory, 282 ResourceType::PhysicalMemory,
282 kernel.MemoryManager().GetSize(Memory::MemoryManager::Pool::Application)); 283 static_cast<s64>(kernel.MemoryManager().GetSize(Memory::MemoryManager::Pool::Application)));
283 resource_limit->SetLimitValue(ResourceType::Threads, 608); 284 resource_limit->SetLimitValue(ResourceType::Threads, 608);
284 resource_limit->SetLimitValue(ResourceType::Events, 700); 285 resource_limit->SetLimitValue(ResourceType::Events, 700);
285 resource_limit->SetLimitValue(ResourceType::TransferMemory, 128); 286 resource_limit->SetLimitValue(ResourceType::TransferMemory, 128);
286 resource_limit->SetLimitValue(ResourceType::Sessions, 894); 287 resource_limit->SetLimitValue(ResourceType::Sessions, 894);
287 ASSERT(resource_limit->Reserve(ResourceType::PhysicalMemory, code_size)); 288 ASSERT(resource_limit->Reserve(ResourceType::PhysicalMemory, static_cast<s64>(code_size)));
288 289
289 // Create TLS region 290 // Create TLS region
290 tls_region_address = CreateTLSRegion(); 291 tls_region_address = CreateTLSRegion();
@@ -300,9 +301,9 @@ void Process::Run(s32 main_thread_priority, u64 stack_size) {
300 301
301 ChangeStatus(ProcessStatus::Running); 302 ChangeStatus(ProcessStatus::Running);
302 303
303 SetupMainThread(system, *this, main_thread_priority, main_thread_stack_top); 304 SetupMainThread(system, *this, static_cast<u32>(main_thread_priority), main_thread_stack_top);
304 resource_limit->Reserve(ResourceType::Threads, 1); 305 resource_limit->Reserve(ResourceType::Threads, 1);
305 resource_limit->Reserve(ResourceType::PhysicalMemory, main_thread_stack_size); 306 resource_limit->Reserve(ResourceType::PhysicalMemory, static_cast<s64>(main_thread_stack_size));
306} 307}
307 308
308void Process::PrepareForTermination() { 309void Process::PrepareForTermination() {
@@ -363,7 +364,7 @@ VAddr Process::CreateTLSRegion() {
363 ->AllocateAndMapMemory(1, Memory::PageSize, true, start, size / Memory::PageSize, 364 ->AllocateAndMapMemory(1, Memory::PageSize, true, start, size / Memory::PageSize,
364 Memory::MemoryState::ThreadLocal, 365 Memory::MemoryState::ThreadLocal,
365 Memory::MemoryPermission::ReadAndWrite, tls_map_addr) 366 Memory::MemoryPermission::ReadAndWrite, tls_map_addr)
366 .ValueOr(0)}; 367 .ValueOr(0U)};
367 368
368 ASSERT(tls_page_addr); 369 ASSERT(tls_page_addr);
369 370