summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-28 14:33:43 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-28 14:33:43 +0100
commitf69bd40d5d97e371451d2e9c27721422141d828f (patch)
treecaceff362a4631bb66d92d87898687364e11f2ca /Private/HALKit
parentb177e9c4c954170b590d777fe77442ff3a0cd8d7 (diff)
KernelKit/ProcessManager: add new ProcessPrimitives file, specific to
each architecture, lint-fix and improvements. Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit')
-rw-r--r--Private/HALKit/AMD64/ProcessPrimitives.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/Private/HALKit/AMD64/ProcessPrimitives.cxx b/Private/HALKit/AMD64/ProcessPrimitives.cxx
new file mode 100644
index 00000000..f5b19861
--- /dev/null
+++ b/Private/HALKit/AMD64/ProcessPrimitives.cxx
@@ -0,0 +1,26 @@
+/*
+ * ========================================================
+ *
+ * hCore
+ * Copyright 2024 Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#include "NewKit/Defines.hpp"
+#include <KernelKit/ProcessManager.hpp>
+
+using namespace hCore;
+
+Void Process::AssignStart(UIntPtr &imageStart) noexcept
+{
+ if (imageStart == 0)
+ this->Crash();
+
+#ifdef __x86_64__
+ this->StackFrame->Rbp = imageStart;
+#elif defined(__powerpc)
+ // link return register towards the __start symbol.
+ this->StackFrame->R3 = imageStart;
+#endif
+}