blob: e5b7a7eb66f85909ca8d32def035d7c3b1a6a6e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/* ========================================
Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
======================================== */
/***********************************************************************************/
/// @file UserProcessTeam.cc
/// @brief Process teams implementation.
/// @author Amlal El Mahrouss (amlal@nekernel.org)
/***********************************************************************************/
#include <KernelKit/UserProcessScheduler.h>
namespace Kernel {
UserProcessTeam::UserProcessTeam() {
for (SizeT i = 0U; i < this->mProcessList.Count(); ++i) {
this->mProcessList[i] = USER_PROCESS();
this->mProcessList[i].PTime = 0;
this->mProcessList[i].RTime = 0;
this->mProcessList[i].UTime = 0;
this->mProcessList[i].Status = ProcessStatusKind::kKilled;
this->mProcessList[i].ParentTeam = this;
}
this->mProcessCur = 0UL;
}
/***********************************************************************************/
/// @brief Process list array getter.
/// @return The list of process to schedule.
/***********************************************************************************/
Array<USER_PROCESS, kSchedProcessLimitPerTeam>& UserProcessTeam::AsArray() {
return this->mProcessList;
}
/***********************************************************************************/
/// @brief Get team ID.
/// @return The team's ID.
/***********************************************************************************/
ProcessID& UserProcessTeam::Id() noexcept {
return this->mTeamId;
}
/***********************************************************************************/
/// @brief Get current process getter as Ref.
/// @return The current process header.
/***********************************************************************************/
Ref<USER_PROCESS>& UserProcessTeam::AsRef() {
return this->mCurrentProcess;
}
} // namespace Kernel
// last rev 05-03-24
|