diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 1eede3063..c4f78ab71 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "core/hle/kernel/object.h" | 11 | #include "core/hle/kernel/object.h" |
| 12 | 12 | ||
| 13 | namespace Core { | 13 | namespace Core { |
| 14 | struct EmuThreadHandle; | ||
| 14 | class ExclusiveMonitor; | 15 | class ExclusiveMonitor; |
| 15 | class System; | 16 | class System; |
| 16 | } // namespace Core | 17 | } // namespace Core |
| @@ -29,8 +30,10 @@ class HandleTable; | |||
| 29 | class PhysicalCore; | 30 | class PhysicalCore; |
| 30 | class Process; | 31 | class Process; |
| 31 | class ResourceLimit; | 32 | class ResourceLimit; |
| 33 | class Scheduler; | ||
| 32 | class Synchronization; | 34 | class Synchronization; |
| 33 | class Thread; | 35 | class Thread; |
| 36 | class TimeManager; | ||
| 34 | 37 | ||
| 35 | /// Represents a single instance of the kernel. | 38 | /// Represents a single instance of the kernel. |
| 36 | class KernelCore { | 39 | class KernelCore { |
| @@ -64,7 +67,7 @@ public: | |||
| 64 | std::shared_ptr<ResourceLimit> GetSystemResourceLimit() const; | 67 | std::shared_ptr<ResourceLimit> GetSystemResourceLimit() const; |
| 65 | 68 | ||
| 66 | /// Retrieves a shared pointer to a Thread instance within the thread wakeup handle table. | 69 | /// Retrieves a shared pointer to a Thread instance within the thread wakeup handle table. |
| 67 | std::shared_ptr<Thread> RetrieveThreadFromWakeupCallbackHandleTable(Handle handle) const; | 70 | std::shared_ptr<Thread> RetrieveThreadFromGlobalHandleTable(Handle handle) const; |
| 68 | 71 | ||
| 69 | /// Adds the given shared pointer to an internal list of active processes. | 72 | /// Adds the given shared pointer to an internal list of active processes. |
| 70 | void AppendNewProcess(std::shared_ptr<Process> process); | 73 | void AppendNewProcess(std::shared_ptr<Process> process); |
| @@ -87,6 +90,12 @@ public: | |||
| 87 | /// Gets the sole instance of the global scheduler | 90 | /// Gets the sole instance of the global scheduler |
| 88 | const Kernel::GlobalScheduler& GlobalScheduler() const; | 91 | const Kernel::GlobalScheduler& GlobalScheduler() const; |
| 89 | 92 | ||
| 93 | /// Gets the sole instance of the Scheduler assoviated with cpu core 'id' | ||
| 94 | Kernel::Scheduler& Scheduler(std::size_t id); | ||
| 95 | |||
| 96 | /// Gets the sole instance of the Scheduler assoviated with cpu core 'id' | ||
| 97 | const Kernel::Scheduler& Scheduler(std::size_t id) const; | ||
| 98 | |||
| 90 | /// Gets the an instance of the respective physical CPU core. | 99 | /// Gets the an instance of the respective physical CPU core. |
| 91 | Kernel::PhysicalCore& PhysicalCore(std::size_t id); | 100 | Kernel::PhysicalCore& PhysicalCore(std::size_t id); |
| 92 | 101 | ||
| @@ -99,6 +108,12 @@ public: | |||
| 99 | /// Gets the an instance of the Synchronization Interface. | 108 | /// Gets the an instance of the Synchronization Interface. |
| 100 | const Kernel::Synchronization& Synchronization() const; | 109 | const Kernel::Synchronization& Synchronization() const; |
| 101 | 110 | ||
| 111 | /// Gets the an instance of the TimeManager Interface. | ||
| 112 | Kernel::TimeManager& TimeManager(); | ||
| 113 | |||
| 114 | /// Gets the an instance of the TimeManager Interface. | ||
| 115 | const Kernel::TimeManager& TimeManager() const; | ||
| 116 | |||
| 102 | /// Stops execution of 'id' core, in order to reschedule a new thread. | 117 | /// Stops execution of 'id' core, in order to reschedule a new thread. |
| 103 | void PrepareReschedule(std::size_t id); | 118 | void PrepareReschedule(std::size_t id); |
| 104 | 119 | ||
| @@ -120,6 +135,18 @@ public: | |||
| 120 | /// Determines whether or not the given port is a valid named port. | 135 | /// Determines whether or not the given port is a valid named port. |
| 121 | bool IsValidNamedPort(NamedPortTable::const_iterator port) const; | 136 | bool IsValidNamedPort(NamedPortTable::const_iterator port) const; |
| 122 | 137 | ||
| 138 | /// Gets the current host_thread/guest_thread handle. | ||
| 139 | Core::EmuThreadHandle GetCurrentEmuThreadID() const; | ||
| 140 | |||
| 141 | /// Gets the current host_thread handle. | ||
| 142 | u32 GetCurrentHostThreadID() const; | ||
| 143 | |||
| 144 | /// Register the current thread as a CPU Core Thread. | ||
| 145 | void RegisterCoreThread(std::size_t core_id); | ||
| 146 | |||
| 147 | /// Register the current thread as a non CPU core thread. | ||
| 148 | void RegisterHostThread(); | ||
| 149 | |||
| 123 | private: | 150 | private: |
| 124 | friend class Object; | 151 | friend class Object; |
| 125 | friend class Process; | 152 | friend class Process; |
| @@ -140,11 +167,11 @@ private: | |||
| 140 | /// Retrieves the event type used for thread wakeup callbacks. | 167 | /// Retrieves the event type used for thread wakeup callbacks. |
| 141 | const std::shared_ptr<Core::Timing::EventType>& ThreadWakeupCallbackEventType() const; | 168 | const std::shared_ptr<Core::Timing::EventType>& ThreadWakeupCallbackEventType() const; |
| 142 | 169 | ||
| 143 | /// Provides a reference to the thread wakeup callback handle table. | 170 | /// Provides a reference to the global handle table. |
| 144 | Kernel::HandleTable& ThreadWakeupCallbackHandleTable(); | 171 | Kernel::HandleTable& GlobalHandleTable(); |
| 145 | 172 | ||
| 146 | /// Provides a const reference to the thread wakeup callback handle table. | 173 | /// Provides a const reference to the global handle table. |
| 147 | const Kernel::HandleTable& ThreadWakeupCallbackHandleTable() const; | 174 | const Kernel::HandleTable& GlobalHandleTable() const; |
| 148 | 175 | ||
| 149 | struct Impl; | 176 | struct Impl; |
| 150 | std::unique_ptr<Impl> impl; | 177 | std::unique_ptr<Impl> impl; |