]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/syscall_shim: Make `UK_LIBC_SYSCALLS` visible in asm files
authorSergiu Moga <sergiu@unikraft.io>
Fri, 28 Mar 2025 10:43:46 +0000 (12:43 +0200)
committerUnikraft Bot <monkey@unikraft.io>
Thu, 17 Apr 2025 12:33:46 +0000 (12:33 +0000)
Define `UK_LIBC_SYSCALLS` outside the `!__ASSEMBLY__` guard so that
assembly files can see it.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1618

lib/syscall_shim/include/uk/syscall.h

index 81b9b5cde2fe11b502217859bb41e72140ca2e4d..178daf2299095a84defc80daac9ea5a5c6672c77 100644 (file)
 #include <uk/arch/ctx.h>
 #include <arch/syscall_prologue.h>
 
+/*
+ * 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 <uk/config.h>
 #include <uk/essentials.h>
@@ -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;