summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitives.cc
blob: b1728bac7fa8a12518ae5ff8b2794555dcd66956 (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
/* ========================================

  Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.

======================================== */

#include <HALKit/ARM64/Processor.h>
#include <KernelKit/ProcessScheduler.h>

namespace Kernel {
/***********************************************************************************/
/// @brief Unimplemented function (crashes by default)
/// @param process The process handle.
/***********************************************************************************/

EXTERN_C Void __ne_pure_call(USER_PROCESS* process) {
  if (process) process->Crash();
}

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

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

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