From af8a516fc22865abd80d6e26f1541fa3d6bebfdc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 9 May 2024 00:42:44 +0200 Subject: MHR-23: :boom:, refactors. - Move NewBoot to /Boot, thus making Kernel directory only containing the kernel. Signed-off-by: Amlal El Mahrouss --- Kernel/HALKit/POWER/Processor.hpp | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Kernel/HALKit/POWER/Processor.hpp (limited to 'Kernel/HALKit/POWER/Processor.hpp') diff --git a/Kernel/HALKit/POWER/Processor.hpp b/Kernel/HALKit/POWER/Processor.hpp new file mode 100644 index 00000000..dd2d98f4 --- /dev/null +++ b/Kernel/HALKit/POWER/Processor.hpp @@ -0,0 +1,55 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: POWER processor header. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define kHalPPCAlignment __attribute__((aligned(4))) + +namespace NewOS::HAL +{ + typedef UIntPtr Reg; + + struct kHalPPCAlignment StackFrame + { + Reg R0; + Reg R1; + Reg R2; + Reg R3; + Reg R4; + Reg R5; + Reg R6; + Reg R7; + Reg R8; + Reg PC; + Reg SP; + }; + + typedef StackFrame* StackFramePtr; + + inline void rt_halt() + { + while (1) + { + asm volatile("mr 0, 0"); // no oop. + } + } + + inline void rt_cli() + { + asm volatile("mr 0, 0"); // no oop + } +} // namespace NewOS::HAL + +EXTERN_C void int_handle_math(NewOS::UIntPtr sp); +EXTERN_C void int_handle_pf(NewOS::UIntPtr sp); + +/// @brief Flush system TLB. +EXTERN_C void hal_flush_tlb(); -- cgit v1.2.3