diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-25 09:50:27 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-25 09:50:27 +0200 |
| commit | a7939c9a20d5f4b83d5df34aa652a88a0764042c (patch) | |
| tree | d773fa076011ac6a54c1de93755797b09e7bd3ca /dev/libDDK/src/ddk_kernel_call_dispatch.S | |
| parent | d864e0c6281024ce4b9bd654aa83308a50f583d8 (diff) | |
feat! ddk -> libDDK, use syscall on AMD64.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/libDDK/src/ddk_kernel_call_dispatch.S')
| -rw-r--r-- | dev/libDDK/src/ddk_kernel_call_dispatch.S | 42 |
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..dfe2d929 --- /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 |
