diff options
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 16 |
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) { | |||
| 171 | return cpu_cores[core_index]->Scheduler(); | 171 | return cpu_cores[core_index]->Scheduler(); |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | Kernel::KernelCore& System::Kernel() { | ||
| 175 | return kernel; | ||
| 176 | } | ||
| 177 | |||
| 178 | const Kernel::KernelCore& System::Kernel() const { | ||
| 179 | return kernel; | ||
| 180 | } | ||
| 181 | |||
| 174 | ARM_Interface& System::ArmInterface(size_t core_index) { | 182 | ARM_Interface& System::ArmInterface(size_t core_index) { |
| 175 | ASSERT(core_index < NUM_CPU_CORES); | 183 | ASSERT(core_index < NUM_CPU_CORES); |
| 176 | return cpu_cores[core_index]->ArmInterface(); | 184 | return cpu_cores[core_index]->ArmInterface(); |
| @@ -185,12 +193,13 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { | |||
| 185 | LOG_DEBUG(HW_Memory, "initialized OK"); | 193 | LOG_DEBUG(HW_Memory, "initialized OK"); |
| 186 | 194 | ||
| 187 | CoreTiming::Init(); | 195 | CoreTiming::Init(); |
| 196 | kernel.Initialize(); | ||
| 188 | 197 | ||
| 189 | // Create a default fs if one doesn't already exist. | 198 | // Create a default fs if one doesn't already exist. |
| 190 | if (virtual_filesystem == nullptr) | 199 | if (virtual_filesystem == nullptr) |
| 191 | virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>(); | 200 | virtual_filesystem = std::make_shared<FileSys::RealVfsFilesystem>(); |
| 192 | 201 | ||
| 193 | current_process = Kernel::Process::Create("main"); | 202 | current_process = Kernel::Process::Create(kernel, "main"); |
| 194 | 203 | ||
| 195 | cpu_barrier = std::make_shared<CpuBarrier>(); | 204 | cpu_barrier = std::make_shared<CpuBarrier>(); |
| 196 | cpu_exclusive_monitor = Cpu::MakeExclusiveMonitor(cpu_cores.size()); | 205 | cpu_exclusive_monitor = Cpu::MakeExclusiveMonitor(cpu_cores.size()); |
| @@ -201,7 +210,6 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window) { | |||
| 201 | telemetry_session = std::make_unique<Core::TelemetrySession>(); | 210 | telemetry_session = std::make_unique<Core::TelemetrySession>(); |
| 202 | service_manager = std::make_shared<Service::SM::ServiceManager>(); | 211 | service_manager = std::make_shared<Service::SM::ServiceManager>(); |
| 203 | 212 | ||
| 204 | Kernel::Init(); | ||
| 205 | Service::Init(service_manager, virtual_filesystem); | 213 | Service::Init(service_manager, virtual_filesystem); |
| 206 | GDBStub::Init(); | 214 | GDBStub::Init(); |
| 207 | 215 | ||
| @@ -246,7 +254,6 @@ void System::Shutdown() { | |||
| 246 | renderer.reset(); | 254 | renderer.reset(); |
| 247 | GDBStub::Shutdown(); | 255 | GDBStub::Shutdown(); |
| 248 | Service::Shutdown(); | 256 | Service::Shutdown(); |
| 249 | Kernel::Shutdown(); | ||
| 250 | service_manager.reset(); | 257 | service_manager.reset(); |
| 251 | telemetry_session.reset(); | 258 | telemetry_session.reset(); |
| 252 | gpu_core.reset(); | 259 | gpu_core.reset(); |
| @@ -265,7 +272,8 @@ void System::Shutdown() { | |||
| 265 | } | 272 | } |
| 266 | cpu_barrier.reset(); | 273 | cpu_barrier.reset(); |
| 267 | 274 | ||
| 268 | // Close core timing | 275 | // Shutdown kernel and core timing |
| 276 | kernel.Shutdown(); | ||
| 269 | CoreTiming::Shutdown(); | 277 | CoreTiming::Shutdown(); |
| 270 | 278 | ||
| 271 | // Close app loader | 279 | // Close app loader |