diff options
| author | Amlal <amlalelmahrouss@icloud.com> | 2024-06-06 10:27:55 +0000 |
|---|---|---|
| committer | Amlal <amlalelmahrouss@icloud.com> | 2024-06-06 10:27:55 +0000 |
| commit | 4e75e05a20ddd0dbca982e8f3bc2ea8043ed3a3f (patch) | |
| tree | 95409c0e32b644578b94a5c230417da684d79dc9 /DDK/KernelCall.c | |
| parent | f5081a8f9a8537ad5be5d639955cd1d0e68a9e1d (diff) | |
| parent | 9994b8f3f88131f41be1061fb0947177e66dc7b0 (diff) | |
Merged in MHR-23 (pull request #14)
Draft: MHR-23
Diffstat (limited to 'DDK/KernelCall.c')
| -rw-r--r-- | DDK/KernelCall.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/DDK/KernelCall.c b/DDK/KernelCall.c new file mode 100644 index 00000000..26a0b83b --- /dev/null +++ b/DDK/KernelCall.c @@ -0,0 +1,30 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs + + Purpose: Kernel Definitions. + +------------------------------------------- */ + +#include <DDK/KernelStd.h> +#include <stdarg.h> + +DK_EXTERN __attribute__((naked)) void __kernelDispatchCall(int32_t cnt, ...); + +/// @brief Execute a function on the kernel. +/// @param kernelRpcName the name of the function. +/// @param cnt number of arguments. +/// @param +/// @return +DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, ...) +{ + if (!kernelRpcName || cnt == 0) + return NIL; + + va_list arg; + va_start(arg, cnt); + + __kernelDispatchCall(cnt, arg); + + va_end(arg); +} |
