forked from ShuriZma/suyu
1
0
Fork 0

kernel/physical_core: Remove unused kernel reference member variable

This isn't used within the class, so it can be removed to simplify the
overall interface.

While we're in the same area, we can simplify a unique_ptr reset() call.
This commit is contained in:
Lioncash 2020-01-30 18:19:21 -05:00
parent 985d0f35e5
commit 51927bc9dc
3 changed files with 7 additions and 11 deletions

View File

@ -101,7 +101,7 @@ struct KernelCore::Impl {
void Initialize(KernelCore& kernel) { void Initialize(KernelCore& kernel) {
Shutdown(); Shutdown();
InitializePhysicalCores(kernel); InitializePhysicalCores();
InitializeSystemResourceLimit(kernel); InitializeSystemResourceLimit(kernel);
InitializeThreads(); InitializeThreads();
InitializePreemption(); InitializePreemption();
@ -131,14 +131,14 @@ struct KernelCore::Impl {
} }
cores.clear(); cores.clear();
exclusive_monitor.reset(nullptr); exclusive_monitor.reset();
} }
void InitializePhysicalCores(KernelCore& kernel) { void InitializePhysicalCores() {
exclusive_monitor = exclusive_monitor =
Core::MakeExclusiveMonitor(system.Memory(), global_scheduler.CpuCoresCount()); Core::MakeExclusiveMonitor(system.Memory(), global_scheduler.CpuCoresCount());
for (std::size_t i = 0; i < global_scheduler.CpuCoresCount(); i++) { for (std::size_t i = 0; i < global_scheduler.CpuCoresCount(); i++) {
cores.emplace_back(system, kernel, i, *exclusive_monitor); cores.emplace_back(system, i, *exclusive_monitor);
} }
} }

View File

@ -10,16 +10,15 @@
#include "core/arm/exclusive_monitor.h" #include "core/arm/exclusive_monitor.h"
#include "core/arm/unicorn/arm_unicorn.h" #include "core/arm/unicorn/arm_unicorn.h"
#include "core/core.h" #include "core/core.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/physical_core.h" #include "core/hle/kernel/physical_core.h"
#include "core/hle/kernel/scheduler.h" #include "core/hle/kernel/scheduler.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
namespace Kernel { namespace Kernel {
PhysicalCore::PhysicalCore(Core::System& system, KernelCore& kernel, std::size_t id, PhysicalCore::PhysicalCore(Core::System& system, std::size_t id,
Core::ExclusiveMonitor& exclusive_monitor) Core::ExclusiveMonitor& exclusive_monitor)
: core_index{id}, kernel{kernel} { : core_index{id} {
#ifdef ARCHITECTURE_x86_64 #ifdef ARCHITECTURE_x86_64
arm_interface = std::make_shared<Core::ARM_Dynarmic>(system, exclusive_monitor, core_index); arm_interface = std::make_shared<Core::ARM_Dynarmic>(system, exclusive_monitor, core_index);
#else #else

View File

@ -21,9 +21,7 @@ namespace Kernel {
class PhysicalCore { class PhysicalCore {
public: public:
PhysicalCore(Core::System& system, KernelCore& kernel, std::size_t id, PhysicalCore(Core::System& system, std::size_t id, Core::ExclusiveMonitor& exclusive_monitor);
Core::ExclusiveMonitor& exclusive_monitor);
~PhysicalCore(); ~PhysicalCore();
/// Execute current jit state /// Execute current jit state
@ -66,7 +64,6 @@ public:
private: private:
std::size_t core_index; std::size_t core_index;
KernelCore& kernel;
std::shared_ptr<Core::ARM_Interface> arm_interface; std::shared_ptr<Core::ARM_Interface> arm_interface;
std::shared_ptr<Kernel::Scheduler> scheduler; std::shared_ptr<Kernel::Scheduler> scheduler;
}; };