diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index de80de893..cda183add 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <string.h> | 5 | #include <string.h> |
| 8 | 6 | ||
| 9 | #include "common/common.h" | 7 | #include "common/common.h" |
| @@ -14,6 +12,7 @@ | |||
| 14 | 12 | ||
| 15 | namespace Kernel { | 13 | namespace Kernel { |
| 16 | 14 | ||
| 15 | Handle g_main_thread = 0; | ||
| 17 | ObjectPool g_object_pool; | 16 | ObjectPool g_object_pool; |
| 18 | 17 | ||
| 19 | ObjectPool::ObjectPool() { | 18 | ObjectPool::ObjectPool() { |
| @@ -127,16 +126,20 @@ Object* ObjectPool::CreateByIDType(int type) { | |||
| 127 | 126 | ||
| 128 | default: | 127 | default: |
| 129 | ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type); | 128 | ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type); |
| 130 | return NULL; | 129 | return nullptr; |
| 131 | } | 130 | } |
| 132 | } | 131 | } |
| 133 | 132 | ||
| 133 | /// Initialize the kernel | ||
| 134 | void Init() { | 134 | void Init() { |
| 135 | Kernel::ThreadingInit(); | 135 | Kernel::ThreadingInit(); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | /// Shutdown the kernel | ||
| 138 | void Shutdown() { | 139 | void Shutdown() { |
| 139 | Kernel::ThreadingShutdown(); | 140 | Kernel::ThreadingShutdown(); |
| 141 | |||
| 142 | g_object_pool.Clear(); // Free all kernel objects | ||
| 140 | } | 143 | } |
| 141 | 144 | ||
| 142 | /** | 145 | /** |
| @@ -150,7 +153,7 @@ bool LoadExec(u32 entry_point) { | |||
| 150 | Core::g_app_core->SetPC(entry_point); | 153 | Core::g_app_core->SetPC(entry_point); |
| 151 | 154 | ||
| 152 | // 0x30 is the typical main thread priority I've seen used so far | 155 | // 0x30 is the typical main thread priority I've seen used so far |
| 153 | Handle thread = Kernel::SetupMainThread(0x30); | 156 | g_main_thread = Kernel::SetupMainThread(0x30); |
| 154 | 157 | ||
| 155 | return true; | 158 | return true; |
| 156 | } | 159 | } |