diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/apos/syscalls.h | 4 | ||||
| -rw-r--r-- | include/apos/uapi.h | 3 | ||||
| -rw-r--r-- | include/apos/utils.h | 70 |
3 files changed, 42 insertions, 35 deletions
diff --git a/include/apos/syscalls.h b/include/apos/syscalls.h index ed18872..6f9e312 100644 --- a/include/apos/syscalls.h +++ b/include/apos/syscalls.h @@ -4,6 +4,10 @@ /* enum for now, possibly macros in the future once I get an approximate idea of * which syscalls are necessary etc. */ enum { + /* noop, for testing out how many syscalls per second can done I suppose + * */ + SYS_NOOP, + /* memory management */ SYS_REQ_MEM, /* request memory from anywhere */ SYS_REQ_PMEM, /* request physical address */ diff --git a/include/apos/uapi.h b/include/apos/uapi.h index fa66b31..a6fc2b7 100644 --- a/include/apos/uapi.h +++ b/include/apos/uapi.h @@ -60,6 +60,9 @@ typedef vm_t (*sys_t)(vm_t, vm_t, vm_t, vm_t); } \ static vm_t __##name +/* noop */ +SYSCALL_DECLARE(noop); + /* memory */ SYSCALL_DECLARE(req_mem); SYSCALL_DECLARE(req_pmem); diff --git a/include/apos/utils.h b/include/apos/utils.h index d7dd8b9..e09a35f 100644 --- a/include/apos/utils.h +++ b/include/apos/utils.h @@ -51,21 +51,21 @@ /* clang-format doesn't like _Generic, but I guess that's fine. */ #define align_up(x, y) \ - _Generic((x), signed char \ - : align_up_c, signed short \ - : align_up_s, signed int \ - : align_up_i, signed long \ - : align_up_l, signed long long \ - : align_up_ll,\ + _Generic((x), signed char \ + : align_up_c, signed short \ + : align_up_s, signed int \ + : align_up_i, signed long \ + : align_up_l, signed long long \ + : align_up_ll, \ \ - unsigned char \ - : align_up_uc, unsigned short \ - : align_up_us, unsigned int \ - : align_up_ui, unsigned long \ - : align_up_ul, unsigned long long\ + unsigned char \ + : align_up_uc, unsigned short \ + : align_up_us, unsigned int \ + : align_up_ui, unsigned long \ + : align_up_ul, unsigned long long \ : align_up_ull)((x), (y)) -#define DEFINE_ALIGN_UP(name, type) \ +#define DEFINE_ALIGN_UP(name, type) \ static inline type align_up_##name(type val, type a) \ { \ if (!a) \ @@ -92,21 +92,21 @@ DEFINE_ALIGN_UP(ul, unsigned long); DEFINE_ALIGN_UP(ull, unsigned long long); #define align_down(x, y) \ - _Generic((x), signed char \ + _Generic((x), signed char \ : align_down_c, signed short \ - : align_down_s, signed int \ - : align_down_i, signed long \ - : align_down_l, signed long long \ - : align_down_ll,\ + : align_down_s, signed int \ + : align_down_i, signed long \ + : align_down_l, signed long long \ + : align_down_ll, \ \ - unsigned char \ - : align_down_uc, unsigned short \ - : align_down_us, unsigned int \ - : align_down_ui, unsigned long \ - : align_down_ul, unsigned long long\ - : align_down_ull)((x), (y)) + unsigned char \ + : align_down_uc, unsigned short \ + : align_down_us, unsigned int \ + : align_down_ui, unsigned long \ + : align_down_ul, unsigned long long \ + : align_down_ull)((x), (y)) -#define DEFINE_ALIGN_DOWN(name, type) \ +#define DEFINE_ALIGN_DOWN(name, type) \ static inline type align_down_##name(type val, type a) \ { \ if (!a) \ @@ -128,21 +128,21 @@ DEFINE_ALIGN_DOWN(ul, unsigned long); DEFINE_ALIGN_DOWN(ull, unsigned long long); #define is_aligned(x, y) \ - _Generic((x), signed char \ + _Generic((x), signed char \ : is_aligned_c, signed short \ - : is_aligned_s, signed int \ - : is_aligned_i, signed long \ - : is_aligned_l, signed long long \ - : is_aligned_ll,\ + : is_aligned_s, signed int \ + : is_aligned_i, signed long \ + : is_aligned_l, signed long long \ + : is_aligned_ll, \ \ - unsigned char \ - : is_aligned_uc, unsigned short \ - : is_aligned_us, unsigned int \ - : is_aligned_ui, unsigned long \ - : is_aligned_ul, unsigned long long \ + unsigned char \ + : is_aligned_uc, unsigned short \ + : is_aligned_us, unsigned int \ + : is_aligned_ui, unsigned long \ + : is_aligned_ul, unsigned long long \ : is_aligned_ll)((x), (y)) -#define DEFINE_ALIGNED(name, type) \ +#define DEFINE_ALIGNED(name, type) \ static inline bool is_aligned_##name(type val, type a) \ { \ if (!a) \ |
