summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-18 23:10:15 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-04-18 23:10:15 +0200
commit0ae4062bfe9936cc9fd2c7bb924442480b067d93 (patch)
tree491b3cfc9c751557c37213ff437e56f66d100a4d /Private/HALKit
parent706c58b9b9fa74c63180f490a1f48652d0408944 (diff)
MHR-5: initial commit.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit')
-rw-r--r--Private/HALKit/AMD64/HalHardwareMP.cpp10
-rw-r--r--Private/HALKit/PowerPC/HalHart.cxx (renamed from Private/HALKit/PowerPC/HalSMPManager.cxx)3
-rw-r--r--Private/HALKit/PowerPC/HalStartSequence.s10
-rw-r--r--Private/HALKit/PowerPC/Hart.hxx9
-rw-r--r--Private/HALKit/PowerPC/MBCI/.gitkeep (renamed from Private/HALKit/PowerPC/PCI/.gitkeep)0
-rw-r--r--Private/HALKit/PowerPC/MBCI/HalMBCIHost.cxx8
-rw-r--r--Private/HALKit/PowerPC/PCI/HalDevice.cxx1
-rw-r--r--Private/HALKit/PowerPC/Processor.hpp4
8 files changed, 30 insertions, 15 deletions
diff --git a/Private/HALKit/AMD64/HalHardwareMP.cpp b/Private/HALKit/AMD64/HalHardwareMP.cpp
index 0e9f3022..135222b9 100644
--- a/Private/HALKit/AMD64/HalHardwareMP.cpp
+++ b/Private/HALKit/AMD64/HalHardwareMP.cpp
@@ -19,20 +19,12 @@ void rt_wakeup_thread(HAL::StackFrame* stack) {
HAL::rt_sti();
}
-/// @brief Hangs until RCX register is cleared.
-/// @param stack
-static void __rt_hang_proc(HAL::StackFrame* stack) {
- while (stack->Rcx == 1) {
- ;
- }
-}
-
/// @brief makes thread sleep.
/// hooks and hangs thread to prevent code from executing.
void rt_hang_thread(HAL::StackFrame* stack) {
HAL::rt_cli();
- __rt_hang_proc(stack);
+ stack->Rcx = 1;
HAL::rt_sti();
}
diff --git a/Private/HALKit/PowerPC/HalSMPManager.cxx b/Private/HALKit/PowerPC/HalHart.cxx
index 26ebc399..102bab7d 100644
--- a/Private/HALKit/PowerPC/HalSMPManager.cxx
+++ b/Private/HALKit/PowerPC/HalHart.cxx
@@ -6,6 +6,7 @@
#include <HALKit/PowerPC/Processor.hpp>
#include <KernelKit/DebugOutput.hpp>
+#include <HALKit/PowerPC/Hart.hxx>
using namespace NewOS;
@@ -15,4 +16,4 @@ void rt_wakeup_thread(HAL::StackFramePtr stack) {}
/// @brief makes thread sleep.
/// hooks and hangs thread to prevent code from executing.
-void rt_hang_thread(HAL::StackFramePtr stack) {} \ No newline at end of file
+void rt_hang_thread(HAL::StackFramePtr stack) {}
diff --git a/Private/HALKit/PowerPC/HalStartSequence.s b/Private/HALKit/PowerPC/HalStartSequence.s
index 112ac73f..f50a4d4f 100644
--- a/Private/HALKit/PowerPC/HalStartSequence.s
+++ b/Private/HALKit/PowerPC/HalStartSequence.s
@@ -1,6 +1,14 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
.globl Main
+.extern HalKernelMain
.align 4
.text
Main:
- b Main
+ bl HalKernelMain
+ blr
diff --git a/Private/HALKit/PowerPC/Hart.hxx b/Private/HALKit/PowerPC/Hart.hxx
index 618cbd97..56d51243 100644
--- a/Private/HALKit/PowerPC/Hart.hxx
+++ b/Private/HALKit/PowerPC/Hart.hxx
@@ -15,6 +15,13 @@
#include <NewKit/Defines.hpp>
+/// @brief hardware thread indentification type.
typedef NewOS::Int32 PPCHartType;
-
+/// @brief Hardware thread information structure.
+typedef struct HalHardwareThread {
+ NewOS::UIntPtr fStartAddress;
+ NewOS::UInt8 fPrivleged : 1;
+ NewOS::UInt32 fPageFlags;
+ PPCHartType fIdentNumber;
+} HalHardwareThread;
diff --git a/Private/HALKit/PowerPC/PCI/.gitkeep b/Private/HALKit/PowerPC/MBCI/.gitkeep
index e69de29b..e69de29b 100644
--- a/Private/HALKit/PowerPC/PCI/.gitkeep
+++ b/Private/HALKit/PowerPC/MBCI/.gitkeep
diff --git a/Private/HALKit/PowerPC/MBCI/HalMBCIHost.cxx b/Private/HALKit/PowerPC/MBCI/HalMBCIHost.cxx
new file mode 100644
index 00000000..98371c43
--- /dev/null
+++ b/Private/HALKit/PowerPC/MBCI/HalMBCIHost.cxx
@@ -0,0 +1,8 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#include <HALKit/PowerPC/Processor.hpp>
+#include <KernelKit/DebugOutput.hpp>
diff --git a/Private/HALKit/PowerPC/PCI/HalDevice.cxx b/Private/HALKit/PowerPC/PCI/HalDevice.cxx
deleted file mode 100644
index 8b137891..00000000
--- a/Private/HALKit/PowerPC/PCI/HalDevice.cxx
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Private/HALKit/PowerPC/Processor.hpp b/Private/HALKit/PowerPC/Processor.hpp
index 19f8e799..12a5bd26 100644
--- a/Private/HALKit/PowerPC/Processor.hpp
+++ b/Private/HALKit/PowerPC/Processor.hpp
@@ -11,12 +11,12 @@
#include <NewKit/Defines.hpp>
#include <NewKit/Utils.hpp>
-#define __PPC_ALIGN __attribute__((aligned(4)))
+#define kHalPPCAlignment __attribute__((aligned(4)))
namespace NewOS::HAL {
typedef UIntPtr Reg;
-struct __PPC_ALIGN StackFrame {
+struct kHalPPCAlignment StackFrame {
Reg R0;
Reg R1;
Reg R2;