kern: add KProcess members

This commit is contained in:
Michael Scire 2020-02-18 05:04:49 -08:00
parent 772e1f1c4f
commit fba8fb539d
15 changed files with 460 additions and 96 deletions

View file

@ -81,7 +81,8 @@ namespace ams::kern {
MESOSPHERE_R_ABORT_UNLESS(Kernel::GetKernelPageTable().UnmapPageGroup(temp_address, pg, KMemoryState_Kernel));
/* Create a KProcess object. */
MESOSPHERE_TODO("Create a KProcess");
new_process = KProcess::Create();
MESOSPHERE_ABORT_UNLESS(new_process != nullptr);
/* Initialize the process. */
MESOSPHERE_TODO("Initialize the process");

View file

@ -17,6 +17,14 @@
namespace ams::kern {
void KProcess::Finalize() {
MESOSPHERE_TODO_IMPLEMENT();
}
void KProcess::DoWorkerTask() {
MESOSPHERE_TODO_IMPLEMENT();
}
void KProcess::SetPreemptionState() {
MESOSPHERE_TODO_IMPLEMENT();
}

View file

@ -96,7 +96,7 @@ namespace ams::kern {
/* Set parent and condvar tree. */
this->parent = nullptr;
this->cond_var_tree = nullptr;
this->cond_var = nullptr;
/* Set sync booleans. */
this->signaled = false;
@ -423,7 +423,7 @@ namespace ams::kern {
/* Ensure we don't violate condition variable red black tree invariants. */
if (auto *cond_var = thread->GetConditionVariable(); cond_var != nullptr) {
MESOSPHERE_TODO("Remove from condvar tree");
cond_var->BeforeUpdatePriority(thread);
}
/* Change the priority. */
@ -432,7 +432,7 @@ namespace ams::kern {
/* Restore the condition variable, if relevant. */
if (auto *cond_var = thread->GetConditionVariable(); cond_var != nullptr) {
MESOSPHERE_TODO("Re-insert into condvar tree");
cond_var->AfterUpdatePriority(thread);
}
/* Update the scheduler. */

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <mesosphere.hpp>
namespace ams::kern {
void KWaitObject::OnTimer() {
MESOSPHERE_TODO_IMPLEMENT();
}
}