summaryrefslogtreecommitdiffhomepage
path: root/dev/libDDK/src/ddk_kernel_call_dispatch.S
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-25 10:28:07 +0200
committerGitHub <noreply@github.com>2025-08-25 10:28:07 +0200
commit1057fd299e17fcc04f6b3a1aa3ace1026f8652a0 (patch)
treea663c7dcd26779295ce0d9681418964f802f2d14 /dev/libDDK/src/ddk_kernel_call_dispatch.S
parent1a32b9307357ac0fc9095e853b2b6d94f9fe62bb (diff)
parent328b34360ab8b2462ea5858441693277b3d23f08 (diff)
Merge pull request #56 from nekernel-org/dev
Errata: v0.0.4
Diffstat (limited to 'dev/libDDK/src/ddk_kernel_call_dispatch.S')
-rw-r--r--dev/libDDK/src/ddk_kernel_call_dispatch.S42
1 files changed, 42 insertions, 0 deletions
diff --git a/dev/libDDK/src/ddk_kernel_call_dispatch.S b/dev/libDDK/src/ddk_kernel_call_dispatch.S
new file mode 100644
index 00000000..05ee8209
--- /dev/null
+++ b/dev/libDDK/src/ddk_kernel_call_dispatch.S
@@ -0,0 +1,42 @@
+/**
+ lang: asm
+ compiler: gnu
+ */
+
+.globl __ke_call_dispatch
+
+.text
+
+/* Really simple function, takes our va-list,
+ and brings it to the trap handler in the Kernel. */
+
+#if defined(__DDK_AMD64__)
+
+/* args rcx, rdx, r8, r9 */
+__ke_call_dispatch:
+ pushq rbp
+ movq rbp, rsp
+
+ syscall
+
+ popq rbp
+
+ ret
+
+#elif defined(__DDK_POWER64__)
+
+/* args r8, r9, r10, r11 */
+__ke_call_dispatch:
+ /* There is no specific interrupt request id for a system call in POWER. */
+ sc
+ blr
+
+#elif defined(__DDK_ARM64__)
+
+/* args x0, x8, x9, x10, x11 is kept to tell that this is a Kernel call */
+__ke_call_dispatch:
+ /* There is no specific interrupt request id for a system call in ARM64 as well. */
+ mov x9, #0x33
+ svc #0
+
+#endif