@@ -4,8 +4,10 @@ * ones and os-dependent ones. note that * the values may change depending on the * OS specified! */ +#ifndef KIplatform_posix +#define KIplatform_posix #include #include enum posix_prot { @@ -31,7 +33,33 @@ /* platform flags */ posix_flag_linux_hugetlb = 0x40000 }; -struct kposix_syscall_result { long ret, error; } +/* platform types */ + +typedef s64 k_platform_syscall_return; +typedef u64 k_platform_syscall_error; + +#if KVos == KA_os_lin + typedef long k_platform_syscall_arg; +#elif KVos == KA_os_fbsd + typedef u64 k_platform_syscall_arg; +#else + /* we're going to just pick a sane + * fallback that's reasonably likely + * to work with most systems one way + * or another */ + typedef unsigned long long k_platform_syscall_arg; +#endif + +struct k_platform_syscall_answer { + k_platform_syscall_return ret; + k_platform_syscall_error error; +}; + +#include + +extern struct k_platform_syscall_answer +k_platform_syscall(enum k_platform_syscall call, u8 valency, + k_platform_syscall_arg args[]); -kposix_syscall(enum kposix_syscall syscall, sz argct, long args[]); +#endif