diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index df309d523..b20c2d13a 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include "core/hle/kernel/client_port.h" | 28 | #include "core/hle/kernel/client_port.h" |
| 29 | #include "core/hle/kernel/errors.h" | 29 | #include "core/hle/kernel/errors.h" |
| 30 | #include "core/hle/kernel/handle_table.h" | 30 | #include "core/hle/kernel/handle_table.h" |
| 31 | #include "core/hle/kernel/k_resource_limit.h" | ||
| 31 | #include "core/hle/kernel/k_scheduler.h" | 32 | #include "core/hle/kernel/k_scheduler.h" |
| 32 | #include "core/hle/kernel/k_thread.h" | 33 | #include "core/hle/kernel/k_thread.h" |
| 33 | #include "core/hle/kernel/kernel.h" | 34 | #include "core/hle/kernel/kernel.h" |
| @@ -36,7 +37,6 @@ | |||
| 36 | #include "core/hle/kernel/memory/slab_heap.h" | 37 | #include "core/hle/kernel/memory/slab_heap.h" |
| 37 | #include "core/hle/kernel/physical_core.h" | 38 | #include "core/hle/kernel/physical_core.h" |
| 38 | #include "core/hle/kernel/process.h" | 39 | #include "core/hle/kernel/process.h" |
| 39 | #include "core/hle/kernel/resource_limit.h" | ||
| 40 | #include "core/hle/kernel/service_thread.h" | 40 | #include "core/hle/kernel/service_thread.h" |
| 41 | #include "core/hle/kernel/shared_memory.h" | 41 | #include "core/hle/kernel/shared_memory.h" |
| 42 | #include "core/hle/kernel/time_manager.h" | 42 | #include "core/hle/kernel/time_manager.h" |
| @@ -66,7 +66,7 @@ struct KernelCore::Impl { | |||
| 66 | is_phantom_mode_for_singlecore = false; | 66 | is_phantom_mode_for_singlecore = false; |
| 67 | 67 | ||
| 68 | InitializePhysicalCores(); | 68 | InitializePhysicalCores(); |
| 69 | InitializeSystemResourceLimit(kernel); | 69 | InitializeSystemResourceLimit(kernel, system); |
| 70 | InitializeMemoryLayout(); | 70 | InitializeMemoryLayout(); |
| 71 | InitializePreemption(kernel); | 71 | InitializePreemption(kernel); |
| 72 | InitializeSchedulers(); | 72 | InitializeSchedulers(); |
| @@ -131,19 +131,19 @@ struct KernelCore::Impl { | |||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | // Creates the default system resource limit | 133 | // Creates the default system resource limit |
| 134 | void InitializeSystemResourceLimit(KernelCore& kernel) { | 134 | void InitializeSystemResourceLimit(KernelCore& kernel, Core::System& system) { |
| 135 | system_resource_limit = ResourceLimit::Create(kernel); | 135 | system_resource_limit = std::make_shared<KResourceLimit>(kernel, system); |
| 136 | 136 | ||
| 137 | // If setting the default system values fails, then something seriously wrong has occurred. | 137 | // If setting the default system values fails, then something seriously wrong has occurred. |
| 138 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::PhysicalMemory, 0x100000000) | 138 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::PhysicalMemory, 0x100000000) |
| 139 | .IsSuccess()); | 139 | .IsSuccess()); |
| 140 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Threads, 800).IsSuccess()); | 140 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Threads, 800).IsSuccess()); |
| 141 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Events, 700).IsSuccess()); | 141 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Events, 700).IsSuccess()); |
| 142 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::TransferMemory, 200).IsSuccess()); | 142 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::TransferMemory, 200) |
| 143 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Sessions, 900).IsSuccess()); | 143 | .IsSuccess()); |
| 144 | ASSERT(system_resource_limit->SetLimitValue(LimitableResource::Sessions, 900).IsSuccess()); | ||
| 144 | 145 | ||
| 145 | if (!system_resource_limit->Reserve(ResourceType::PhysicalMemory, 0) || | 146 | if (!system_resource_limit->Reserve(LimitableResource::PhysicalMemory, 0x60000)) { |
| 146 | !system_resource_limit->Reserve(ResourceType::PhysicalMemory, 0x60000)) { | ||
| 147 | UNREACHABLE(); | 147 | UNREACHABLE(); |
| 148 | } | 148 | } |
| 149 | } | 149 | } |
| @@ -320,7 +320,7 @@ struct KernelCore::Impl { | |||
| 320 | std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context; | 320 | std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context; |
| 321 | Kernel::TimeManager time_manager; | 321 | Kernel::TimeManager time_manager; |
| 322 | 322 | ||
| 323 | std::shared_ptr<ResourceLimit> system_resource_limit; | 323 | std::shared_ptr<KResourceLimit> system_resource_limit; |
| 324 | 324 | ||
| 325 | std::shared_ptr<Core::Timing::EventType> preemption_event; | 325 | std::shared_ptr<Core::Timing::EventType> preemption_event; |
| 326 | 326 | ||
| @@ -390,7 +390,7 @@ void KernelCore::Shutdown() { | |||
| 390 | impl->Shutdown(); | 390 | impl->Shutdown(); |
| 391 | } | 391 | } |
| 392 | 392 | ||
| 393 | std::shared_ptr<ResourceLimit> KernelCore::GetSystemResourceLimit() const { | 393 | std::shared_ptr<KResourceLimit> KernelCore::GetSystemResourceLimit() const { |
| 394 | return impl->system_resource_limit; | 394 | return impl->system_resource_limit; |
| 395 | } | 395 | } |
| 396 | 396 | ||