summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2016-12-22 17:47:44 +0100
committerGitHub <noreply@github.com>2016-12-22 17:47:44 +0100
commitaa47af7fb6efd0bda54cca2373ed978e538f6d61 (patch)
tree93d96872603f64925cd632f27bb5c7046cadeedf /src/core/hle/kernel
parentMerge pull request #2285 from mailwl/csnd-format (diff)
parentThreadContext: Move from "core" to "arm_interface". (diff)
downloadyuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar
yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.gz
yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.bz2
yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.lz
yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.xz
yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.tar.zst
yuzu-aa47af7fb6efd0bda54cca2373ed978e538f6d61.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp1
-rw-r--r--src/core/hle/kernel/kernel.h3
-rw-r--r--src/core/hle/kernel/thread.cpp17
-rw-r--r--src/core/hle/kernel/thread.h4
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 @@
#include "common/common_types.h"
#include "common/logging/log.h"
-#include "core/hle/hle.h"
#include "core/hle/kernel/address_arbiter.h"
#include "core/hle/kernel/thread.h"
#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 @@
#include <vector>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include "common/common_types.h"
-#include "core/hle/hle.h"
#include "core/hle/result.h"
namespace Kernel {
+using Handle = u32;
+
class Thread;
// 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 @@
#include "core/arm/skyeye_common/armstate.h"
#include "core/core.h"
#include "core/core_timing.h"
-#include "core/hle/hle.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/memory.h"
#include "core/hle/kernel/mutex.h"
@@ -188,7 +187,7 @@ static void SwitchContext(Thread* new_thread) {
// Save context for previous thread
if (previous_thread) {
previous_thread->last_running_ticks = CoreTiming::GetTicks();
- Core::g_app_core->SaveContext(previous_thread->context);
+ Core::CPU().SaveContext(previous_thread->context);
if (previous_thread->status == THREADSTATUS_RUNNING) {
// This is only the case when a reschedule is triggered without the current thread
@@ -214,8 +213,8 @@ static void SwitchContext(Thread* new_thread) {
// Restores thread to its nominal priority if it has been temporarily changed
new_thread->current_priority = new_thread->nominal_priority;
- Core::g_app_core->LoadContext(new_thread->context);
- Core::g_app_core->SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress());
+ Core::CPU().LoadContext(new_thread->context);
+ Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress());
} else {
current_thread = nullptr;
}
@@ -330,7 +329,7 @@ void Thread::ResumeFromWait() {
ready_queue.push_back(current_priority, this);
status = THREADSTATUS_READY;
- HLE::Reschedule(__func__);
+ Core::System::GetInstance().PrepareReschedule();
}
/**
@@ -385,9 +384,9 @@ std::tuple<u32, u32, bool> GetFreeThreadLocalSlot(std::vector<std::bitset<8>>& t
* @param entry_point Address of entry point for execution
* @param arg User argument for thread
*/
-static void ResetThreadContext(Core::ThreadContext& context, u32 stack_top, u32 entry_point,
- u32 arg) {
- memset(&context, 0, sizeof(Core::ThreadContext));
+static void ResetThreadContext(ARM_Interface::ThreadContext& context, u32 stack_top,
+ u32 entry_point, u32 arg) {
+ memset(&context, 0, sizeof(ARM_Interface::ThreadContext));
context.cpu_registers[0] = arg;
context.pc = entry_point;
@@ -545,8 +544,6 @@ void Reschedule() {
Thread* cur = GetCurrentThread();
Thread* next = PopNextReadyThread();
- HLE::DoneRescheduling();
-
if (cur && next) {
LOG_TRACE(Kernel, "context switch %u -> %u", cur->GetObjectId(), next->GetObjectId());
} 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 @@
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
#include "common/common_types.h"
+#include "core/arm/arm_interface.h"
#include "core/core.h"
-#include "core/hle/hle.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/result.h"
@@ -158,7 +158,7 @@ public:
return !wait_objects.empty();
}
- Core::ThreadContext context;
+ ARM_Interface::ThreadContext context;
u32 thread_id;