summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 07da4c493..2293669e5 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -171,6 +171,14 @@ const std::shared_ptr<Kernel::Scheduler>& System::Scheduler(size_t core_index) {
return cpu_cores[core_index]->Scheduler();
}
+Kernel::KernelCore& System::Kernel() {
+ return kernel;
+}
+
+const Kernel::KernelCore& System::Kernel() const {
+ return kernel;
+}
+
ARM_Interface& System::ArmInterface(size_t core_index) {
ASSERT(core_index < NUM_CPU_CORES);
return cpu_cores[core_index]->ArmInterface();
@@ -185,12 +193,13 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) {
LOG_DEBUG(HW_Memory, "initialized OK");
CoreTiming::Init();
+ kernel.Initialize();
// Create a default fs if one doesn't already exist.
if (virtual_filesystem == nullptr)
virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>();
- current_process = Kernel::Process::Create("main");
+ current_process = Kernel::Process::Create(kernel, "main");
cpu_barrier = std::make_shared<CpuBarrier>();
cpu_exclusive_monitor = Cpu::MakeExclusiveMonitor(cpu_cores.size());
@@ -201,7 +210,6 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) {
telemetry_session = std::make_unique<Core::TelemetrySession>();
service_manager = std::make_shared<Service::SM::ServiceManager>();
- Kernel::Init();
Service::Init(service_manager, virtual_filesystem);
GDBStub::Init();
@@ -246,7 +254,6 @@ void System::Shutdown() {
renderer.reset();
GDBStub::Shutdown();
Service::Shutdown();
- Kernel::Shutdown();
service_manager.reset();
telemetry_session.reset();
gpu_core.reset();
@@ -265,7 +272,8 @@ void System::Shutdown() {
}
cpu_barrier.reset();
- // Close core timing
+ // Shutdown kernel and core timing
+ kernel.Shutdown();
CoreTiming::Shutdown();
// Close app loader