libk  Diff

Differences From Artifact [7d3483dee1]:

To Artifact [b77089e7ab]:


     1      1   /* arch/posix.h - posix constants
     2      2    *  ? this file defines posix magic numbers
     3      3    *    needed in syscalls, both cross-platform
     4      4    *    ones and os-dependent ones. note that
     5      5    *    the values may change depending on the
     6      6    *    OS specified! */
     7      7   
            8  +#ifndef KIplatform_posix
            9  +#define KIplatform_posix
     8     10   #include <k/def.h>
     9     11   #include <k/type.h>
    10     12   
    11     13   enum posix_prot {
    12     14   	posix_prot_none  = 0,
    13     15   	posix_prot_read  = 1 << 0,
    14     16   	posix_prot_write = 1 << 1,
................................................................................
    28     30   	posix_flag_anonymous = 0x1000,
    29     31   #endif
    30     32   
    31     33   	/* platform flags */
    32     34   	posix_flag_linux_hugetlb = 0x40000
    33     35   };
    34     36   
    35         -struct kposix_syscall_result { long ret, error; }
           37  +/* platform types */
           38  +
           39  +typedef s64 k_platform_syscall_return;
           40  +typedef u64 k_platform_syscall_error;
           41  +
           42  +#if KVos == KA_os_lin
           43  +	typedef long k_platform_syscall_arg;
           44  +#elif KVos == KA_os_fbsd
           45  +	typedef u64  k_platform_syscall_arg;
           46  +#else
           47  +	/* we're going to just pick a sane
           48  +	 * fallback that's reasonably likely
           49  +	 * to work with most systems one way
           50  +	 * or another */
           51  +	typedef unsigned long long k_platform_syscall_arg;
           52  +#endif
           53  +
           54  +struct k_platform_syscall_answer {
           55  +	k_platform_syscall_return ret;
           56  +	k_platform_syscall_error error;
           57  +};
           58  +
           59  +#include <system_calls.h>
           60  +
           61  +extern struct k_platform_syscall_answer
           62  +k_platform_syscall(enum k_platform_syscall call, u8 valency, 
           63  +		k_platform_syscall_arg args[]);
    36     64   
    37         -kposix_syscall(enum kposix_syscall syscall, sz argct, long args[]);
           65  +#endif