summaryrefslogtreecommitdiffhomepage
path: root/DDK/KernelCall.c
blob: 26a0b83bb0d98139d84e2d1fb829ded68d1360d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
}