diff options
| author | 2020-06-28 12:37:50 -0400 | |
|---|---|---|
| committer | 2020-06-28 12:37:50 -0400 | |
| commit | b05795d704e0c194215f815a5703db09e524b59a (patch) | |
| tree | ecf4023b4ee0c91555c1d8263762fcb9dcb04a17 /src/core/hle/kernel/kernel.h | |
| parent | Merge pull request #4196 from ogniK5377/nrr-nro-fixes (diff) | |
| parent | Core/Common: Address Feedback. (diff) | |
| download | yuzu-b05795d704e0c194215f815a5703db09e524b59a.tar.gz yuzu-b05795d704e0c194215f815a5703db09e524b59a.tar.xz yuzu-b05795d704e0c194215f815a5703db09e524b59a.zip | |
Merge pull request #3955 from FernandoS27/prometheus-2b
Remake Kernel Scheduling, CPU Management & Boot Management (Prometheus)
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 83de1f542..49bd47e89 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -4,15 +4,17 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 8 | #include <string> | 9 | #include <string> |
| 9 | #include <unordered_map> | 10 | #include <unordered_map> |
| 10 | #include <vector> | 11 | #include <vector> |
| 12 | #include "core/hardware_properties.h" | ||
| 11 | #include "core/hle/kernel/memory/memory_types.h" | 13 | #include "core/hle/kernel/memory/memory_types.h" |
| 12 | #include "core/hle/kernel/object.h" | 14 | #include "core/hle/kernel/object.h" |
| 13 | 15 | ||
| 14 | namespace Core { | 16 | namespace Core { |
| 15 | struct EmuThreadHandle; | 17 | class CPUInterruptHandler; |
| 16 | class ExclusiveMonitor; | 18 | class ExclusiveMonitor; |
| 17 | class System; | 19 | class System; |
| 18 | } // namespace Core | 20 | } // namespace Core |
| @@ -65,6 +67,9 @@ public: | |||
| 65 | KernelCore(KernelCore&&) = delete; | 67 | KernelCore(KernelCore&&) = delete; |
| 66 | KernelCore& operator=(KernelCore&&) = delete; | 68 | KernelCore& operator=(KernelCore&&) = delete; |
| 67 | 69 | ||
| 70 | /// Sets if emulation is multicore or single core, must be set before Initialize | ||
| 71 | void SetMulticore(bool is_multicore); | ||
| 72 | |||
| 68 | /// Resets the kernel to a clean slate for use. | 73 | /// Resets the kernel to a clean slate for use. |
| 69 | void Initialize(); | 74 | void Initialize(); |
| 70 | 75 | ||
| @@ -110,6 +115,18 @@ public: | |||
| 110 | /// Gets the an instance of the respective physical CPU core. | 115 | /// Gets the an instance of the respective physical CPU core. |
| 111 | const Kernel::PhysicalCore& PhysicalCore(std::size_t id) const; | 116 | const Kernel::PhysicalCore& PhysicalCore(std::size_t id) const; |
| 112 | 117 | ||
| 118 | /// Gets the sole instance of the Scheduler at the current running core. | ||
| 119 | Kernel::Scheduler& CurrentScheduler(); | ||
| 120 | |||
| 121 | /// Gets the sole instance of the Scheduler at the current running core. | ||
| 122 | const Kernel::Scheduler& CurrentScheduler() const; | ||
| 123 | |||
| 124 | /// Gets the an instance of the current physical CPU core. | ||
| 125 | Kernel::PhysicalCore& CurrentPhysicalCore(); | ||
| 126 | |||
| 127 | /// Gets the an instance of the current physical CPU core. | ||
| 128 | const Kernel::PhysicalCore& CurrentPhysicalCore() const; | ||
| 129 | |||
| 113 | /// Gets the an instance of the Synchronization Interface. | 130 | /// Gets the an instance of the Synchronization Interface. |
| 114 | Kernel::Synchronization& Synchronization(); | 131 | Kernel::Synchronization& Synchronization(); |
| 115 | 132 | ||
| @@ -129,6 +146,10 @@ public: | |||
| 129 | 146 | ||
| 130 | const Core::ExclusiveMonitor& GetExclusiveMonitor() const; | 147 | const Core::ExclusiveMonitor& GetExclusiveMonitor() const; |
| 131 | 148 | ||
| 149 | std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>& Interrupts(); | ||
| 150 | |||
| 151 | const std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>& Interrupts() const; | ||
| 152 | |||
| 132 | void InvalidateAllInstructionCaches(); | 153 | void InvalidateAllInstructionCaches(); |
| 133 | 154 | ||
| 134 | /// Adds a port to the named port table | 155 | /// Adds a port to the named port table |
| @@ -191,6 +212,18 @@ public: | |||
| 191 | /// Gets the shared memory object for Time services. | 212 | /// Gets the shared memory object for Time services. |
| 192 | const Kernel::SharedMemory& GetTimeSharedMem() const; | 213 | const Kernel::SharedMemory& GetTimeSharedMem() const; |
| 193 | 214 | ||
| 215 | /// Suspend/unsuspend the OS. | ||
| 216 | void Suspend(bool in_suspention); | ||
| 217 | |||
| 218 | /// Exceptional exit the OS. | ||
| 219 | void ExceptionalExit(); | ||
| 220 | |||
| 221 | bool IsMulticore() const; | ||
| 222 | |||
| 223 | void EnterSVCProfile(); | ||
| 224 | |||
| 225 | void ExitSVCProfile(); | ||
| 226 | |||
| 194 | private: | 227 | private: |
| 195 | friend class Object; | 228 | friend class Object; |
| 196 | friend class Process; | 229 | friend class Process; |
| @@ -208,9 +241,6 @@ private: | |||
| 208 | /// Creates a new thread ID, incrementing the internal thread ID counter. | 241 | /// Creates a new thread ID, incrementing the internal thread ID counter. |
| 209 | u64 CreateNewThreadID(); | 242 | u64 CreateNewThreadID(); |
| 210 | 243 | ||
| 211 | /// Retrieves the event type used for thread wakeup callbacks. | ||
| 212 | const std::shared_ptr<Core::Timing::EventType>& ThreadWakeupCallbackEventType() const; | ||
| 213 | |||
| 214 | /// Provides a reference to the global handle table. | 244 | /// Provides a reference to the global handle table. |
| 215 | Kernel::HandleTable& GlobalHandleTable(); | 245 | Kernel::HandleTable& GlobalHandleTable(); |
| 216 | 246 | ||
| @@ -219,6 +249,7 @@ private: | |||
| 219 | 249 | ||
| 220 | struct Impl; | 250 | struct Impl; |
| 221 | std::unique_ptr<Impl> impl; | 251 | std::unique_ptr<Impl> impl; |
| 252 | bool exception_exited{}; | ||
| 222 | }; | 253 | }; |
| 223 | 254 | ||
| 224 | } // namespace Kernel | 255 | } // namespace Kernel |