2022-10-02 15:02:15 +00:00
|
|
|
#ifndef _LUNA_SYSCALL_H
|
|
|
|
#define _LUNA_SYSCALL_H
|
2022-10-01 18:59:22 +00:00
|
|
|
|
2022-10-27 15:42:00 +00:00
|
|
|
#include <bits/error.h>
|
|
|
|
|
|
|
|
typedef unsigned long sysarg_t;
|
|
|
|
|
2022-10-01 18:59:22 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2022-10-19 15:49:55 +00:00
|
|
|
long __luna_syscall0(long sys_num);
|
2022-10-27 15:42:00 +00:00
|
|
|
long __luna_syscall1(long sys_num, sysarg_t arg0);
|
|
|
|
long __luna_syscall2(long sys_num, sysarg_t arg0, sysarg_t arg1);
|
|
|
|
long __luna_syscall3(long sys_num, sysarg_t arg0, sysarg_t arg1, sysarg_t arg2);
|
|
|
|
long __luna_syscall4(long sys_num, sysarg_t arg0, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3);
|
|
|
|
long __luna_syscall5(long sys_num, sysarg_t arg0, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4);
|
|
|
|
|
|
|
|
inline long __fast_syscall0(long number)
|
|
|
|
{
|
|
|
|
long result = __luna_syscall0(number);
|
|
|
|
_RETURN_WITH_ERRNO(result, long);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline long __fast_syscall1(long number, sysarg_t arg0)
|
|
|
|
{
|
|
|
|
long result = __luna_syscall1(number, arg0);
|
|
|
|
_RETURN_WITH_ERRNO(result, long);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline long __fast_syscall2(long number, sysarg_t arg0, sysarg_t arg1)
|
|
|
|
{
|
|
|
|
long result = __luna_syscall2(number, arg0, arg1);
|
|
|
|
_RETURN_WITH_ERRNO(result, long);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline long __fast_syscall3(long number, sysarg_t arg0, sysarg_t arg1, sysarg_t arg2)
|
|
|
|
{
|
|
|
|
long result = __luna_syscall3(number, arg0, arg1, arg2);
|
|
|
|
_RETURN_WITH_ERRNO(result, long);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline long __fast_syscall4(long number, sysarg_t arg0, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3)
|
|
|
|
{
|
|
|
|
long result = __luna_syscall4(number, arg0, arg1, arg2, arg3);
|
|
|
|
_RETURN_WITH_ERRNO(result, long);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline long __fast_syscall5(long number, sysarg_t arg0, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
|
|
|
|
{
|
|
|
|
long result = __luna_syscall5(number, arg0, arg1, arg2, arg3, arg4);
|
|
|
|
_RETURN_WITH_ERRNO(result, long);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define __lc_fast_syscall0(number) __fast_syscall0(number)
|
|
|
|
#define __lc_fast_syscall1(number, arg0) __fast_syscall1(number, (sysarg_t)arg0)
|
|
|
|
#define __lc_fast_syscall2(number, arg0, arg1) __fast_syscall2(number, (sysarg_t)arg0, (sysarg_t)arg1)
|
|
|
|
#define __lc_fast_syscall3(number, arg0, arg1, arg2) \
|
|
|
|
__fast_syscall3(number, (sysarg_t)arg0, (sysarg_t)arg1, (sysarg_t)arg2)
|
|
|
|
#define __lc_fast_syscall4(number, arg0, arg1, arg2, arg3) \
|
|
|
|
__fast_syscall4(number, (sysarg_t)arg0, (sysarg_t)arg1, (sysarg_t)arg2, (sysarg_t)arg3)
|
|
|
|
#define __lc_fast_syscall5(number, arg0, arg1, arg2, arg3, arg4) \
|
|
|
|
__fast_syscall5(number, (sysarg_t)arg0, (sysarg_t)arg1, (sysarg_t)arg2, (sysarg_t)arg3, (sysarg_t)arg4)
|
2022-10-01 18:59:22 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2022-10-19 15:49:55 +00:00
|
|
|
|
2022-10-01 18:59:22 +00:00
|
|
|
#endif
|