diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-03 18:20:35 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-07-03 18:20:35 +0200 |
| commit | a7c741c93cb0a53aea686eb2f342f2464bc12c14 (patch) | |
| tree | 5e90743873451c7f1bc6313d2fb210c470af2cd1 /DDK/KernelCall.c | |
| parent | 8c8822fff78f9ff9cd640271da9b3634c4c2f97f (diff) | |
COMMIT-07-03-2024-MHR-36
IMP: DDK specification and implementation done.
- Kernel calls I/O support for DDK.
- System calls I/O support for DDK.
- Add Allocation routines for DDK.
- Add Helloconf driver.
- One generic device.
IMPRV:
- GPU driver is now C++ based.
- Fixed icon path inside makefiles.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'DDK/KernelCall.c')
| -rw-r--r-- | DDK/KernelCall.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/DDK/KernelCall.c b/DDK/KernelCall.c index 7dc5761c..88343abd 100644 --- a/DDK/KernelCall.c +++ b/DDK/KernelCall.c @@ -12,15 +12,25 @@ /// @brief this is an internal call, do not use it. DK_EXTERN __attribute__((naked)) void* __kernelDispatchCall(const char* name, int32_t cnt, void* data, size_t sz); -/// @brief Execute a function on the kernel. -/// @param kernelRpcName the name of the function. -/// @param cnt number of arguments. -/// @param -/// @return +/// @brief Call kernel (interrupt 0x33) +/// @param kernelRpcName +/// @param cnt number of elements in **dat** +/// @param dat data ptr +/// @param sz sz of whole data ptr. +/// @return result of call DK_EXTERN void* kernelCall(const char* kernelRpcName, int32_t cnt, void* data, size_t sz) { if (!kernelRpcName || cnt == 0) - return NIL; + return nil; return __kernelDispatchCall(kernelRpcName, cnt, data, sz); } + + +/// @brief add system call. +/// @param slot system call slot +/// @param slotFn, syscall slot. +DK_EXTERN void kernelAddSyscall(const int slot, void(*slotFn)(void* a0)) +{ + kernelCall("AddSyscall", slot, slotFn, 0); +}
\ No newline at end of file |
