My Kernel v0.1.0
syscalls.h
Go to the documentation of this file.
1
19#ifndef KERNEL_SYSCALLS_H
20#define KERNEL_SYSCALLS_H
21
22#if ARCH == I686
23#include <kernel/arch/i686/syscalls.h>
24#endif
25
26#include <kernel/types.h>
27
28#include <utils/macro.h>
29
30#include <stddef.h>
31#include <sys/stat.h>
32
33typedef struct syscall_args {
34 u32 nr;
35 u32 arg1, arg2, arg3, arg4, arg5, arg6;
36} syscall_args_t;
37
38#define SYSCALL_NUMBER(name, vector, ...) CONCAT(SYS_, name) = vector,
39#define SYSCALL_FUNCTION(name, vector, argc, type, ret_type, ...) \
40 ret_type CONCAT(sys_, name)(__VA_ARGS__);
41
51enum syscal_nr {
52 DEFINE_SYSCALLS(SYSCALL_NUMBER)
53 SYSCALL_COUNT
54};
55
56/* SYSCALLS HANDLER */
57
58DEFINE_SYSCALLS(SYSCALL_FUNCTION)
59
60#endif /* KERNEL_SYSCALLS_H */