summaryrefslogtreecommitdiffhomepage
path: root/HALKit/Alpha
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-06 09:14:11 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-01-06 09:14:11 +0100
commit5339d016c07bf717ee388f4feb73544087324af0 (patch)
tree94be6f67ed626091f24aee24ec3b3be03d01e4e7 /HALKit/Alpha
git: port from mercurial repo.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'HALKit/Alpha')
-rw-r--r--HALKit/Alpha/CR.s11
-rw-r--r--HALKit/Alpha/CoreInterruptHandlerDEC.cpp0
-rw-r--r--HALKit/Alpha/CoreSyscallHandlerDEC.cpp21
-rw-r--r--HALKit/Alpha/HAL.s13
-rw-r--r--HALKit/Alpha/Processor.hpp10
-rw-r--r--HALKit/Alpha/README1
-rw-r--r--HALKit/Alpha/SYSCALL.s10
-rw-r--r--HALKit/Alpha/VM.s5
8 files changed, 71 insertions, 0 deletions
diff --git a/HALKit/Alpha/CR.s b/HALKit/Alpha/CR.s
new file mode 100644
index 00000000..b01dc619
--- /dev/null
+++ b/HALKit/Alpha/CR.s
@@ -0,0 +1,11 @@
+.globl read_lr1
+.globl read_lr0
+
+.section .text
+ read_lr0:
+ movq %r30, %cr3
+ ret
+
+ read_cr0:
+ movq %r30, %cr0
+ ret \ No newline at end of file
diff --git a/HALKit/Alpha/CoreInterruptHandlerDEC.cpp b/HALKit/Alpha/CoreInterruptHandlerDEC.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/HALKit/Alpha/CoreInterruptHandlerDEC.cpp
diff --git a/HALKit/Alpha/CoreSyscallHandlerDEC.cpp b/HALKit/Alpha/CoreSyscallHandlerDEC.cpp
new file mode 100644
index 00000000..d1c656d6
--- /dev/null
+++ b/HALKit/Alpha/CoreSyscallHandlerDEC.cpp
@@ -0,0 +1,21 @@
+/*
+ * ========================================================
+ *
+ * hCore
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#include <ArchKit/Arch.hpp>
+#include <HALKit/Alpha/Processor.hpp>
+
+hCore::Array<void (*)(hCore::Int32 id, hCore::HAL::StackFrame *), kMaxSyscalls> kSyscalls;
+
+extern "C" void rt_syscall_handle(hCore::HAL::StackFrame *stack)
+{
+ for (hCore::SizeT index = 0UL; index < kMaxSyscalls; ++index)
+ {
+ (kSyscalls[index].Leak().Leak())(stack->ID, stack);
+ }
+}
diff --git a/HALKit/Alpha/HAL.s b/HALKit/Alpha/HAL.s
new file mode 100644
index 00000000..46127130
--- /dev/null
+++ b/HALKit/Alpha/HAL.s
@@ -0,0 +1,13 @@
+.globl rt_wait_for_io
+
+.section .text
+rt_wait_for_io:
+ jmp .L
+.L:
+ jmp .L2
+ wtint ;; wait for interrupt
+.L2:
+
+ ret
+
+
diff --git a/HALKit/Alpha/Processor.hpp b/HALKit/Alpha/Processor.hpp
new file mode 100644
index 00000000..7e230c0e
--- /dev/null
+++ b/HALKit/Alpha/Processor.hpp
@@ -0,0 +1,10 @@
+/*
+ * ========================================================
+ *
+ * hCore
+ * Copyright XPX Corp, all rights reserved.
+ *
+ * ========================================================
+ */
+
+#pragma once \ No newline at end of file
diff --git a/HALKit/Alpha/README b/HALKit/Alpha/README
new file mode 100644
index 00000000..91e7b134
--- /dev/null
+++ b/HALKit/Alpha/README
@@ -0,0 +1 @@
+This is for DEC Alpha.
diff --git a/HALKit/Alpha/SYSCALL.s b/HALKit/Alpha/SYSCALL.s
new file mode 100644
index 00000000..19cab808
--- /dev/null
+++ b/HALKit/Alpha/SYSCALL.s
@@ -0,0 +1,10 @@
+.section .text
+system_handle_user_call:
+ .cfi_startproc
+
+ push %r0
+ jmp %r1
+ mov %r30, %r2
+
+ .cfi_endproc
+ retsys \ No newline at end of file
diff --git a/HALKit/Alpha/VM.s b/HALKit/Alpha/VM.s
new file mode 100644
index 00000000..d8d7aa71
--- /dev/null
+++ b/HALKit/Alpha/VM.s
@@ -0,0 +1,5 @@
+.global flush_tlb
+
+.section .text
+flush_tlb:
+ swppal \ No newline at end of file