kern: implement thread pinning/SvcSynchronizePreemptionState

This commit is contained in:
Michael Scire
2020-07-27 17:32:04 -07:00
committed by SciresM
parent b1f38be3ae
commit 787964f7e7
10 changed files with 230 additions and 19 deletions

View File

@@ -87,7 +87,7 @@ namespace ams::kern {
u8 current_svc_id;
bool is_calling_svc;
bool is_in_exception_handler;
bool is_preemption_state_pinned;
bool is_pinned;
s32 disable_count;
KThreadContext *context;
};
@@ -171,7 +171,7 @@ namespace ams::kern {
using ConditionVariableThreadTree = ConditionVariableThreadTreeTraits::TreeType<ConditionVariableComparator>;
WaiterList waiter_list{};
WaiterList paused_waiter_list{};
WaiterList pinned_waiter_list{};
KThread *lock_owner{};
ConditionVariableThreadTree *condvar_tree{};
uintptr_t debug_params[3]{};
@@ -249,6 +249,9 @@ namespace ams::kern {
this->GetStackParameters().disable_count--;
}
void Pin();
void Unpin();
NOINLINE void DisableCoreMigration();
NOINLINE void EnableCoreMigration();
@@ -281,7 +284,7 @@ namespace ams::kern {
ALWAYS_INLINE bool HasDpc() const {
MESOSPHERE_ASSERT_THIS();
return this->GetDpc() != 0;;
return this->GetDpc() != 0;
}
private:
void Suspend();