mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-29 05:55:16 -04:00
kern: partially implement SvcSignalProcessWideKey
This commit is contained in:
parent
7f4c6ae9e7
commit
be98aaa185
5 changed files with 121 additions and 3 deletions
|
@ -64,6 +64,8 @@ namespace ams::kern {
|
|||
|
||||
this->tree.insert(*thread);
|
||||
}
|
||||
private:
|
||||
KThread *SignalImpl(KThread *thread);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -192,6 +192,22 @@ namespace ams::kern {
|
|||
|
||||
void SetPreemptionState();
|
||||
|
||||
Result SignalToAddress(KProcessAddress address) {
|
||||
return this->cond_var.SignalToAddress(address);
|
||||
}
|
||||
|
||||
Result WaitForAddress(ams::svc::Handle handle, KProcessAddress address, u32 tag) {
|
||||
return this->cond_var.WaitForAddress(handle, address, tag);
|
||||
}
|
||||
|
||||
void SignalConditionVariable(uintptr_t cv_key, int32_t count) {
|
||||
return this->cond_var.Signal(cv_key, count);
|
||||
}
|
||||
|
||||
Result WaitConditionVariable(KProcessAddress address, uintptr_t cv_key, u32 tag, s64 ns) {
|
||||
return this->cond_var.Wait(address, cv_key, tag, ns);
|
||||
}
|
||||
|
||||
static void Switch(KProcess *cur_process, KProcess *next_process) {
|
||||
/* Set the current process pointer. */
|
||||
SetCurrentProcess(next_process);
|
||||
|
|
|
@ -282,6 +282,15 @@ namespace ams::kern {
|
|||
|
||||
constexpr uintptr_t GetConditionVariableKey() const { return this->condvar_key; }
|
||||
|
||||
constexpr void SetupForConditionVariableCompare(uintptr_t cv_key, int priority) {
|
||||
this->condvar_key = cv_key;
|
||||
this->priority = priority;
|
||||
}
|
||||
|
||||
void ClearConditionVariable() {
|
||||
this->cond_var = nullptr;
|
||||
}
|
||||
|
||||
constexpr s32 GetIdealCore() const { return this->ideal_core_id; }
|
||||
constexpr s32 GetActiveCore() const { return this->core_id; }
|
||||
constexpr void SetActiveCore(s32 core) { this->core_id = core; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue