From: Sergiu Moga Date: Fri, 28 Mar 2025 10:43:46 +0000 (+0200) Subject: lib/syscall_shim: Make `UK_LIBC_SYSCALLS` visible in asm files X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=95a963bdd0eded913205597a8815629f5a34d6f4;p=unikraft%2Funikraft.git lib/syscall_shim: Make `UK_LIBC_SYSCALLS` visible in asm files Define `UK_LIBC_SYSCALLS` outside the `!__ASSEMBLY__` guard so that assembly files can see it. Signed-off-by: Sergiu Moga Approved-by: Michalis Pappas Reviewed-by: Michalis Pappas Reviewed-by: Andrei Tatar GitHub-Closes: #1618 --- diff --git a/lib/syscall_shim/include/uk/syscall.h b/lib/syscall_shim/include/uk/syscall.h index 81b9b5cde..178daf229 100644 --- a/lib/syscall_shim/include/uk/syscall.h +++ b/lib/syscall_shim/include/uk/syscall.h @@ -38,6 +38,20 @@ #include #include +/* + * Whenever the hidden Config.uk option LIBSYSCALL_SHIM_NOWRAPPER + * is set, the creation of libc-style wrappers are disable by the + * UK_SYSCALL_DEFINE() and UK_SYSCALL_R_DEFINE() macros. Alternatively, + * UK_LIBC_SYSCALLS can be set to 0 through compilation flags. + */ +#ifndef UK_LIBC_SYSCALLS +#if CONFIG_LIBSYSCALL_SHIM && CONFIG_LIBSYSCALL_SHIM_NOWRAPPER +#define UK_LIBC_SYSCALLS (0) +#else +#define UK_LIBC_SYSCALLS (1) +#endif /* CONFIG_LIBSYSCALL_SHIM && CONFIG_LIBSYSCALL_SHIM_NOWRAPPER */ +#endif /* UK_LIBC_SYSCALLS */ + #if !__ASSEMBLY__ #include #include @@ -95,20 +109,6 @@ void _uk_syscall_wrapper_do_exittab(struct ukarch_execenv *execenv __unused) { } #endif /* !CONFIG_LIBSYSCALL_SHIM */ -/* - * Whenever the hidden Config.uk option LIBSYSCALL_SHIM_NOWRAPPER - * is set, the creation of libc-style wrappers are disable by the - * UK_SYSCALL_DEFINE() and UK_SYSCALL_R_DEFINE() macros. Alternatively, - * UK_LIBC_SYSCALLS can be set to 0 through compilation flags. - */ -#ifndef UK_LIBC_SYSCALLS -#if CONFIG_LIBSYSCALL_SHIM && CONFIG_LIBSYSCALL_SHIM_NOWRAPPER -#define UK_LIBC_SYSCALLS (0) -#else -#define UK_LIBC_SYSCALLS (1) -#endif /* CONFIG_LIBSYSCALL_SHIM && CONFIG_LIBSYSCALL_SHIM_NOWRAPPER */ -#endif /* UK_LIBC_SYSCALLS */ - #define __uk_scc(X) ((long) (X)) typedef long uk_syscall_arg_t;