summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/POWER/Processor.hpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-09 00:42:44 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-09 00:42:44 +0200
commitaf8a516fc22865abd80d6e26f1541fa3d6bebfdc (patch)
tree96d42a10945fc03df022389aef54708383c1d616 /Kernel/HALKit/POWER/Processor.hpp
parenta874e9cc98df994178d55996943fe81799c61d2f (diff)
MHR-23: :boom:, refactors.
- Move NewBoot to /Boot, thus making Kernel directory only containing the kernel. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Kernel/HALKit/POWER/Processor.hpp')
-rw-r--r--Kernel/HALKit/POWER/Processor.hpp55
1 files changed, 55 insertions, 0 deletions
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 <NewKit/Defines.hpp>
+#include <NewKit/Utils.hpp>
+
+#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();