diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-25 09:56:46 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-25 09:56:46 +0200 |
| commit | 5b30cacacf0f0ca6fb06bb34389f04b05ceb2b15 (patch) | |
| tree | 85c1fb5b167d3089483affe7060155a7d148d641 /dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitives.cc | |
| parent | ef3e3db6fafb43afd3e254b17c7169c603cdf416 (diff) | |
kernel!: lots of changes, see commit details.
refactor(hal): unify file naming and drop redundant architecture suffixes
feat(build): rename kernel and bootloader to 'ne_kernel' and 'ne_bootz'
refactor(memory): replace mm_get_phys_address with mm_get_page_addr
feat(bitmap): track bitmap allocator usage and add out-of-memory error
fix(heap): correct heap magic naming and alignment logic
chore(fs): downgrade HeFS disk size check to warning
chore(tools): clean up formatting in 'ping' and 'manual'
docs(design): update OS_DESIGN.drawio to reflect Hypr86 and new layout
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitives.cc')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitives.cc | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitives.cc b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitives.cc new file mode 100644 index 00000000..0c468e14 --- /dev/null +++ b/dev/kernel/HALKit/AMD64/HalSchedulerCorePrimitives.cc @@ -0,0 +1,47 @@ +/* ------------------------------------------- + + Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. + +------------------------------------------- */ + +#include <HALKit/AMD64/Processor.h> +#include <KernelKit/ProcessScheduler.h> + +namespace Kernel { +/***********************************************************************************/ +/// @brief Unimplemented function (crashes by default) +/// @param +/***********************************************************************************/ + +EXTERN_C Void __zka_pure_call(USER_PROCESS* process) { + if (process) process->Crash(); +} + +/***********************************************************************************/ +/// @brief Validate user stack. +/// @param stack_ptr the frame pointer. +/***********************************************************************************/ + +EXTERN_C Bool hal_check_stack(HAL::StackFramePtr stack_ptr) { + if (!stack_ptr) return No; + + return stack_ptr->SP != 0 && stack_ptr->IP != 0; +} + +/// @brief Wakes up thread. +/// Wakes up thread from the hang state. +Void mp_wakeup_thread(HAL::StackFrame* stack) { + NE_UNUSED(stack); + Kernel::UserProcessHelper::StartScheduling(); +} + +/// @brief makes the thread sleep on a loop. +/// hooks and hangs thread to prevent code from executing. +Void mp_hang_thread(HAL::StackFrame* stack) { + NE_UNUSED(stack); + + while (Yes) { + /* Nothing to do, code is spinning */ + } +} +} // namespace Kernel |
