#include #include #include #include #include #include #include static const syscall_fn_t dispatch_table[] = { #undef __ZINNIA_UAPI_SYSCALL_NUMBERS_H // We want to include the header again #define __SYSCALL_DEFINE(idx, name) [idx] = syscall_##name, #include #undef __SYSCALL_DEFINE }; void syscall_dispatch(struct arch_context* ctx) { const size_t num = ctx->ARCH_CTX_NUM; if (num >= ARRAY_SIZE(dispatch_table)) { ctx->ARCH_CTX_RET0 = ENOSYS; return; } dispatch_table[num](ctx); }