aboutsummaryrefslogtreecommitdiff
path: root/src/core/core.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-05-02 22:36:51 -0400
committerbunnei <bunneidev@gmail.com>2018-05-10 19:34:46 -0400
commita434fdcb102e96ddf564dc0973d7073d49bf19fc (patch)
treede758b0cc5ebcb67146397a74474fb898c0be51a /src/core/core.h
parent9776ff91797423a9cf19571faafe4648fb5a1d1d (diff)
core: Implement multicore support.
Diffstat (limited to 'src/core/core.h')
-rw-r--r--src/core/core.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/core/core.h b/src/core/core.h
index 21a0b074b8..3e0a7e6a7c 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -108,20 +108,26 @@ public:
PerfStats::Results GetAndResetPerfStats();
- /**
- * Gets a reference to the emulated CPU.
- * @returns A reference to the emulated CPU.
- */
- ARM_Interface& CPU() {
- return CurrentCpuCore().CPU();
+ ARM_Interface& CurrentArmInterface() {
+ return CurrentCpuCore().ArmInterface();
+ }
+
+ ARM_Interface& ArmInterface(size_t core_index) {
+ ASSERT(core_index < NUM_CPU_CORES);
+ return cpu_cores[core_index]->ArmInterface();
}
Tegra::GPU& GPU() {
return *gpu_core;
}
- Kernel::Scheduler& Scheduler() {
- return CurrentCpuCore().Scheduler();
+ Kernel::Scheduler& CurrentScheduler() {
+ return *CurrentCpuCore().Scheduler();
+ }
+
+ const std::shared_ptr<Kernel::Scheduler>& Scheduler(size_t core_index) {
+ ASSERT(core_index < NUM_CPU_CORES);
+ return cpu_cores[core_index]->Scheduler();
}
Kernel::SharedPtr<Kernel::Process>& CurrentProcess() {
@@ -198,8 +204,8 @@ private:
std::map<std::thread::id, std::shared_ptr<Cpu>> thread_to_cpu;
};
-inline ARM_Interface& CPU() {
- return System::GetInstance().CPU();
+inline ARM_Interface& CurrentArmInterface() {
+ return System::GetInstance().CurrentArmInterface();
}
inline TelemetrySession& Telemetry() {