diff --git a/README.md b/README.md index 8d09e3242..0e94d9597 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 1647. +This is the source code for early-access 1648. ## Legal Notice diff --git a/src/core/hle/kernel/init/init_slab_setup.cpp b/src/core/hle/kernel/init/init_slab_setup.cpp index 3aa76ee33..2dd792e71 100755 --- a/src/core/hle/kernel/init/init_slab_setup.cpp +++ b/src/core/hle/kernel/init/init_slab_setup.cpp @@ -117,10 +117,6 @@ void InitializeSlabResourceCounts() { } } -size_t CalculateSlabHeapGapSize() { - return KernelSlabHeapGapsSize; -} - size_t CalculateTotalSlabHeapSize() { size_t size = 0; @@ -136,7 +132,7 @@ size_t CalculateTotalSlabHeapSize() { #undef ADD_SLAB_SIZE // Add the reserved size. - size += CalculateSlabHeapGapSize(); + size += KernelSlabHeapGapsSize; return size; } @@ -158,7 +154,7 @@ void InitializeSlabHeaps(Core::System& system, KMemoryLayout& memory_layout) { } // Create an array to represent the gaps between the slabs. - const size_t total_gap_size = CalculateSlabHeapGapSize(); + const size_t total_gap_size = KernelSlabHeapGapsSize; std::array slab_gaps; for (size_t i = 0; i < slab_gaps.size(); i++) { // Note: This is an off-by-one error from Nintendo's intention, because GenerateRandomRange diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 825fab694..5ebd47e49 100755 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -102,7 +102,7 @@ struct KernelCore::Impl { next_user_process_id = KProcess::ProcessIDMin; next_thread_id = 1; - for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { + for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { if (suspend_threads[core_id]) { suspend_threads[core_id]->Close(); suspend_threads[core_id] = nullptr; @@ -211,7 +211,7 @@ struct KernelCore::Impl { } void InitializeSuspendThreads() { - for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { + for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { suspend_threads[core_id] = KThread::Create(system.Kernel()); ASSERT(KThread::InitializeHighPriorityThread(system, suspend_threads[core_id], {}, {}, core_id) @@ -953,7 +953,7 @@ void KernelCore::Suspend(bool in_suspention) { { KScopedSchedulerLock lock(*this); const auto state = should_suspend ? ThreadState::Runnable : ThreadState::Waiting; - for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { + for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { impl->suspend_threads[core_id]->SetState(state); impl->suspend_threads[core_id]->SetWaitReasonForDebugging( ThreadWaitReasonForDebugging::Suspended); diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 80d70a816..52011be9c 100755 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -141,38 +141,6 @@ enum class ResourceLimitValueType { PeakValue, }; -ResultVal RetrieveResourceLimitValue(Core::System& system, Handle resource_limit, - u32 resource_type, ResourceLimitValueType value_type) { - std::lock_guard lock{HLE::g_hle_lock}; - const auto type = static_cast(resource_type); - if (!IsValidResourceType(type)) { - LOG_ERROR(Kernel_SVC, "Invalid resource limit type: '{}'", resource_type); - return ResultInvalidEnumValue; - } - - const auto* const current_process = system.Kernel().CurrentProcess(); - ASSERT(current_process != nullptr); - - auto resource_limit_object = - current_process->GetHandleTable().GetObject(resource_limit); - if (resource_limit_object.IsNull()) { - LOG_ERROR(Kernel_SVC, "Handle to non-existent resource limit instance used. Handle={:08X}", - resource_limit); - return ResultInvalidHandle; - } - - switch (value_type) { - case ResourceLimitValueType::CurrentValue: - return MakeResult(resource_limit_object->GetCurrentValue(type)); - case ResourceLimitValueType::LimitValue: - return MakeResult(resource_limit_object->GetLimitValue(type)); - case ResourceLimitValueType::PeakValue: - return MakeResult(resource_limit_object->GetPeakValue(type)); - default: - LOG_ERROR(Kernel_SVC, "Invalid resource value_type: '{}'", value_type); - return ResultInvalidEnumValue; - } -} } // Anonymous namespace /// Set the process heap to a given Size. It can both extend and shrink the heap.