summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/Sources/UserThreadScheduler.cxx
blob: 739f00ad6a2f01d1cf1709fbf47042bda78bc2ce (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
/*
 * ========================================================
 *
 * newoskrnl
 * Copyright ZKA Technologies., all rights reserved.
 *
 *  ========================================================
 */

#include <NewKit/String.hxx>
#include <CFKit/Property.hxx>
#include <KernelKit/UserProcessScheduler.hxx>

namespace Kernel
{
	/// \brief UserProcess thread information header.
	struct USER_THREAD_BLOCK final
	{
		STATIC constexpr SizeT cMaxLen = 256;

		Char		  fName[cMaxLen] = {"THREAD #0 (PROCESS 0)"};
		ProcessStatusKind fThreadStatus;
		Int64		  fThreadID;
		Int64*        fProcessID{nullptr};
		VoidPtr		  fCode{nullptr};
		VoidPtr		  fStack{nullptr};
		VoidPtr		  fData{nullptr};

		Void Exit() noexcept
		{
			this->fThreadStatus = ProcessStatusKind::kKilled;
		}

		VoidPtr GetStack() noexcept
		{
			return fStack;
		}

		VoidPtr GetData() noexcept
		{
			return fData;
		}

		VoidPtr GetPC() noexcept
		{
			return fCode;
		}
	};
} // namespace Detail