summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/HALKit/ARM64/HalSchedulerCore.cc
blob: c6585cb8a4e05c85515426d828bd38992e985d95 (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
/* -------------------------------------------

	Copyright (C) 2024, Theater Quality Corp, all rights reserved.

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

#include <HALKit/AMD64/Processor.h>
#include <KernelKit/UserProcessScheduler.h>

namespace Kernel
{
	/***********************************************************************************/
	/// @brief Unimplemented function (crashes by default)
	/// @param void
	/***********************************************************************************/

	EXTERN_C Void __zka_pure_call(void)
	{
		UserProcessScheduler::The().GetCurrentProcess().Leak().Crash();
	}

	/***********************************************************************************/
	/// @brief Validate user stack.
	/// @param stack_ptr the frame pointer.
	/***********************************************************************************/

	Bool hal_check_stack(HAL::StackFramePtr stack_ptr)
	{
		if (!stack_ptr)
			return No;

		return stack_ptr->SP != 0 && stack_ptr->BP != 0;
	}
} // namespace Kernel