From 2dd9ce50c8ef44487598f8bec98cc6597c472333 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 11 Jul 2014 11:58:46 -0600 Subject: [PATCH] Clean-up up some warning --- binfmt/binfmt_exec.c | 17 +++++++++++------ binfmt/binfmt_schedunload.c | 1 + configs/sama5d4-ek/nxwm/defconfig | 7 ++++++- include/nuttx/binfmt/binfmt.h | 12 ++++++++---- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index 446df6373b..71f8c9a854 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -1,7 +1,7 @@ /**************************************************************************** * binfmt/binfmt_exec.c * - * Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -75,9 +75,13 @@ * * Description: * This is a convenience function that wraps load_ and exec_module into - * one call. If CONFIG_SCHED_ONEXIT is also defined, this function will - * automatically call schedule_unload() to unload the module when task - * exits. + * one call. If CONFIG_SCHED_ONEXIT and CONFIG_SCHED_HAVE_PARENT are + * also defined, this function will automatically call schedule_unload() + * to unload the module when task exits. + * + * NOTE: This function is flawed and useless without CONFIG_SCHED_ONEXIT + * and CONFIG_SCHED_HAVE_PARENT because there is then no mechanism to + * unload the module once it exits. * * Input Parameter: * filename - Full path to the binary to be loaded @@ -95,7 +99,7 @@ int exec(FAR const char *filename, FAR char * const *argv, FAR const struct symtab_s *exports, int nexports) { -#ifdef CONFIG_SCHED_ONEXIT +#if defined(CONFIG_SCHED_ONEXIT) && defined(CONFIG_SCHED_HAVE_PARENT) FAR struct binary_s *bin; int pid; int ret; @@ -189,4 +193,5 @@ int exec(FAR const char *filename, FAR char * const *argv, #endif } -#endif /* CONFIG_BINFMT_DISABLE */ +#endif /* !CONFIG_BINFMT_DISABLE */ + diff --git a/binfmt/binfmt_schedunload.c b/binfmt/binfmt_schedunload.c index 15f8e3f7c9..a3f6f9cc1f 100644 --- a/binfmt/binfmt_schedunload.c +++ b/binfmt/binfmt_schedunload.c @@ -319,6 +319,7 @@ int schedule_unload(pid_t pid, FAR struct binary_s *bin) blldbg("ERROR: Failed to remove structure\n"); } + irqrestore(flags); goto errout; } diff --git a/configs/sama5d4-ek/nxwm/defconfig b/configs/sama5d4-ek/nxwm/defconfig index 257669c195..b4ce31b3ac 100644 --- a/configs/sama5d4-ek/nxwm/defconfig +++ b/configs/sama5d4-ek/nxwm/defconfig @@ -442,7 +442,9 @@ CONFIG_RR_INTERVAL=200 CONFIG_TASK_NAME_SIZE=32 CONFIG_MAX_TASK_ARGS=4 CONFIG_MAX_TASKS=16 -# CONFIG_SCHED_HAVE_PARENT is not set +CONFIG_SCHED_HAVE_PARENT=y +CONFIG_SCHED_CHILD_STATUS=y +CONFIG_PREALLOC_CHILDSTATUS=4 CONFIG_SCHED_WAITPID=y # @@ -484,6 +486,7 @@ CONFIG_SCHED_ONEXIT_MAX=1 CONFIG_SIG_SIGUSR1=1 CONFIG_SIG_SIGUSR2=2 CONFIG_SIG_SIGALARM=3 +CONFIG_SIG_SIGCHLD=4 CONFIG_SIG_SIGCONDTIMEDOUT=16 CONFIG_SIG_SIGWORK=17 @@ -510,6 +513,8 @@ CONFIG_DEV_ZERO=y CONFIG_ARCH_HAVE_RNG=y CONFIG_DEV_RANDOM=y # CONFIG_LOOP is not set +# CONFIG_DRVR_WRITEBUFFER is not set +# CONFIG_DRVR_READAHEAD is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set # CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set diff --git a/include/nuttx/binfmt/binfmt.h b/include/nuttx/binfmt/binfmt.h index 8750e7215a..4e5052a7fd 100644 --- a/include/nuttx/binfmt/binfmt.h +++ b/include/nuttx/binfmt/binfmt.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/binfmt/binfmt.h * - * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -286,9 +286,13 @@ int schedule_unload(pid_t pid, FAR struct binary_s *bin); * * Description: * This is a convenience function that wraps load_ and exec_module into - * one call. If CONFIG_SCHED_ONEXIT is also defined, this function will - * automatically call schedule_unload() to unload the module when task - * exits. + * one call. If CONFIG_SCHED_ONEXIT and CONFIG_SCHED_HAVE_PARENT are + * also defined, this function will automatically call schedule_unload() + * to unload the module when task exits. + * + * NOTE: This function is flawed and useless without CONFIG_SCHED_ONEXIT + * and CONFIG_SCHED_HAVE_PARENT because there is then no mechanism to + * unload the module once it exits. * * Input Parameter: * filename - Fulll path to the binary to be loaded