From da70596895d8135e08f8caac6978117697b4c021 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 18 Aug 2024 21:39:29 +0200 Subject: [REFACTOR] Improved project structure. Signed-off-by: Amlal El Mahrouss --- dev/DDK/DispatchKernelCall.S | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 dev/DDK/DispatchKernelCall.S (limited to 'dev/DDK/DispatchKernelCall.S') diff --git a/dev/DDK/DispatchKernelCall.S b/dev/DDK/DispatchKernelCall.S new file mode 100644 index 00000000..b6ce8004 --- /dev/null +++ b/dev/DDK/DispatchKernelCall.S @@ -0,0 +1,36 @@ +/** + lang: asm + compiler: gnu + */ + +.globl __kernelCallDispatch + +.text + +/* Really simple function, takes our va-list, + and brings it to the trap handler in the kernel. */ + +#ifdef __DDK_AMD64__ + +/* args rcx, rdx, r8, r9 */ +__kernelCallDispatch: + int $0x33 + ret + +#elif defined(__DDK_POWER64__) + +/* args r8, r9, r10, r11 */ +__kernelCallDispatch: + /* 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 */ +__kernelCallDispatch: + /* There is no specific interrupt request id for a system call in ARM64 as well. */ + mov x11, #0x33 + svc #0 + +#endif -- cgit v1.2.3