summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/src/UserProcessTeam.cc
blob: 918a62bb5f1b5d8f4008d8bc056211d2f769797f (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
58
/* -------------------------------------------

	Copyright (C) 2024, Amlal EL Mahrouss, all rights reserved.

------------------------------------------- */

/***********************************************************************************/
/// @file UserProcessTeam.cc
/// @brief Process teams implementation.
/***********************************************************************************/

#include <KernelKit/UserProcessScheduler.h>

namespace Kernel
{
	UserProcessTeam::UserProcessTeam()
	{
		for (SizeT i = 0U; i < this->mProcessList.Count(); ++i)
		{
			this->mProcessList[i]		 = UserProcess();
			this->mProcessList[i].Status = ProcessStatusKind::kKilled;
		}

		this->mProcessCount = 0UL;
	}

	/***********************************************************************************/
	/// @brief UserProcess list array getter.
	/// @return The list of process to schedule.
	/***********************************************************************************/

	Array<UserProcess, 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<UserProcess>& UserProcessTeam::AsRef()
	{
		return this->mCurrentProcess;
	}
} // namespace Kernel

// last rev 05-03-24