|
@@ -22,6 +22,7 @@
|
|
|
#include "core/hle/kernel/k_light_lock.h"
|
|
#include "core/hle/kernel/k_light_lock.h"
|
|
|
#include "core/hle/kernel/k_spin_lock.h"
|
|
#include "core/hle/kernel/k_spin_lock.h"
|
|
|
#include "core/hle/kernel/k_synchronization_object.h"
|
|
#include "core/hle/kernel/k_synchronization_object.h"
|
|
|
|
|
+#include "core/hle/kernel/k_timer_task.h"
|
|
|
#include "core/hle/kernel/k_worker_task.h"
|
|
#include "core/hle/kernel/k_worker_task.h"
|
|
|
#include "core/hle/kernel/slab_helpers.h"
|
|
#include "core/hle/kernel/slab_helpers.h"
|
|
|
#include "core/hle/kernel/svc_common.h"
|
|
#include "core/hle/kernel/svc_common.h"
|
|
@@ -112,7 +113,8 @@ void SetCurrentThread(KernelCore& kernel, KThread* thread);
|
|
|
[[nodiscard]] s32 GetCurrentCoreId(KernelCore& kernel);
|
|
[[nodiscard]] s32 GetCurrentCoreId(KernelCore& kernel);
|
|
|
|
|
|
|
|
class KThread final : public KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>,
|
|
class KThread final : public KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>,
|
|
|
- public boost::intrusive::list_base_hook<> {
|
|
|
|
|
|
|
+ public boost::intrusive::list_base_hook<>,
|
|
|
|
|
+ public KTimerTask {
|
|
|
KERNEL_AUTOOBJECT_TRAITS(KThread, KSynchronizationObject);
|
|
KERNEL_AUTOOBJECT_TRAITS(KThread, KSynchronizationObject);
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
@@ -660,7 +662,7 @@ private:
|
|
|
union SyncObjectBuffer {
|
|
union SyncObjectBuffer {
|
|
|
std::array<KSynchronizationObject*, Svc::ArgumentHandleCountMax> sync_objects{};
|
|
std::array<KSynchronizationObject*, Svc::ArgumentHandleCountMax> sync_objects{};
|
|
|
std::array<Handle,
|
|
std::array<Handle,
|
|
|
- Svc::ArgumentHandleCountMax*(sizeof(KSynchronizationObject*) / sizeof(Handle))>
|
|
|
|
|
|
|
+ Svc::ArgumentHandleCountMax * (sizeof(KSynchronizationObject*) / sizeof(Handle))>
|
|
|
handles;
|
|
handles;
|
|
|
constexpr SyncObjectBuffer() {}
|
|
constexpr SyncObjectBuffer() {}
|
|
|
};
|
|
};
|
|
@@ -681,10 +683,8 @@ private:
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
template <typename T>
|
|
template <typename T>
|
|
|
- requires(
|
|
|
|
|
- std::same_as<T, KThread> ||
|
|
|
|
|
- std::same_as<T, RedBlackKeyType>) static constexpr int Compare(const T& lhs,
|
|
|
|
|
- const KThread& rhs) {
|
|
|
|
|
|
|
+ requires(std::same_as<T, KThread> || std::same_as<T, RedBlackKeyType>)
|
|
|
|
|
+ static constexpr int Compare(const T& lhs, const KThread& rhs) {
|
|
|
const u64 l_key = lhs.GetConditionVariableKey();
|
|
const u64 l_key = lhs.GetConditionVariableKey();
|
|
|
const u64 r_key = rhs.GetConditionVariableKey();
|
|
const u64 r_key = rhs.GetConditionVariableKey();
|
|
|
|
|
|
|
@@ -840,4 +840,8 @@ private:
|
|
|
KernelCore& kernel;
|
|
KernelCore& kernel;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+inline void KTimerTask::OnTimer() {
|
|
|
|
|
+ static_cast<KThread*>(this)->OnTimer();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
} // namespace Kernel
|
|
} // namespace Kernel
|