From a86684574ff8ae7a3f1b2c7dabdacb5eb82ee835 Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Fri, 30 Dec 2022 12:47:50 +0800 Subject: [PATCH] syscall: export UP_WRAPSYM/UP_REALSYM macro Signed-off-by: yinshengkai --- include/syscall.h | 12 ++++++++++++ tools/mksyscall.c | 8 +------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/syscall.h b/include/syscall.h index 545a1c39bc..5ffc0f4283 100644 --- a/include/syscall.h +++ b/include/syscall.h @@ -33,6 +33,18 @@ * Pre-processor Definitions ****************************************************************************/ +#ifdef CONFIG_LIB_SYSCALL +# ifndef UP_WRAPSYM +# define UP_WRAPSYM(s) __wrap_##s +# endif +# ifndef UP_REALSYM +# define UP_REALSYM(s) __real_##s +# endif +#else +# define UP_WRAPSYM(s) s +# define UP_REALSYM(s) s +#endif + /**************************************************************************** * Public Type Definitions ****************************************************************************/ diff --git a/tools/mksyscall.c b/tools/mksyscall.c index a03c8080ef..b9ebac8d29 100644 --- a/tools/mksyscall.c +++ b/tools/mksyscall.c @@ -595,13 +595,7 @@ static void generate_wrapper(int nfixed, int nparms) /* Define macros to get wrapper symbol */ - fprintf(stream, "#include \n"); - fprintf(stream, "#ifndef UP_WRAPSYM\n"); - fprintf(stream, "#define UP_WRAPSYM(s) __wrap_##s\n"); - fprintf(stream, "#endif\n"); - fprintf(stream, "#ifndef UP_REALSYM\n"); - fprintf(stream, "#define UP_REALSYM(s) __real_##s\n"); - fprintf(stream, "#endif\n\n"); + fprintf(stream, "#include \n\n"); if (g_parm[COND_INDEX][0] != '\0') {