diff --git a/syscall/syscall.csv b/syscall/syscall.csv index c50b90c2c8b..c8b6807faf8 100644 --- a/syscall/syscall.csv +++ b/syscall/syscall.csv @@ -1,4 +1,4 @@ -"_exit","unistd.h","","void","int" +"_exit","unistd.h","","noreturn","int" "accept","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *" "adjtime","sys/time.h","defined(CONFIG_CLOCK_TIMEKEEPING)","int","FAR const struct timeval *","FAR struct timeval *" "aio_cancel","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb *" @@ -23,7 +23,7 @@ "eventfd","sys/eventfd.h","defined(CONFIG_EVENT_FD)","int","unsigned int","int" "exec","nuttx/binfmt/binfmt.h","!defined(CONFIG_BINFMT_DISABLE) && !defined(CONFIG_BUILD_KERNEL)","int","FAR const char *","FAR char * const *","FAR const struct symtab_s *","int" "execv","unistd.h","!defined(CONFIG_BINFMT_DISABLE) && defined(CONFIG_LIBC_EXECFUNCS)","int","FAR const char *","FAR char * const []|FAR char * const *" -"exit","stdlib.h","","void","int" +"exit","stdlib.h","","noreturn","int" "fcntl","fcntl.h","","int","int","int","...","int" "fs_fdopen","nuttx/fs/fs.h","defined(CONFIG_FILE_STREAM)","int","int","int","FAR struct tcb_s *","FAR struct file_struct **" "fstat","sys/stat.h","","int","int","FAR struct stat *" @@ -90,7 +90,7 @@ "pthread_cond_wait","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_cond_t *","FAR pthread_mutex_t *" "pthread_create","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","FAR pthread_t *","FAR const pthread_attr_t *","pthread_startroutine_t","pthread_addr_t" "pthread_detach","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t" -"pthread_exit","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","void","pthread_addr_t" +"pthread_exit","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","noreturn","pthread_addr_t" "pthread_getaffinity_np","pthread.h","!defined(CONFIG_DISABLE_PTHREAD) && defined(CONFIG_SMP)","int","pthread_t","size_t","FAR cpu_set_t*" "pthread_getschedparam","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","FAR int *","FAR struct sched_param *" "pthread_join","pthread.h","!defined(CONFIG_DISABLE_PTHREAD)","int","pthread_t","FAR pthread_addr_t *" diff --git a/tools/mksyscall.c b/tools/mksyscall.c index 8d81249018c..02e65f6bb63 100644 --- a/tools/mksyscall.c +++ b/tools/mksyscall.c @@ -224,7 +224,16 @@ static void generate_proxy(int nfixed, int nparms) * prototype */ - fprintf(stream, "%s %s(", g_parm[RETTYPE_INDEX], g_parm[NAME_INDEX]); + if (strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0) + { + fprintf(stream, "void "); + } + else + { + fprintf(stream, "%s ", g_parm[RETTYPE_INDEX]); + } + + fprintf(stream, "%s(", g_parm[NAME_INDEX]); /* Generate the formal parameter list */ @@ -301,7 +310,8 @@ static void generate_proxy(int nfixed, int nparms) * are special cases. */ - if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0) + if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0 || + strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0) { fprintf(stream, " (void)sys_call%d(", nparms); } @@ -339,7 +349,14 @@ static void generate_proxy(int nfixed, int nparms) /* Handle the tail end of the function. */ - fprintf(stream, ");\n}\n"); + fprintf(stream, ");\n"); + if (strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0) + { + fprintf(stream, " while(1);\n"); + } + + fprintf(stream, "}\n"); + if (g_parm[COND_INDEX][0] != '\0') { fprintf(stream, "\n#endif /* %s */\n", g_parm[COND_INDEX]); @@ -448,7 +465,8 @@ static void generate_stub(int nfixed, int nparms) * a special case. */ - if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0) + if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0 || + strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0) { fprintf(stream, " %s(", g_parm[NAME_INDEX]); }