summaryrefslogtreecommitdiffhomepage
path: root/Kernel/HALKit/AXP
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/AXP
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/AXP')
-rw-r--r--Kernel/HALKit/AXP/CR.s11
-rw-r--r--Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp0
-rw-r--r--Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp20
-rw-r--r--Kernel/HALKit/AXP/HAL.s13
-rw-r--r--Kernel/HALKit/AXP/Processor.hpp7
-rw-r--r--Kernel/HALKit/AXP/README1
-rw-r--r--Kernel/HALKit/AXP/README.TXT1
-rw-r--r--Kernel/HALKit/AXP/SYSCALL.s10
-rw-r--r--Kernel/HALKit/AXP/VM.s5
9 files changed, 68 insertions, 0 deletions
diff --git a/Kernel/HALKit/AXP/CR.s b/Kernel/HALKit/AXP/CR.s
new file mode 100644
index 00000000..4d68257d
--- /dev/null
+++ b/Kernel/HALKit/AXP/CR.s
@@ -0,0 +1,11 @@
+.globl read_lr1
+.globl read_lr0
+
+.section .text
+ read_lr0:
+ movq %r30, %cr3
+ ret
+
+ hal_read_cr0:
+ movq %r30, %cr0
+ ret \ No newline at end of file
diff --git a/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp b/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/Kernel/HALKit/AXP/CoreInterruptHandlerDEC.cpp
diff --git a/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp b/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp
new file mode 100644
index 00000000..c6ef29fc
--- /dev/null
+++ b/Kernel/HALKit/AXP/CoreSyscallHandlerDEC.cpp
@@ -0,0 +1,20 @@
+/* -------------------------------------------
+
+ Copyright SoftwareLabs
+
+------------------------------------------- */
+
+#include <ArchKit/ArchKit.hpp>
+#include <HALKit/Alpha/Processor.hpp>
+
+NewOS::Array<void (*)(NewOS::Int32 id, NewOS::HAL::StackFrame*),
+ kKernelMaxSystemCalls>
+ kSyscalls;
+
+extern "C" void rt_syscall_handle(NewOS::HAL::StackFrame* stack)
+{
+ for (NewOS::SizeT index = 0UL; index < kKernelMaxSystemCalls; ++index)
+ {
+ (kSyscalls[index].Leak().Leak())(stack->ID, stack);
+ }
+}
diff --git a/Kernel/HALKit/AXP/HAL.s b/Kernel/HALKit/AXP/HAL.s
new file mode 100644
index 00000000..0178527f
--- /dev/null
+++ b/Kernel/HALKit/AXP/HAL.s
@@ -0,0 +1,13 @@
+.globl rt_wait_400ns
+
+.section .text
+rt_wait_400ns:
+ jmp .L
+.L:
+ jmp .L2
+ wtint ;; wait for interrupt
+.L2:
+
+ ret
+
+
diff --git a/Kernel/HALKit/AXP/Processor.hpp b/Kernel/HALKit/AXP/Processor.hpp
new file mode 100644
index 00000000..38277317
--- /dev/null
+++ b/Kernel/HALKit/AXP/Processor.hpp
@@ -0,0 +1,7 @@
+/* -------------------------------------------
+
+ Copyright SoftwareLabs
+
+------------------------------------------- */
+
+#pragma once \ No newline at end of file
diff --git a/Kernel/HALKit/AXP/README b/Kernel/HALKit/AXP/README
new file mode 100644
index 00000000..91e7b134
--- /dev/null
+++ b/Kernel/HALKit/AXP/README
@@ -0,0 +1 @@
+This is for DEC Alpha.
diff --git a/Kernel/HALKit/AXP/README.TXT b/Kernel/HALKit/AXP/README.TXT
new file mode 100644
index 00000000..03c2b816
--- /dev/null
+++ b/Kernel/HALKit/AXP/README.TXT
@@ -0,0 +1 @@
+A Toy HAL to test the Kernel portability.
diff --git a/Kernel/HALKit/AXP/SYSCALL.s b/Kernel/HALKit/AXP/SYSCALL.s
new file mode 100644
index 00000000..19cab808
--- /dev/null
+++ b/Kernel/HALKit/AXP/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/Kernel/HALKit/AXP/VM.s b/Kernel/HALKit/AXP/VM.s
new file mode 100644
index 00000000..7024086b
--- /dev/null
+++ b/Kernel/HALKit/AXP/VM.s
@@ -0,0 +1,5 @@
+.global hal_flush_tlb
+
+.section .text
+hal_flush_tlb:
+ swppal \ No newline at end of file