diff options
| author | 2016-12-22 11:47:44 -0500 | |
|---|---|---|
| committer | 2016-12-22 11:47:44 -0500 | |
| commit | aa47af7fb6efd0bda54cca2373ed978e538f6d61 (patch) | |
| tree | 93d96872603f64925cd632f27bb5c7046cadeedf /src/core/hle/kernel | |
| parent | Merge pull request #2285 from mailwl/csnd-format (diff) | |
| parent | ThreadContext: Move from "core" to "arm_interface". (diff) | |
| download | yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.gz yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.xz yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.zip | |
Merge pull request #2343 from bunnei/core-cleanup
Core: Top-level consolidate & misc cleanup
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 4 |
4 files changed, 11 insertions, 14 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index b5a0cc3a3..01fab123e 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 6 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
| 7 | #include "core/hle/hle.h" | ||
| 8 | #include "core/hle/kernel/address_arbiter.h" | 7 | #include "core/hle/kernel/address_arbiter.h" |
| 9 | #include "core/hle/kernel/thread.h" | 8 | #include "core/hle/kernel/thread.h" |
| 10 | #include "core/memory.h" | 9 | #include "core/memory.h" |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 1adcf6c71..9503e7d04 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -11,11 +11,12 @@ | |||
| 11 | #include <vector> | 11 | #include <vector> |
| 12 | #include <boost/smart_ptr/intrusive_ptr.hpp> | 12 | #include <boost/smart_ptr/intrusive_ptr.hpp> |
| 13 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| 14 | #include "core/hle/hle.h" | ||
| 15 | #include "core/hle/result.h" | 14 | #include "core/hle/result.h" |
| 16 | 15 | ||
| 17 | namespace Kernel { | 16 | namespace Kernel { |
| 18 | 17 | ||
| 18 | using Handle = u32; | ||
| 19 | |||
| 19 | class Thread; | 20 | class Thread; |
| 20 | 21 | ||
| 21 | // TODO: Verify code | 22 | // TODO: Verify code |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 18b696f72..5fb95dada 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include "core/arm/skyeye_common/armstate.h" | 14 | #include "core/arm/skyeye_common/armstate.h" |
| 15 | #include "core/core.h" | 15 | #include "core/core.h" |
| 16 | #include "core/core_timing.h" | 16 | #include "core/core_timing.h" |
| 17 | #include "core/hle/hle.h" | ||
| 18 | #include "core/hle/kernel/kernel.h" | 17 | #include "core/hle/kernel/kernel.h" |
| 19 | #include "core/hle/kernel/memory.h" | 18 | #include "core/hle/kernel/memory.h" |
| 20 | #include "core/hle/kernel/mutex.h" | 19 | #include "core/hle/kernel/mutex.h" |
| @@ -188,7 +187,7 @@ static void SwitchContext(Thread* new_thread) { | |||
| 188 | // Save context for previous thread | 187 | // Save context for previous thread |
| 189 | if (previous_thread) { | 188 | if (previous_thread) { |
| 190 | previous_thread->last_running_ticks = CoreTiming::GetTicks(); | 189 | previous_thread->last_running_ticks = CoreTiming::GetTicks(); |
| 191 | Core::g_app_core->SaveContext(previous_thread->context); | 190 | Core::CPU().SaveContext(previous_thread->context); |
| 192 | 191 | ||
| 193 | if (previous_thread->status == THREADSTATUS_RUNNING) { | 192 | if (previous_thread->status == THREADSTATUS_RUNNING) { |
| 194 | // This is only the case when a reschedule is triggered without the current thread | 193 | // This is only the case when a reschedule is triggered without the current thread |
| @@ -214,8 +213,8 @@ static void SwitchContext(Thread* new_thread) { | |||
| 214 | // Restores thread to its nominal priority if it has been temporarily changed | 213 | // Restores thread to its nominal priority if it has been temporarily changed |
| 215 | new_thread->current_priority = new_thread->nominal_priority; | 214 | new_thread->current_priority = new_thread->nominal_priority; |
| 216 | 215 | ||
| 217 | Core::g_app_core->LoadContext(new_thread->context); | 216 | Core::CPU().LoadContext(new_thread->context); |
| 218 | Core::g_app_core->SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); | 217 | Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress()); |
| 219 | } else { | 218 | } else { |
| 220 | current_thread = nullptr; | 219 | current_thread = nullptr; |
| 221 | } | 220 | } |
| @@ -330,7 +329,7 @@ void Thread::ResumeFromWait() { | |||
| 330 | 329 | ||
| 331 | ready_queue.push_back(current_priority, this); | 330 | ready_queue.push_back(current_priority, this); |
| 332 | status = THREADSTATUS_READY; | 331 | status = THREADSTATUS_READY; |
| 333 | HLE::Reschedule(__func__); | 332 | Core::System::GetInstance().PrepareReschedule(); |
| 334 | } | 333 | } |
| 335 | 334 | ||
| 336 | /** | 335 | /** |
| @@ -385,9 +384,9 @@ std::tuple<u32, u32, bool> GetFreeThreadLocalSlot(std::vector<std::bitset<8>>& t | |||
| 385 | * @param entry_point Address of entry point for execution | 384 | * @param entry_point Address of entry point for execution |
| 386 | * @param arg User argument for thread | 385 | * @param arg User argument for thread |
| 387 | */ | 386 | */ |
| 388 | static void ResetThreadContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point, | 387 | static void ResetThreadContext(ARM_Interface::ThreadContext& context, u32 stack_top, |
| 389 | u32 arg) { | 388 | u32 entry_point, u32 arg) { |
| 390 | memset(&context, 0, sizeof(Core::ThreadContext)); | 389 | memset(&context, 0, sizeof(ARM_Interface::ThreadContext)); |
| 391 | 390 | ||
| 392 | context.cpu_registers[0] = arg; | 391 | context.cpu_registers[0] = arg; |
| 393 | context.pc = entry_point; | 392 | context.pc = entry_point; |
| @@ -545,8 +544,6 @@ void Reschedule() { | |||
| 545 | Thread* cur = GetCurrentThread(); | 544 | Thread* cur = GetCurrentThread(); |
| 546 | Thread* next = PopNextReadyThread(); | 545 | Thread* next = PopNextReadyThread(); |
| 547 | 546 | ||
| 548 | HLE::DoneRescheduling(); | ||
| 549 | |||
| 550 | if (cur && next) { | 547 | if (cur && next) { |
| 551 | LOG_TRACE(Kernel, "context switch %u -> %u", cur->GetObjectId(), next->GetObjectId()); | 548 | LOG_TRACE(Kernel, "context switch %u -> %u", cur->GetObjectId(), next->GetObjectId()); |
| 552 | } else if (cur) { | 549 | } else if (cur) { |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index d4fefc573..c77ac644d 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -10,8 +10,8 @@ | |||
| 10 | #include <boost/container/flat_map.hpp> | 10 | #include <boost/container/flat_map.hpp> |
| 11 | #include <boost/container/flat_set.hpp> | 11 | #include <boost/container/flat_set.hpp> |
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | #include "core/arm/arm_interface.h" | ||
| 13 | #include "core/core.h" | 14 | #include "core/core.h" |
| 14 | #include "core/hle/hle.h" | ||
| 15 | #include "core/hle/kernel/kernel.h" | 15 | #include "core/hle/kernel/kernel.h" |
| 16 | #include "core/hle/result.h" | 16 | #include "core/hle/result.h" |
| 17 | 17 | ||
| @@ -158,7 +158,7 @@ public: | |||
| 158 | return !wait_objects.empty(); | 158 | return !wait_objects.empty(); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | Core::ThreadContext context; | 161 | ARM_Interface::ThreadContext context; |
| 162 | 162 | ||
| 163 | u32 thread_id; | 163 | u32 thread_id; |
| 164 | 164 | ||