diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 16285c3f0..e3169f5a7 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -35,13 +35,14 @@ class SlabHeap; | |||
| 35 | 35 | ||
| 36 | class AddressArbiter; | 36 | class AddressArbiter; |
| 37 | class ClientPort; | 37 | class ClientPort; |
| 38 | class GlobalScheduler; | 38 | class GlobalSchedulerContext; |
| 39 | class HandleTable; | 39 | class HandleTable; |
| 40 | class PhysicalCore; | 40 | class PhysicalCore; |
| 41 | class Process; | 41 | class Process; |
| 42 | class ResourceLimit; | 42 | class ResourceLimit; |
| 43 | class Scheduler; | 43 | class KScheduler; |
| 44 | class SharedMemory; | 44 | class SharedMemory; |
| 45 | class ServiceThread; | ||
| 45 | class Synchronization; | 46 | class Synchronization; |
| 46 | class Thread; | 47 | class Thread; |
| 47 | class TimeManager; | 48 | class TimeManager; |
| @@ -74,6 +75,9 @@ public: | |||
| 74 | /// Resets the kernel to a clean slate for use. | 75 | /// Resets the kernel to a clean slate for use. |
| 75 | void Initialize(); | 76 | void Initialize(); |
| 76 | 77 | ||
| 78 | /// Initializes the CPU cores. | ||
| 79 | void InitializeCores(); | ||
| 80 | |||
| 77 | /// Clears all resources in use by the kernel instance. | 81 | /// Clears all resources in use by the kernel instance. |
| 78 | void Shutdown(); | 82 | void Shutdown(); |
| 79 | 83 | ||
| @@ -99,16 +103,16 @@ public: | |||
| 99 | const std::vector<std::shared_ptr<Process>>& GetProcessList() const; | 103 | const std::vector<std::shared_ptr<Process>>& GetProcessList() const; |
| 100 | 104 | ||
| 101 | /// Gets the sole instance of the global scheduler | 105 | /// Gets the sole instance of the global scheduler |
| 102 | Kernel::GlobalScheduler& GlobalScheduler(); | 106 | Kernel::GlobalSchedulerContext& GlobalSchedulerContext(); |
| 103 | 107 | ||
| 104 | /// Gets the sole instance of the global scheduler | 108 | /// Gets the sole instance of the global scheduler |
| 105 | const Kernel::GlobalScheduler& GlobalScheduler() const; | 109 | const Kernel::GlobalSchedulerContext& GlobalSchedulerContext() const; |
| 106 | 110 | ||
| 107 | /// Gets the sole instance of the Scheduler assoviated with cpu core 'id' | 111 | /// Gets the sole instance of the Scheduler assoviated with cpu core 'id' |
| 108 | Kernel::Scheduler& Scheduler(std::size_t id); | 112 | Kernel::KScheduler& Scheduler(std::size_t id); |
| 109 | 113 | ||
| 110 | /// Gets the sole instance of the Scheduler assoviated with cpu core 'id' | 114 | /// Gets the sole instance of the Scheduler assoviated with cpu core 'id' |
| 111 | const Kernel::Scheduler& Scheduler(std::size_t id) const; | 115 | const Kernel::KScheduler& Scheduler(std::size_t id) const; |
| 112 | 116 | ||
| 113 | /// Gets the an instance of the respective physical CPU core. | 117 | /// Gets the an instance of the respective physical CPU core. |
| 114 | Kernel::PhysicalCore& PhysicalCore(std::size_t id); | 118 | Kernel::PhysicalCore& PhysicalCore(std::size_t id); |
| @@ -117,10 +121,7 @@ public: | |||
| 117 | const Kernel::PhysicalCore& PhysicalCore(std::size_t id) const; | 121 | const Kernel::PhysicalCore& PhysicalCore(std::size_t id) const; |
| 118 | 122 | ||
| 119 | /// Gets the sole instance of the Scheduler at the current running core. | 123 | /// Gets the sole instance of the Scheduler at the current running core. |
| 120 | Kernel::Scheduler& CurrentScheduler(); | 124 | Kernel::KScheduler* CurrentScheduler(); |
| 121 | |||
| 122 | /// Gets the sole instance of the Scheduler at the current running core. | ||
| 123 | const Kernel::Scheduler& CurrentScheduler() const; | ||
| 124 | 125 | ||
| 125 | /// Gets the an instance of the current physical CPU core. | 126 | /// Gets the an instance of the current physical CPU core. |
| 126 | Kernel::PhysicalCore& CurrentPhysicalCore(); | 127 | Kernel::PhysicalCore& CurrentPhysicalCore(); |
| @@ -153,6 +154,8 @@ public: | |||
| 153 | 154 | ||
| 154 | void InvalidateAllInstructionCaches(); | 155 | void InvalidateAllInstructionCaches(); |
| 155 | 156 | ||
| 157 | void InvalidateCpuInstructionCacheRange(VAddr addr, std::size_t size); | ||
| 158 | |||
| 156 | /// Adds a port to the named port table | 159 | /// Adds a port to the named port table |
| 157 | void AddNamedPort(std::string name, std::shared_ptr<ClientPort> port); | 160 | void AddNamedPort(std::string name, std::shared_ptr<ClientPort> port); |
| 158 | 161 | ||
| @@ -225,6 +228,22 @@ public: | |||
| 225 | 228 | ||
| 226 | void ExitSVCProfile(); | 229 | void ExitSVCProfile(); |
| 227 | 230 | ||
| 231 | /** | ||
| 232 | * Creates an HLE service thread, which are used to execute service routines asynchronously. | ||
| 233 | * While these are allocated per ServerSession, these need to be owned and managed outside of | ||
| 234 | * ServerSession to avoid a circular dependency. | ||
| 235 | * @param name String name for the ServerSession creating this thread, used for debug purposes. | ||
| 236 | * @returns The a weak pointer newly created service thread. | ||
| 237 | */ | ||
| 238 | std::weak_ptr<Kernel::ServiceThread> CreateServiceThread(const std::string& name); | ||
| 239 | |||
| 240 | /** | ||
| 241 | * Releases a HLE service thread, instructing KernelCore to free it. This should be called when | ||
| 242 | * the ServerSession associated with the thread is destroyed. | ||
| 243 | * @param service_thread Service thread to release. | ||
| 244 | */ | ||
| 245 | void ReleaseServiceThread(std::weak_ptr<Kernel::ServiceThread> service_thread); | ||
| 246 | |||
| 228 | private: | 247 | private: |
| 229 | friend class Object; | 248 | friend class Object; |
| 230 | friend class Process; | 249 | friend class Process; |