diff options
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 06edc296d..20f50458b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -56,6 +56,7 @@ enum class ThreadWakeupReason { | |||
| 56 | 56 | ||
| 57 | namespace Kernel { | 57 | namespace Kernel { |
| 58 | 58 | ||
| 59 | class KernelCore; | ||
| 59 | class Process; | 60 | class Process; |
| 60 | class Scheduler; | 61 | class Scheduler; |
| 61 | 62 | ||
| @@ -63,6 +64,7 @@ class Thread final : public WaitObject { | |||
| 63 | public: | 64 | public: |
| 64 | /** | 65 | /** |
| 65 | * Creates and returns a new thread. The new thread is immediately scheduled | 66 | * Creates and returns a new thread. The new thread is immediately scheduled |
| 67 | * @param kernel The kernel instance this thread will be created under. | ||
| 66 | * @param name The friendly name desired for the thread | 68 | * @param name The friendly name desired for the thread |
| 67 | * @param entry_point The address at which the thread should start execution | 69 | * @param entry_point The address at which the thread should start execution |
| 68 | * @param priority The thread's priority | 70 | * @param priority The thread's priority |
| @@ -72,8 +74,9 @@ public: | |||
| 72 | * @param owner_process The parent process for the thread | 74 | * @param owner_process The parent process for the thread |
| 73 | * @return A shared pointer to the newly created thread | 75 | * @return A shared pointer to the newly created thread |
| 74 | */ | 76 | */ |
| 75 | static ResultVal<SharedPtr<Thread>> Create(std::string name, VAddr entry_point, u32 priority, | 77 | static ResultVal<SharedPtr<Thread>> Create(KernelCore& kernel, std::string name, |
| 76 | u64 arg, s32 processor_id, VAddr stack_top, | 78 | VAddr entry_point, u32 priority, u64 arg, |
| 79 | s32 processor_id, VAddr stack_top, | ||
| 77 | SharedPtr<Process> owner_process); | 80 | SharedPtr<Process> owner_process); |
| 78 | 81 | ||
| 79 | std::string GetName() const override { | 82 | std::string GetName() const override { |
| @@ -263,7 +266,7 @@ public: | |||
| 263 | u64 affinity_mask{0x1}; | 266 | u64 affinity_mask{0x1}; |
| 264 | 267 | ||
| 265 | private: | 268 | private: |
| 266 | Thread(); | 269 | explicit Thread(KernelCore& kernel); |
| 267 | ~Thread() override; | 270 | ~Thread() override; |
| 268 | 271 | ||
| 269 | std::shared_ptr<std::vector<u8>> tls_memory = std::make_shared<std::vector<u8>>(); | 272 | std::shared_ptr<std::vector<u8>> tls_memory = std::make_shared<std::vector<u8>>(); |
| @@ -271,12 +274,13 @@ private: | |||
| 271 | 274 | ||
| 272 | /** | 275 | /** |
| 273 | * Sets up the primary application thread | 276 | * Sets up the primary application thread |
| 277 | * @param kernel The kernel instance to create the main thread under. | ||
| 274 | * @param entry_point The address at which the thread should start execution | 278 | * @param entry_point The address at which the thread should start execution |
| 275 | * @param priority The priority to give the main thread | 279 | * @param priority The priority to give the main thread |
| 276 | * @param owner_process The parent process for the main thread | 280 | * @param owner_process The parent process for the main thread |
| 277 | * @return A shared pointer to the main thread | 281 | * @return A shared pointer to the main thread |
| 278 | */ | 282 | */ |
| 279 | SharedPtr<Thread> SetupMainThread(VAddr entry_point, u32 priority, | 283 | SharedPtr<Thread> SetupMainThread(KernelCore& kernel, VAddr entry_point, u32 priority, |
| 280 | SharedPtr<Process> owner_process); | 284 | SharedPtr<Process> owner_process); |
| 281 | 285 | ||
| 282 | /** | 286 | /** |
| @@ -294,14 +298,4 @@ void WaitCurrentThread_Sleep(); | |||
| 294 | */ | 298 | */ |
| 295 | void ExitCurrentThread(); | 299 | void ExitCurrentThread(); |
| 296 | 300 | ||
| 297 | /** | ||
| 298 | * Initialize threading | ||
| 299 | */ | ||
| 300 | void ThreadingInit(); | ||
| 301 | |||
| 302 | /** | ||
| 303 | * Shutdown threading | ||
| 304 | */ | ||
| 305 | void ThreadingShutdown(); | ||
| 306 | |||
| 307 | } // namespace Kernel | 301 | } // namespace Kernel |