Differences From
Artifact [b77089e7ab]:
6 6 * OS specified! */
7 7
8 8 #ifndef KIplatform_posix
9 9 #define KIplatform_posix
10 10 #include <k/def.h>
11 11 #include <k/type.h>
12 12
13 +#if (!defined(KFplatform_define_constants)) && \
14 + (!defined(KFplatform_define_types)) && \
15 + (!defined(KFplatform_define_funcs))
16 +#define KFplatform_define_constants
17 +#define KFplatform_define_types
18 +#define KFplatform_define_funcs
19 +#endif
20 +
21 +#ifdef KFplatform_define_constants
22 +
13 23 enum posix_prot {
14 24 posix_prot_none = 0,
15 25 posix_prot_read = 1 << 0,
16 26 posix_prot_write = 1 << 1,
17 27 posix_prot_exec = 1 << 2
18 28 };
19 29
................................................................................
30 40 posix_flag_anonymous = 0x1000,
31 41 #endif
32 42
33 43 /* platform flags */
34 44 posix_flag_linux_hugetlb = 0x40000
35 45 };
36 46
47 +#endif
48 +#ifdef KFplatform_define_types
49 +
37 50 /* platform types */
38 51
39 52 typedef s64 k_platform_syscall_return;
40 53 typedef u64 k_platform_syscall_error;
41 54
42 55 #if KVos == KA_os_lin
43 56 typedef long k_platform_syscall_arg;
................................................................................
52 65 #endif
53 66
54 67 struct k_platform_syscall_answer {
55 68 k_platform_syscall_return ret;
56 69 k_platform_syscall_error error;
57 70 };
58 71
59 -#include <system_calls.h>
72 +#endif
73 +
74 +#if defined(KFplatform_define_constants) ||\
75 + defined(KFplatform_define_funcs)
76 +# include <system_calls.h>
77 +#endif
78 +
79 +#ifdef KFplatform_define_funcs
60 80
61 81 extern struct k_platform_syscall_answer
62 82 k_platform_syscall(enum k_platform_syscall call, u8 valency,
63 83 k_platform_syscall_arg args[]);
84 +
85 +#endif
64 86
65 87 #endif