summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-30 20:13:50 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-30 20:13:50 +0000
commit2848bbca144ff4b01906c7f6290c653800904b42 (patch)
treef770414832eeecb35adb70404b31d147afad7235
parent98d0ef6c36fb33301c697552a73e8f3d400a0c20 (diff)
Add configurable application entry point
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5070 7fd9a85b-ad96-42d3-883c-3090e2eb8679
-rwxr-xr-xapps/ChangeLog.txt4
-rw-r--r--apps/README.txt2
-rw-r--r--apps/examples/adc/adc_main.c30
-rw-r--r--apps/examples/buttons/main.c14
-rw-r--r--apps/examples/can/can_main.c24
-rw-r--r--apps/examples/composite/composite.h10
-rw-r--r--apps/examples/composite/composite_main.c20
-rw-r--r--apps/examples/dhcpd/target.c16
-rw-r--r--apps/examples/ftpd/ftpd.h10
-rw-r--r--apps/examples/ftpd/ftpd_main.c4
-rw-r--r--apps/examples/hello/main.c10
-rw-r--r--apps/examples/helloxx/main.cxx23
-rw-r--r--apps/examples/hidkbd/hidkbd_main.c12
-rw-r--r--apps/examples/igmp/igmp.c4
-rw-r--r--apps/examples/lcdrw/lcdrw_main.c10
-rw-r--r--apps/examples/mm/mm_main.c4
-rw-r--r--apps/examples/modbus/modbus_main.c36
-rw-r--r--apps/examples/mount/mount_main.c16
-rw-r--r--apps/examples/nettest/nettest.c16
-rw-r--r--apps/examples/nsh/nsh_main.c4
-rw-r--r--apps/examples/null/null_main.c4
-rw-r--r--apps/examples/nx/nx_main.c88
-rw-r--r--apps/examples/nxconsole/nxcon_main.c44
-rw-r--r--apps/examples/nxffs/nxffs_main.c4
-rw-r--r--apps/examples/nxflat/nxflat_main.c4
-rw-r--r--apps/examples/nxhello/nxhello_main.c28
-rw-r--r--apps/examples/nximage/nximage_main.c26
-rw-r--r--apps/examples/nxlines/nxlines_main.c26
-rw-r--r--apps/examples/nxtext/nxtext_main.c40
-rw-r--r--apps/examples/ostest/main.c32
-rw-r--r--apps/examples/pashello/pashello.c12
-rw-r--r--apps/examples/pipe/pipe_main.c46
-rw-r--r--apps/examples/pipe/redirect_test.c6
-rw-r--r--apps/examples/poll/poll_main.c36
-rw-r--r--apps/examples/pwm/pwm_main.c2
-rw-r--r--apps/examples/qencoder/qe_main.c32
-rw-r--r--apps/examples/rgmp/main.c4
-rw-r--r--apps/examples/romfs/romfs_main.c4
-rw-r--r--apps/examples/sendmail/target.c4
-rw-r--r--apps/examples/serloop/main.c4
-rw-r--r--apps/examples/telnetd/shell.c8
-rw-r--r--apps/examples/telnetd/shell.h10
-rw-r--r--apps/examples/thttpd/main.c4
-rw-r--r--apps/examples/tiff/tiff_main.c10
-rw-r--r--apps/examples/touchscreen/tc_main.c30
-rw-r--r--apps/examples/udp/target.c4
-rw-r--r--apps/examples/uip/main.c4
-rw-r--r--apps/examples/usbserial/main.c50
-rw-r--r--apps/examples/usbstorage/usbmsc_main.c48
-rw-r--r--apps/examples/usbterm/usbterm_main.c42
-rw-r--r--apps/examples/watchdog/watchdog_main.c2
-rw-r--r--apps/examples/wget/target.c4
-rw-r--r--apps/examples/wlan/wlan_main.c12
-rw-r--r--apps/interpreters/README.txt2
-rw-r--r--apps/system/i2c/i2c_main.c10
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/Documentation/NuttShell.html10
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html17
-rw-r--r--nuttx/Documentation/UsbTrace.html8
-rw-r--r--nuttx/configs/README.txt5
-rw-r--r--nuttx/configs/amber/hello/defconfig1
-rwxr-xr-xnuttx/configs/avr32dev1/nsh/defconfig1
-rwxr-xr-xnuttx/configs/avr32dev1/ostest/defconfig1
-rw-r--r--nuttx/configs/c5471evm/httpd/defconfig1
-rw-r--r--nuttx/configs/c5471evm/nettest/defconfig1
-rw-r--r--nuttx/configs/c5471evm/nsh/defconfig1
-rw-r--r--nuttx/configs/c5471evm/ostest/defconfig1
-rw-r--r--nuttx/configs/compal_e88/nsh_highram/defconfig1
-rw-r--r--nuttx/configs/compal_e99/nsh_compalram/defconfig1
-rw-r--r--nuttx/configs/compal_e99/nsh_highram/defconfig1
-rwxr-xr-xnuttx/configs/demo9s12ne64/ostest/defconfig1
-rw-r--r--nuttx/configs/ea3131/nsh/defconfig1
-rw-r--r--nuttx/configs/ea3131/ostest/defconfig1
-rw-r--r--nuttx/configs/ea3131/pgnsh/defconfig1
-rw-r--r--nuttx/configs/ea3131/usbserial/defconfig1
-rw-r--r--nuttx/configs/ea3131/usbstorage/defconfig2
-rw-r--r--nuttx/configs/ea3152/ostest/defconfig1
-rw-r--r--nuttx/configs/eagle100/httpd/defconfig1
-rw-r--r--nuttx/configs/eagle100/nettest/defconfig1
-rw-r--r--nuttx/configs/eagle100/nsh/defconfig1
-rw-r--r--nuttx/configs/eagle100/nxflat/defconfig1
-rw-r--r--nuttx/configs/eagle100/ostest/defconfig1
-rw-r--r--nuttx/configs/eagle100/thttpd/defconfig1
-rw-r--r--nuttx/configs/ekk-lm3s9b96/nsh/defconfig1
-rw-r--r--nuttx/configs/ekk-lm3s9b96/ostest/defconfig1
-rw-r--r--nuttx/configs/ez80f910200kitg/ostest/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/dhcpd/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/httpd/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/nettest/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/nsh/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/ostest/defconfig1
-rw-r--r--nuttx/configs/ez80f910200zco/poll/defconfig1
-rw-r--r--nuttx/configs/hymini-stm32v/buttons/defconfig1
-rwxr-xr-xnuttx/configs/hymini-stm32v/nsh/defconfig1
-rw-r--r--nuttx/configs/hymini-stm32v/nsh2/defconfig1
-rw-r--r--nuttx/configs/hymini-stm32v/nx/defconfig1
-rw-r--r--nuttx/configs/hymini-stm32v/nxlines/defconfig1
-rwxr-xr-xnuttx/configs/hymini-stm32v/usbserial/defconfig1
-rwxr-xr-xnuttx/configs/hymini-stm32v/usbstorage/defconfig2
-rwxr-xr-xnuttx/configs/kwikstik-k40/ostest/defconfig1
-rw-r--r--nuttx/configs/lincoln60/nsh/defconfig1
-rw-r--r--nuttx/configs/lincoln60/ostest/defconfig1
-rw-r--r--nuttx/configs/lm3s6432-s2e/nsh/defconfig1
-rw-r--r--nuttx/configs/lm3s6432-s2e/ostest/defconfig1
-rwxr-xr-xnuttx/configs/lm3s6965-ek/nsh/defconfig1
-rwxr-xr-xnuttx/configs/lm3s6965-ek/nx/defconfig1
-rwxr-xr-xnuttx/configs/lm3s6965-ek/ostest/defconfig1
-rwxr-xr-xnuttx/configs/lm3s8962-ek/nsh/defconfig1
-rwxr-xr-xnuttx/configs/lm3s8962-ek/nx/defconfig1
-rwxr-xr-xnuttx/configs/lm3s8962-ek/ostest/defconfig1
-rw-r--r--nuttx/configs/lpc4330-xplorer/nsh/defconfig1
-rw-r--r--nuttx/configs/lpc4330-xplorer/ostest/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/nsh/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/nx/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/ostest/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig1
-rwxr-xr-xnuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig2
-rw-r--r--nuttx/configs/m68332evb/defconfig1
-rw-r--r--nuttx/configs/mbed/hidkbd/defconfig1
-rwxr-xr-xnuttx/configs/mbed/nsh/defconfig1
-rw-r--r--nuttx/configs/mcu123-lpc214x/composite/defconfig2
-rw-r--r--nuttx/configs/mcu123-lpc214x/nsh/defconfig1
-rw-r--r--nuttx/configs/mcu123-lpc214x/ostest/defconfig1
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbserial/defconfig1
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbstorage/defconfig2
-rw-r--r--nuttx/configs/micropendous3/hello/defconfig1
-rw-r--r--nuttx/configs/mirtoo/nsh/defconfig1
-rw-r--r--nuttx/configs/mirtoo/nxffs/defconfig1
-rw-r--r--nuttx/configs/mirtoo/ostest/defconfig1
-rw-r--r--nuttx/configs/mx1ads/ostest/defconfig1
-rwxr-xr-xnuttx/configs/ne64badge/ostest/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/nettest/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/nsh/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/ostest/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/poll/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/thttpd/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/udp/defconfig1
-rw-r--r--nuttx/configs/ntosd-dm320/uip/defconfig1
-rwxr-xr-xnuttx/configs/nucleus2g/nsh/defconfig1
-rwxr-xr-xnuttx/configs/nucleus2g/ostest/defconfig1
-rwxr-xr-xnuttx/configs/nucleus2g/usbserial/defconfig1
-rwxr-xr-xnuttx/configs/nucleus2g/usbstorage/defconfig2
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/ftpc/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/hidkbd/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/nettest/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/nsh/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/nx/defconfig2
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/ostest/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/thttpd/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/usbserial/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/usbstorage/defconfig2
-rwxr-xr-xnuttx/configs/olimex-lpc1766stk/wlan/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc2378/nsh/defconfig1
-rwxr-xr-xnuttx/configs/olimex-lpc2378/ostest/defconfig1
-rw-r--r--nuttx/configs/olimex-stm32-p107/nsh/defconfig1
-rw-r--r--nuttx/configs/olimex-stm32-p107/ostest/defconfig1
-rwxr-xr-xnuttx/configs/olimex-strp711/nettest/defconfig1
-rw-r--r--nuttx/configs/olimex-strp711/nsh/defconfig1
-rw-r--r--nuttx/configs/olimex-strp711/ostest/defconfig1
-rw-r--r--nuttx/configs/pcblogic-pic32mx/nsh/defconfig1
-rw-r--r--nuttx/configs/pcblogic-pic32mx/ostest/defconfig1
-rw-r--r--nuttx/configs/pic32-starterkit/nsh/defconfig1
-rw-r--r--nuttx/configs/pic32-starterkit/nsh2/defconfig2
-rw-r--r--nuttx/configs/pic32-starterkit/ostest/defconfig2
-rw-r--r--nuttx/configs/pic32mx7mmb/nsh/defconfig1
-rw-r--r--nuttx/configs/pic32mx7mmb/ostest/defconfig2
-rw-r--r--nuttx/configs/pjrc-8051/defconfig1
-rw-r--r--nuttx/configs/qemu-i486/nsh/defconfig1
-rw-r--r--nuttx/configs/qemu-i486/ostest/defconfig1
-rw-r--r--nuttx/configs/rgmp/arm/default/defconfig1
-rw-r--r--nuttx/configs/rgmp/arm/nsh/defconfig1
-rw-r--r--nuttx/configs/rgmp/x86/default/defconfig1
-rw-r--r--nuttx/configs/rgmp/x86/nsh/defconfig1
-rwxr-xr-xnuttx/configs/sam3u-ek/knsh/defconfig1
-rwxr-xr-xnuttx/configs/sam3u-ek/nsh/defconfig1
-rwxr-xr-xnuttx/configs/sam3u-ek/nx/defconfig1
-rwxr-xr-xnuttx/configs/sam3u-ek/ostest/defconfig1
-rwxr-xr-xnuttx/configs/sam3u-ek/touchscreen/defconfig1
-rw-r--r--nuttx/configs/sim/mount/defconfig1
-rw-r--r--nuttx/configs/sim/nettest/defconfig1
-rw-r--r--nuttx/configs/sim/nsh/defconfig1
-rw-r--r--nuttx/configs/sim/nsh2/defconfig1
-rw-r--r--nuttx/configs/sim/nx/defconfig1
-rw-r--r--nuttx/configs/sim/nx11/defconfig1
-rw-r--r--nuttx/configs/sim/nxffs/defconfig1
-rw-r--r--nuttx/configs/sim/nxwm/defconfig1
-rw-r--r--nuttx/configs/sim/ostest/defconfig1
-rw-r--r--nuttx/configs/sim/pashello/defconfig1
-rw-r--r--nuttx/configs/sim/touchscreen/defconfig1
-rw-r--r--nuttx/configs/skp16c26/ostest/defconfig1
-rwxr-xr-xnuttx/configs/stm3210e-eval/RIDE/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/buttons/defconfig1
-rwxr-xr-xnuttx/configs/stm3210e-eval/composite/defconfig2
-rwxr-xr-xnuttx/configs/stm3210e-eval/nsh/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/nsh2/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/nx/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/nxconsole/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/nxlines/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/nxtext/defconfig1
-rwxr-xr-xnuttx/configs/stm3210e-eval/ostest/defconfig1
-rw-r--r--nuttx/configs/stm3210e-eval/pm/defconfig1
-rwxr-xr-xnuttx/configs/stm3210e-eval/usbserial/defconfig1
-rwxr-xr-xnuttx/configs/stm3210e-eval/usbstorage/defconfig2
-rw-r--r--nuttx/configs/stm3220g-eval/dhcpd/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nettest/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nsh/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nsh2/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/nxwm/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/ostest/defconfig1
-rw-r--r--nuttx/configs/stm3220g-eval/telnetd/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/dhcpd/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nettest/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nsh/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nsh2/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nxconsole/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/nxwm/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/ostest/defconfig1
-rw-r--r--nuttx/configs/stm3240g-eval/telnetd/defconfig1
-rw-r--r--nuttx/configs/stm32f4discovery/nsh/defconfig1
-rw-r--r--nuttx/configs/stm32f4discovery/nxlines/defconfig1
-rw-r--r--nuttx/configs/stm32f4discovery/ostest/defconfig1
-rw-r--r--nuttx/configs/stm32f4discovery/pm/defconfig1
-rw-r--r--nuttx/configs/sure-pic32mx/nsh/defconfig1
-rw-r--r--nuttx/configs/sure-pic32mx/ostest/defconfig1
-rw-r--r--nuttx/configs/sure-pic32mx/usbnsh/defconfig1
-rw-r--r--nuttx/configs/teensy/hello/defconfig1
-rwxr-xr-xnuttx/configs/teensy/nsh/defconfig1
-rwxr-xr-xnuttx/configs/teensy/usbstorage/defconfig2
-rw-r--r--nuttx/configs/twr-k60n512/nsh/defconfig1
-rw-r--r--nuttx/configs/twr-k60n512/ostest/defconfig1
-rw-r--r--nuttx/configs/ubw32/nsh/defconfig1
-rw-r--r--nuttx/configs/ubw32/ostest/defconfig1
-rw-r--r--nuttx/configs/us7032evb1/nsh/defconfig1
-rw-r--r--nuttx/configs/us7032evb1/ostest/defconfig1
-rwxr-xr-xnuttx/configs/vsn/nsh/defconfig1
-rw-r--r--nuttx/configs/xtrs/nsh/defconfig1
-rw-r--r--nuttx/configs/xtrs/ostest/defconfig1
-rw-r--r--nuttx/configs/xtrs/pashello/defconfig1
-rw-r--r--nuttx/configs/z16f2800100zcog/ostest/defconfig1
-rw-r--r--nuttx/configs/z16f2800100zcog/pashello/defconfig1
-rw-r--r--nuttx/configs/z80sim/nsh/defconfig1
-rw-r--r--nuttx/configs/z80sim/ostest/defconfig1
-rw-r--r--nuttx/configs/z80sim/pashello/defconfig1
-rw-r--r--nuttx/configs/z8encore000zco/ostest/defconfig1
-rw-r--r--nuttx/configs/z8f64200100kit/ostest/defconfig1
-rw-r--r--nuttx/include/assert.h4
-rw-r--r--nuttx/include/nuttx/init.h2
-rw-r--r--nuttx/sched/Kconfig8
-rw-r--r--nuttx/sched/os_bringup.c10
-rw-r--r--nuttx/tools/Config.mk9
-rw-r--r--nuttx/tools/cfgparser.c149
-rw-r--r--nuttx/tools/mkconfig.c8
254 files changed, 777 insertions, 613 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt
index e5c0b33a58..1178c203c2 100755
--- a/apps/ChangeLog.txt
+++ b/apps/ChangeLog.txt
@@ -291,3 +291,7 @@
treads!
* apps/nshlib/nsh.h: Both CONFIG_LIBC_STRERROR and CONFIG_NSH_STRERROR
must be defined to use strerror() with NSH.
+ * apps/examples/*/*_main.c, system/i2c/i2c_main.c, and others: Added
+ configuration variable CONFIG_USER_ENTRYPOINT that may be used to change
+ the default entry from user_start to some other symbol. Contributed by
+ Kate.
diff --git a/apps/README.txt b/apps/README.txt
index 4266585726..f9c9ececd7 100644
--- a/apps/README.txt
+++ b/apps/README.txt
@@ -118,7 +118,7 @@ the NuttX configuration file:
CONFIG_BUILTIN_APP_START=<application name>
that application shall be invoked immediately after system starts
-*instead* of the normal, default "user_start" entry point.
+*instead* of the default "user_start" entry point.
Note that <application name> must be provided as: "hello",
will call:
diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c
index b880326549..4797265db0 100644
--- a/apps/examples/adc/adc_main.c
+++ b/apps/examples/adc/adc_main.c
@@ -57,14 +57,6 @@
* Pre-processor Definitions
****************************************************************************/
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME adc_main
-# define MAIN_STRING "adc_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
@@ -223,10 +215,10 @@ static void parse_args(FAR struct adc_state_s *adc, int argc, FAR char **argv)
****************************************************************************/
/****************************************************************************
- * Name: user_start/adc_main
+ * Name: adc_main
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int adc_main(int argc, char *argv[])
{
struct adc_msg_s sample[CONFIG_EXAMPLES_ADC_GROUPSIZE];
size_t readsize;
@@ -244,11 +236,11 @@ int MAIN_NAME(int argc, char *argv[])
* this test.
*/
- message(MAIN_STRING "Initializing external ADC device\n");
+ message("adc_main: Initializing external ADC device\n");
ret = adc_devinit();
if (ret != OK)
{
- message(MAIN_STRING "adc_devinit failed: %d\n", ret);
+ message("adc_main: adc_devinit failed: %d\n", ret);
errval = 1;
goto errout;
}
@@ -276,18 +268,18 @@ int MAIN_NAME(int argc, char *argv[])
*/
#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_ADC_NSAMPLES)
- message(MAIN_STRING "g_adcstate.count: %d\n", g_adcstate.count);
+ message("adc_main: g_adcstate.count: %d\n", g_adcstate.count);
#endif
/* Open the ADC device for reading */
- message(MAIN_STRING "Hardware initialized. Opening the ADC device: %s\n",
+ message("adc_main: Hardware initialized. Opening the ADC device: %s\n",
g_adcstate.devpath);
fd = open(g_adcstate.devpath, O_RDONLY);
if (fd < 0)
{
- message(MAIN_STRING "open %s failed: %d\n", g_adcstate.devpath, errno);
+ message("adc_main: open %s failed: %d\n", g_adcstate.devpath, errno);
errval = 2;
goto errout_with_dev;
}
@@ -322,17 +314,17 @@ int MAIN_NAME(int argc, char *argv[])
errval = errno;
if (errval != EINTR)
{
- message(MAIN_STRING "read %s failed: %d\n",
+ message("adc_main: read %s failed: %d\n",
g_adcstate.devpath, errval);
errval = 3;
goto errout_with_dev;
}
- message(MAIN_STRING "Interrupted read...\n");
+ message("adc_main: Interrupted read...\n");
}
else if (nbytes == 0)
{
- message(MAIN_STRING "No data read, Ignoring\n");
+ message("adc_main: No data read, Ignoring\n");
}
/* Print the sample data on successful return */
@@ -342,7 +334,7 @@ int MAIN_NAME(int argc, char *argv[])
int nsamples = nbytes / sizeof(struct adc_msg_s);
if (nsamples * sizeof(struct adc_msg_s) != nbytes)
{
- message(MAIN_STRING "read size=%d is not a multiple of sample size=%d, Ignoring\n",
+ message("adc_main: read size=%d is not a multiple of sample size=%d, Ignoring\n",
nbytes, sizeof(struct adc_msg_s));
}
else
diff --git a/apps/examples/buttons/main.c b/apps/examples/buttons/main.c
index fe447ca6b6..50124512cd 100644
--- a/apps/examples/buttons/main.c
+++ b/apps/examples/buttons/main.c
@@ -130,16 +130,6 @@
#define NUM_BUTTONS (MAX_BUTTON - MIN_BUTTON + 1)
#define BUTTON_INDEX(b) ((b)-MIN_BUTTON)
-/* Is this being built as an NSH built-in application? */
-
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME buttons_main
-# define MAIN_STRING "buttons_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
@@ -399,10 +389,10 @@ static int button7_handler(int irq, FAR void *context)
****************************************************************************/
/****************************************************************************
- * user_start/buttons_main
+ * buttons_main
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int buttons_main(int argc, char *argv[])
{
uint8_t newset;
irqstate_t flags;
diff --git a/apps/examples/can/can_main.c b/apps/examples/can/can_main.c
index 0ea729e5e8..d3ca241192 100644
--- a/apps/examples/can/can_main.c
+++ b/apps/examples/can/can_main.c
@@ -76,14 +76,6 @@
# define MAX_ID (1 << 11)
#endif
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME can_main
-# define MAIN_STRING "can_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
@@ -109,10 +101,10 @@
****************************************************************************/
/****************************************************************************
- * Name: user_start/can_main
+ * Name: can_main
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int can_main(int argc, char *argv[])
{
#ifndef CONFIG_EXAMPLES_CAN_READONLY
struct can_msg_s txmsg;
@@ -150,31 +142,31 @@ int MAIN_NAME(int argc, char *argv[])
{
nmsgs = strtol(argv[1], NULL, 10);
}
- message(MAIN_STRING "nmsgs: %d\n", nmsgs);
+ message("can_main: nmsgs: %d\n", nmsgs);
#elif defined(CONFIG_EXAMPLES_CAN_NMSGS)
- message(MAIN_STRING "nmsgs: %d\n", CONFIG_EXAMPLES_CAN_NMSGS);
+ message("can_main: nmsgs: %d\n", CONFIG_EXAMPLES_CAN_NMSGS);
#endif
/* Initialization of the CAN hardware is performed by logic external to
* this test.
*/
- message(MAIN_STRING "Initializing external CAN device\n");
+ message("can_main: Initializing external CAN device\n");
ret = can_devinit();
if (ret != OK)
{
- message(MAIN_STRING "can_devinit failed: %d\n", ret);
+ message("can_main: can_devinit failed: %d\n", ret);
errval = 1;
goto errout;
}
/* Open the CAN device for reading */
- message(MAIN_STRING "Hardware initialized. Opening the CAN device\n");
+ message("can_main: Hardware initialized. Opening the CAN device\n");
fd = open(CONFIG_EXAMPLES_CAN_DEVPATH, CAN_OFLAGS);
if (fd < 0)
{
- message(MAIN_STRING "open %s failed: %d\n",
+ message("can_main: open %s failed: %d\n",
CONFIG_EXAMPLES_CAN_DEVPATH, errno);
errval = 2;
goto errout_with_dev;
diff --git a/apps/examples/composite/composite.h b/apps/examples/composite/composite.h
index fab498c9fa..73a4453be7 100644
--- a/apps/examples/composite/composite.h
+++ b/apps/examples/composite/composite.h
@@ -169,16 +169,6 @@
#define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|TRACE_CLASS_BITS|\
TRACE_TRANSFER_BITS|TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS)
-/* Entry point **************************************************************/
-
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME conn_main
-# define MAIN_NAME_STRING "conn"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
/* Debug ********************************************************************/
#ifdef CONFIG_CPP_HAVE_VARARGS
diff --git a/apps/examples/composite/composite_main.c b/apps/examples/composite/composite_main.c
index 6c2a862872..b965eacb7c 100644
--- a/apps/examples/composite/composite_main.c
+++ b/apps/examples/composite/composite_main.c
@@ -662,7 +662,7 @@ void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev)
}
/****************************************************************************
- * user_start/conn_main
+ * conn_main
*
* Description:
* This is the main program that configures the USB mass storage device
@@ -672,7 +672,7 @@ void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev)
*
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int conn_main(int argc, char *argv[])
{
int ret;
@@ -688,7 +688,7 @@ int MAIN_NAME(int argc, char *argv[])
if (g_composite.cmphandle)
{
- message(MAIN_NAME_STRING ": ERROR: Already connected\n");
+ message("conn_main: ERROR: Already connected\n");
return 1;
}
#endif
@@ -705,11 +705,11 @@ int MAIN_NAME(int argc, char *argv[])
/* Perform architecture-specific initialization */
- message(MAIN_NAME_STRING ": Performing architecture-specific intialization\n");
+ message("conn_main: Performing architecture-specific intialization\n");
ret = composite_archinitialize();
if (ret < 0)
{
- message(MAIN_NAME_STRING ": composite_archinitialize failed: %d\n", -ret);
+ message("conn_main: composite_archinitialize failed: %d\n", -ret);
return 1;
}
check_test_memory_usage("After composite_archinitialize()");
@@ -719,7 +719,7 @@ int MAIN_NAME(int argc, char *argv[])
g_composite.cmphandle = composite_initialize();
if (!g_composite.cmphandle)
{
- message(MAIN_NAME_STRING ": composite_initialize failed\n");
+ message("conn_main: composite_initialize failed\n");
return 1;
}
check_test_memory_usage("After composite_initialize()");
@@ -774,7 +774,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Dump trace data */
# ifdef CONFIG_USBDEV_TRACE
- message("\n" MAIN_NAME_STRING ": USB TRACE DATA:\n");
+ message("\n" "conn_main: USB TRACE DATA:\n");
ret = dumptrace();
if (ret < 0)
{
@@ -782,18 +782,18 @@ int MAIN_NAME(int argc, char *argv[])
}
check_test_memory_usage("After usbtrace_enumerate()");
# else
- message(MAIN_NAME_STRING ": Still alive\n");
+ message("conn_main: Still alive\n");
# endif
}
#else
- message(MAIN_NAME_STRING ": Connected\n");
+ message("conn_main: Connected\n");
check_test_memory_usage("After composite device connection");
#endif
/* Dump debug memory usage */
- message(MAIN_NAME_STRING ": Exiting\n");
+ message("conn_main: Exiting\n");
#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_DISABLE_SIGNALS)
close(g_composite.infd);
close(g_composite.outfd);
diff --git a/apps/examples/dhcpd/target.c b/apps/examples/dhcpd/target.c
index d43e86e94a..9c554e8cd7 100644
--- a/apps/examples/dhcpd/target.c
+++ b/apps/examples/dhcpd/target.c
@@ -81,27 +81,15 @@
# error "You must define CONFIG_NET_BROADCAST"
#endif
-/* If CONFIG_NSH_BUILTIN_APPS is defined, then it is assumed that you want
- * to execute the DHCPD daemon as an NSH built-in task.
- */
-
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME dhcpd_main
-# define MAIN_NAME_STRING "dhcpd_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
- * Name: user_start/dhcpd_main
+ * Name: dhcpd_main
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int dhcpd_main(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_DHCPD_NOMAC)
diff --git a/apps/examples/ftpd/ftpd.h b/apps/examples/ftpd/ftpd.h
index 98ee3b3b66..6a439e8184 100644
--- a/apps/examples/ftpd/ftpd.h
+++ b/apps/examples/ftpd/ftpd.h
@@ -107,16 +107,6 @@
# endif
#endif
-/* Is this being built as an NSH built-in application? */
-
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME ftpd_start
-# define MAIN_STRING "ftpd_start: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
/****************************************************************************
* Public Types
****************************************************************************/
diff --git a/apps/examples/ftpd/ftpd_main.c b/apps/examples/ftpd/ftpd_main.c
index 6ae0a11e51..6d19f952c5 100644
--- a/apps/examples/ftpd/ftpd_main.c
+++ b/apps/examples/ftpd/ftpd_main.c
@@ -217,10 +217,10 @@ int ftpd_daemon(int s_argc, char **s_argv)
* Public Functions
****************************************************************************/
/****************************************************************************
- * Name: user_start/ftpd_start
+ * Name: ftpd_main
****************************************************************************/
-int MAIN_NAME(int s_argc, char **s_argv)
+int ftpd_main(int s_argc, char **s_argv)
{
/* Check if we have already initialized the network */
diff --git a/apps/examples/hello/main.c b/apps/examples/hello/main.c
index 7934dc34ba..7e07cffd13 100644
--- a/apps/examples/hello/main.c
+++ b/apps/examples/hello/main.c
@@ -53,16 +53,10 @@
****************************************************************************/
/****************************************************************************
- * user_start/hello_main
+ * hello_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_HELLO_BUILTIN
-# define MAIN_NAME hello_main
-#else
-# define MAIN_NAME user_start
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int hello_main(int argc, char *argv[])
{
printf("Hello, World!!\n");
return 0;
diff --git a/apps/examples/helloxx/main.cxx b/apps/examples/helloxx/main.cxx
index 8514fead22..fcec7c761a 100644
--- a/apps/examples/helloxx/main.cxx
+++ b/apps/examples/helloxx/main.cxx
@@ -124,24 +124,11 @@ static CHelloWorld g_HelloWorld;
// Public Functions
//***************************************************************************
-//***************************************************************************
-// user_start
-//***************************************************************************
-
/****************************************************************************
- * Name: user_start/nxhello_main
+ * Name: helloxx_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_HELLOXX_BUILTIN
-extern "C" int helloxx_main(int argc, char *argv[]);
-# define MAIN_NAME helloxx_main
-# define MAIN_STRING "helloxx_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int helloxx_main(int argc, char *argv[])
{
// If C++ initialization for static constructors is supported, then do
// that first
@@ -153,7 +140,7 @@ int MAIN_NAME(int argc, char *argv[])
// Exercise an explictly instantiated C++ object
CHelloWorld *pHelloWorld = new CHelloWorld;
- printf(MAIN_STRING "Saying hello from the dynamically constructed instance\n");
+ printf("helloxx_main: Saying hello from the dynamically constructed instance\n");
pHelloWorld->HelloWorld();
// Exercise an C++ object instantiated on the stack
@@ -161,14 +148,14 @@ int MAIN_NAME(int argc, char *argv[])
#ifndef CONFIG_EXAMPLES_HELLOXX_NOSTACKCONST
CHelloWorld HelloWorld;
- printf(MAIN_STRING "Saying hello from the instance constructed on the stack\n");
+ printf("helloxx_main: Saying hello from the instance constructed on the stack\n");
HelloWorld.HelloWorld();
#endif
// Exercise an statically constructed C++ object
#ifdef CONFIG_HAVE_CXXINITIALIZE
- printf(MAIN_STRING "Saying hello from the statically constructed instance\n");
+ printf("helloxx_main: Saying hello from the statically constructed instance\n");
g_HelloWorld.HelloWorld();
#endif
diff --git a/apps/examples/hidkbd/hidkbd_main.c b/apps/examples/hidkbd/hidkbd_main.c
index 96864b9f9b..51e927008b 100644
--- a/apps/examples/hidkbd/hidkbd_main.c
+++ b/apps/examples/hidkbd/hidkbd_main.c
@@ -141,10 +141,10 @@ static int hidkbd_waiter(int argc, char *argv[])
}
/****************************************************************************
- * Name: user_start
+ * Name: hidkbd_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int hidkbd_main(int argc, char *argv[])
{
char buffer[256];
pid_t pid;
@@ -154,22 +154,22 @@ int user_start(int argc, char *argv[])
/* First, register all of the USB host HID keyboard class driver */
- printf("user_start: Register class drivers\n");
+ printf("hidkbd_main: Register class drivers\n");
ret = usbhost_kbdinit();
if (ret != OK)
{
- printf("user_start: Failed to register the KBD class\n");
+ printf("hidkbd_main: Failed to register the KBD class\n");
}
/* Then get an instance of the USB host interface */
- printf("user_start: Initialize USB host keyboard driver\n");
+ printf("hidkbd_main: Initialize USB host keyboard driver\n");
g_drvr = usbhost_initialize(0);
if (g_drvr)
{
/* Start a thread to handle device connection. */
- printf("user_start: Start hidkbd_waiter\n");
+ printf("hidkbd_main: Start hidkbd_waiter\n");
#ifndef CONFIG_CUSTOM_STACK
pid = task_create("usbhost", CONFIG_EXAMPLES_HIDKBD_DEFPRIO,
diff --git a/apps/examples/igmp/igmp.c b/apps/examples/igmp/igmp.c
index 4e3671a69b..73ca8a3e67 100644
--- a/apps/examples/igmp/igmp.c
+++ b/apps/examples/igmp/igmp.c
@@ -78,10 +78,10 @@
****************************************************************************/
/****************************************************************************
- * user_start
+ * igmp_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int igmp_main(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_IGMP_NOMAC)
diff --git a/apps/examples/lcdrw/lcdrw_main.c b/apps/examples/lcdrw/lcdrw_main.c
index c366743f47..f39e1849da 100644
--- a/apps/examples/lcdrw/lcdrw_main.c
+++ b/apps/examples/lcdrw/lcdrw_main.c
@@ -152,16 +152,10 @@ static inline int lcdrw_initialize(FAR struct lcdrw_instance_s *inst)
****************************************************************************/
/****************************************************************************
- * Name: lcdrw_main/user_start
+ * Name: lcdrw_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_LCDRW_BUILTIN
-# define MAIN_NAME lcdrw_main
-#else
-# define MAIN_NAME user_start
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int lcdrw_main(int argc, char *argv[])
{
struct lcdrw_instance_s inst;
nxgl_coord_t row;
diff --git a/apps/examples/mm/mm_main.c b/apps/examples/mm/mm_main.c
index 036c390474..5d45efdc59 100644
--- a/apps/examples/mm/mm_main.c
+++ b/apps/examples/mm/mm_main.c
@@ -267,10 +267,10 @@ static void do_frees(void **mem, const int *size, const int *seq, int n)
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: mm_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int mm_main(int argc, char *argv[])
{
mm_showmallinfo();
diff --git a/apps/examples/modbus/modbus_main.c b/apps/examples/modbus/modbus_main.c
index bb89c6cbb8..13967f6fd0 100644
--- a/apps/examples/modbus/modbus_main.c
+++ b/apps/examples/modbus/modbus_main.c
@@ -104,14 +104,6 @@
# define CONFIG_EXAMPLES_MODBUS_REG_HOLDING_NREGS 130
#endif
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME modbus_main
-# define MAIN_NAME_STRING "modbus_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start: "
-#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
@@ -171,7 +163,7 @@ static inline int modbus_initialize(void)
if (g_modbus.threadstate != STOPPED)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: Bad state: %d\n", g_modbus.threadstate);
return EINVAL;
}
@@ -181,7 +173,7 @@ static inline int modbus_initialize(void)
status = pthread_mutex_init(&g_modbus.lock, NULL);
if (status != 0)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: pthread_mutex_init failed: %d\n", status);
return status;
}
@@ -201,7 +193,7 @@ static inline int modbus_initialize(void)
CONFIG_EXAMPLES_MODBUS_BAUD, CONFIG_EXAMPLES_MODBUS_PARITY);
if (mberr != MB_ENOERR)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: eMBInit failed: %d\n", mberr);
goto errout_with_mutex;
}
@@ -217,7 +209,7 @@ static inline int modbus_initialize(void)
mberr = eMBSetSlaveID(0x34, true, g_slaveid, 3);
if (mberr != MB_ENOERR)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: eMBSetSlaveID failed: %d\n", mberr);
goto errout_with_modbus;
}
@@ -227,7 +219,7 @@ static inline int modbus_initialize(void)
mberr = eMBEnable();
if (mberr == MB_ENOERR)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: eMBEnable failed: %d\n", mberr);
goto errout_with_modbus;
}
@@ -270,7 +262,7 @@ static void *modbus_pollthread(void *pvarg)
ret = modbus_initialize();
if (ret != OK)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: modbus_initialize failed: %d\n", ret);
return NULL;
}
@@ -358,14 +350,14 @@ static void modbus_showusage(FAR const char *progname, int exitcode)
****************************************************************************/
/****************************************************************************
- * Name: user_start/modbus_main
+ * Name: modbus_main
*
* Description:
* This is the main entry point to the demo program
*
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int modbus_main(int argc, char *argv[])
{
int option;
int ret;
@@ -389,7 +381,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = modbus_create_pollthread();
if (ret != OK)
{
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: modbus_create_pollthread failed: %d\n", ret);
exit(EXIT_FAILURE);
}
@@ -400,19 +392,19 @@ int MAIN_NAME(int argc, char *argv[])
switch (g_modbus.threadstate)
{
case RUNNING:
- printf(MAIN_NAME_STRING "Protocol stack is running\n");
+ printf("modbus_main: Protocol stack is running\n");
break;
case STOPPED:
- printf(MAIN_NAME_STRING "Protocol stack is stopped\n");
+ printf("modbus_main: Protocol stack is stopped\n");
break;
case SHUTDOWN:
- printf(MAIN_NAME_STRING "Protocol stack is shutting down\n");
+ printf("modbus_main: Protocol stack is shutting down\n");
break;
default:
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: Invalid thread state: %d\n",
g_modbus.threadstate);
break;
@@ -429,7 +421,7 @@ int MAIN_NAME(int argc, char *argv[])
break;
default:
- fprintf(stderr, MAIN_NAME_STRING
+ fprintf(stderr, "modbus_main: "
"ERROR: Unrecognized option: '%c'\n", option);
modbus_showusage(argv[0], EXIT_FAILURE);
break;
diff --git a/apps/examples/mount/mount_main.c b/apps/examples/mount/mount_main.c
index 00070b94c0..5f881e40ca 100644
--- a/apps/examples/mount/mount_main.c
+++ b/apps/examples/mount/mount_main.c
@@ -567,10 +567,10 @@ static void succeed_stat(const char *path)
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: mount_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int mount_main(int argc, char *argv[])
{
int ret;
@@ -580,18 +580,18 @@ int user_start(int argc, char *argv[])
ret = create_ramdisk();
if (ret < 0)
{
- printf("user_start: ERROR failed to create RAM disk\n");
+ printf("mount_main: ERROR failed to create RAM disk\n");
return 1;
}
#endif
/* Mount the test file system (see arch/sim/src/up_deviceimage.c */
- printf("user_start: mounting %s filesystem at target=%s with source=%s\n",
+ printf("mount_main: mounting %s filesystem at target=%s with source=%s\n",
g_filesystemtype, g_target, g_source);
ret = mount(g_source, g_target, g_filesystemtype, 0, NULL);
- printf("user_start: mount() returned %d\n", ret);
+ printf("mount_main: mount() returned %d\n", ret);
if (ret == 0)
{
@@ -737,16 +737,16 @@ int user_start(int argc, char *argv[])
/* Unmount the file system */
- printf("user_start: Try unmount(%s)\n", g_target);
+ printf("mount_main: Try unmount(%s)\n", g_target);
ret = umount(g_target);
if (ret != 0)
{
- printf("user_start: ERROR umount() failed, errno %d\n", errno);
+ printf("mount_main: ERROR umount() failed, errno %d\n", errno);
g_nerrors++;
}
- printf("user_start: %d errors reported\n", g_nerrors);
+ printf("mount_main: %d errors reported\n", g_nerrors);
}
fflush(stdout);
diff --git a/apps/examples/nettest/nettest.c b/apps/examples/nettest/nettest.c
index d6d63eeef6..b95d9da623 100644
--- a/apps/examples/nettest/nettest.c
+++ b/apps/examples/nettest/nettest.c
@@ -53,18 +53,6 @@
* Definitions
****************************************************************************/
-/* If CONFIG_NSH_BUILTIN_APPS is defined, then it is assumed that you want
- * to execute the DHCPD daemon as an NSH built-in task.
- */
-
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME nettest_main
-# define MAIN_NAME_STRING "nettest_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
/****************************************************************************
* Private Data
****************************************************************************/
@@ -74,10 +62,10 @@
****************************************************************************/
/****************************************************************************
- * user_start
+ * nettest_main
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int nettest_main(int argc, char *argv[])
{
struct in_addr addr;
#ifdef CONFIG_EXAMPLE_NETTEST_NOMAC
diff --git a/apps/examples/nsh/nsh_main.c b/apps/examples/nsh/nsh_main.c
index c5b671ab14..97792cb2a3 100644
--- a/apps/examples/nsh/nsh_main.c
+++ b/apps/examples/nsh/nsh_main.c
@@ -84,10 +84,10 @@
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: nsh_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int nsh_main(int argc, char *argv[])
{
int exitval = 0;
int ret;
diff --git a/apps/examples/null/null_main.c b/apps/examples/null/null_main.c
index 10fc1bf1e4..63a14fcaca 100644
--- a/apps/examples/null/null_main.c
+++ b/apps/examples/null/null_main.c
@@ -58,10 +58,10 @@
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: null_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int null_main(int argc, char *argv[])
{
return 0;
}
diff --git a/apps/examples/nx/nx_main.c b/apps/examples/nx/nx_main.c
index db17ea2f2c..bcc4a9bbff 100644
--- a/apps/examples/nx/nx_main.c
+++ b/apps/examples/nx/nx_main.c
@@ -614,18 +614,10 @@ static int nxeg_initialize(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start/nx_main
+ * Name: nx_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_NX_BUILTIN
-# define MAIN_NAME nx_main
-# define MAIN_NAME_STRING "nx_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int nx_main(int argc, char *argv[])
{
NXEGWINDOW hwnd1;
NXEGWINDOW hwnd2;
@@ -637,10 +629,10 @@ int MAIN_NAME(int argc, char *argv[])
/* Initialize */
ret = nxeg_initialize();
- message(MAIN_NAME_STRING ": NX handle=%p\n", g_hnx);
+ message("nx_main: NX handle=%p\n", g_hnx);
if (!g_hnx || ret < 0)
{
- message(MAIN_NAME_STRING ": Failed to get NX handle: %d\n", errno);
+ message("nx_main: Failed to get NX handle: %d\n", errno);
g_exitcode = NXEXIT_NXOPEN;
goto errout;
}
@@ -650,29 +642,29 @@ int MAIN_NAME(int argc, char *argv[])
g_fonthandle = nxf_getfonthandle(CONFIG_EXAMPLES_NX_FONTID);
if (!g_fonthandle)
{
- message(MAIN_NAME_STRING ": Failed to get font handle: %d\n", errno);
+ message("nx_main: Failed to get font handle: %d\n", errno);
g_exitcode = NXEXIT_FONTOPEN;
goto errout;
}
/* Set the background to the configured background color */
- message(MAIN_NAME_STRING ": Set background color=%d\n", CONFIG_EXAMPLES_NX_BGCOLOR);
+ message("nx_main: Set background color=%d\n", CONFIG_EXAMPLES_NX_BGCOLOR);
color = CONFIG_EXAMPLES_NX_BGCOLOR;
ret = nx_setbgcolor(g_hnx, &color);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nx_main: nx_setbgcolor failed: %d\n", errno);
g_exitcode = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
/* Create window #1 */
- message(MAIN_NAME_STRING ": Create window #1\n");
+ message("nx_main: Create window #1\n");
nxeg_initstate(&g_wstate[0], 1, CONFIG_EXAMPLES_NX_COLOR1);
hwnd1 = nxeg_openwindow(&g_nxcb, &g_wstate[0]);
- message(MAIN_NAME_STRING ": hwnd1=%p\n", hwnd1);
+ message("nx_main: hwnd1=%p\n", hwnd1);
if (!hwnd1)
{
goto errout_with_nx;
@@ -684,14 +676,14 @@ int MAIN_NAME(int argc, char *argv[])
{
(void)sem_wait(&g_semevent);
}
- message(MAIN_NAME_STRING ": Screen resolution (%d,%d)\n", g_xres, g_yres);
+ message("nx_main: Screen resolution (%d,%d)\n", g_xres, g_yres);
/* Set the size of the window 1 */
size.w = g_xres / 2;
size.h = g_yres / 2;
- message(MAIN_NAME_STRING ": Set window #1 size to (%d,%d)\n", size.w, size.h);
+ message("nx_main: Set window #1 size to (%d,%d)\n", size.w, size.h);
ret = nxeg_setsize(hwnd1, &size);
if (ret < 0)
{
@@ -703,7 +695,7 @@ int MAIN_NAME(int argc, char *argv[])
* actually do them!
*/
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
/* Set the position of window #1 */
@@ -711,7 +703,7 @@ int MAIN_NAME(int argc, char *argv[])
pt.x = g_xres / 8;
pt.y = g_yres / 8;
- message(MAIN_NAME_STRING ": Set window #1 postion to (%d,%d)\n", pt.x, pt.y);
+ message("nx_main: Set window #1 postion to (%d,%d)\n", pt.x, pt.y);
ret = nxeg_setposition(hwnd1, &pt);
if (ret < 0)
{
@@ -720,13 +712,13 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
/* Open the toolbar */
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
- message(MAIN_NAME_STRING ": Add toolbar to window #1\n");
+ message("nx_main: Add toolbar to window #1\n");
ret = nxeq_opentoolbar(hwnd1, CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT, &g_tbcb, &g_wstate[0]);
if (ret < 0)
{
@@ -735,16 +727,16 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
#endif
/* Create window #2 */
- message(MAIN_NAME_STRING ": Create window #2\n");
+ message("nx_main: Create window #2\n");
nxeg_initstate(&g_wstate[1], 2, CONFIG_EXAMPLES_NX_COLOR2);
hwnd2 = nxeg_openwindow(&g_nxcb, &g_wstate[1]);
- message(MAIN_NAME_STRING ": hwnd2=%p\n", hwnd2);
+ message("nx_main: hwnd2=%p\n", hwnd2);
if (!hwnd2)
{
goto errout_with_hwnd1;
@@ -752,12 +744,12 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
/* Set the size of the window 2 == size of window 1*/
- message(MAIN_NAME_STRING ": Set hwnd2 size to (%d,%d)\n", size.w, size.h);
+ message("nx_main: Set hwnd2 size to (%d,%d)\n", size.w, size.h);
ret = nxeg_setsize(hwnd2, &size);
if (ret < 0)
{
@@ -766,7 +758,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
/* Set the position of window #2 */
@@ -774,7 +766,7 @@ int MAIN_NAME(int argc, char *argv[])
pt.x = g_xres - size.w - pt.x;
pt.y = g_yres - size.h - pt.y;
- message(MAIN_NAME_STRING ": Set hwnd2 postion to (%d,%d)\n", pt.x, pt.y);
+ message("nx_main: Set hwnd2 postion to (%d,%d)\n", pt.x, pt.y);
ret = nxeg_setposition(hwnd2, &pt);
if (ret < 0)
{
@@ -783,11 +775,11 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
- message(MAIN_NAME_STRING ": Add toolbar to window #2\n");
+ message("nx_main: Add toolbar to window #2\n");
ret = nxeq_opentoolbar(hwnd2, CONFIG_EXAMPLES_NX_TOOLBAR_HEIGHT, &g_tbcb, &g_wstate[1]);
if (ret < 0)
{
@@ -796,30 +788,30 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
#endif
/* Give keyboard input to the top window -- should be window #2 */
#ifdef CONFIG_NX_KBD
- message(MAIN_NAME_STRING ": Send keyboard input: %s\n", g_kbdmsg1);
+ message("nx_main: Send keyboard input: %s\n", g_kbdmsg1);
ret = nx_kbdin(g_hnx, strlen((FAR const char *)g_kbdmsg1), g_kbdmsg1);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_kbdin failed: %d\n", errno);
+ message("nx_main: nx_kbdin failed: %d\n", errno);
goto errout_with_hwnd2;
}
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
#endif
/* Lower window 2 */
- message(MAIN_NAME_STRING ": Lower window #2\n");
+ message("nx_main: Lower window #2\n");
ret = nxeg_lower(hwnd2);
if (ret < 0)
{
@@ -828,7 +820,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
/* Put mouse left-button clicks all over the screen and see who responds */
@@ -838,30 +830,30 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
#endif
/* Give keyboard input to the top window -- should be window #1 */
#ifdef CONFIG_NX_KBD
- message(MAIN_NAME_STRING ": Send keyboard input: %s\n", g_kbdmsg2);
+ message("nx_main: Send keyboard input: %s\n", g_kbdmsg2);
ret = nx_kbdin(g_hnx, strlen((FAR const char *)g_kbdmsg2), g_kbdmsg2);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_kbdin failed: %d\n", errno);
+ message("nx_main: nx_kbdin failed: %d\n", errno);
goto errout_with_hwnd2;
}
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(1);
#endif
/* Raise window 2 */
- message(MAIN_NAME_STRING ": Raise window #2\n");
+ message("nx_main: Raise window #2\n");
ret = nxeg_raise(hwnd2);
if (ret < 0)
{
@@ -876,31 +868,31 @@ int MAIN_NAME(int argc, char *argv[])
/* Sleep a bit */
- message(MAIN_NAME_STRING ": Sleeping\n\n");
+ message("nx_main: Sleeping\n\n");
sleep(2);
/* Close the window 2 */
errout_with_hwnd2:
- message(MAIN_NAME_STRING ": Close window #2\n");
+ message("nx_main: Close window #2\n");
(void)nxeg_closewindow(hwnd2, &g_wstate[1]);
/* Close the window1 */
errout_with_hwnd1:
- message(MAIN_NAME_STRING ": Close window #1\n");
+ message("nx_main: Close window #1\n");
(void)nxeg_closewindow(hwnd1, &g_wstate[0]);
errout_with_nx:
#ifdef CONFIG_NX_MULTIUSER
/* Disconnect from the server */
- message(MAIN_NAME_STRING ": Disconnect from the server\n");
+ message("nx_main: Disconnect from the server\n");
nx_disconnect(g_hnx);
#else
/* Close the server */
- message(MAIN_NAME_STRING ": Close NX\n");
+ message("nx_main: Close NX\n");
nx_close(g_hnx);
#endif
errout:
diff --git a/apps/examples/nxconsole/nxcon_main.c b/apps/examples/nxconsole/nxcon_main.c
index 5a9d20307b..41d8efd196 100644
--- a/apps/examples/nxconsole/nxcon_main.c
+++ b/apps/examples/nxconsole/nxcon_main.c
@@ -207,10 +207,10 @@ static int nxcon_task(int argc, char **argv)
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: nxcon_main
****************************************************************************/
-int user_start(int argc, char **argv)
+int nxcon_main(int argc, char **argv)
{
nxgl_mxpixel_t color;
int fd;
@@ -219,7 +219,7 @@ int user_start(int argc, char **argv)
/* General Initialization *************************************************/
/* Reset all global data */
- message("user_start: Started\n");
+ message("nxcon_main: Started\n");
memset(&g_nxcon_vars, 0, sizeof(struct nxcon_state_s));
/* Call all C++ static constructors */
@@ -231,7 +231,7 @@ int user_start(int argc, char **argv)
/* NSH Initialization *****************************************************/
/* Initialize the NSH library */
- message("user_start: Initialize NSH\n");
+ message("nxcon_main: Initialize NSH\n");
nsh_initialize();
/* If the Telnet console is selected as a front-end, then start the
@@ -252,37 +252,37 @@ int user_start(int argc, char **argv)
/* NX Initialization ******************************************************/
/* Initialize NX */
- message("user_start: Initialize NX\n");
+ message("nxcon_main: Initialize NX\n");
ret = nxcon_initialize();
- message("user_start: NX handle=%p\n", g_nxcon_vars.hnx);
+ message("nxcon_main: NX handle=%p\n", g_nxcon_vars.hnx);
if (!g_nxcon_vars.hnx || ret < 0)
{
- message("user_start: Failed to get NX handle: %d\n", errno);
+ message("nxcon_main: Failed to get NX handle: %d\n", errno);
goto errout;
}
/* Set the background to the configured background color */
- message("user_start: Set background color=%d\n", CONFIG_EXAMPLES_NXCON_BGCOLOR);
+ message("nxcon_main: Set background color=%d\n", CONFIG_EXAMPLES_NXCON_BGCOLOR);
color = CONFIG_EXAMPLES_NXCON_BGCOLOR;
ret = nx_setbgcolor(g_nxcon_vars.hnx, &color);
if (ret < 0)
{
- message("user_start: nx_setbgcolor failed: %d\n", errno);
+ message("nxcon_main: nx_setbgcolor failed: %d\n", errno);
goto errout_with_nx;
}
/* Window Configuration ***************************************************/
/* Create a window */
- message("user_start: Create window\n");
+ message("nxcon_main: Create window\n");
g_nxcon_vars.hwnd = nxtk_openwindow(g_nxcon_vars.hnx, &g_nxconcb, NULL);
if (!g_nxcon_vars.hwnd)
{
- message("user_start: nxtk_openwindow failed: %d\n", errno);
+ message("nxcon_main: nxtk_openwindow failed: %d\n", errno);
goto errout_with_nx;
}
- message("user_start: hwnd=%p\n", g_nxcon_vars.hwnd);
+ message("nxcon_main: hwnd=%p\n", g_nxcon_vars.hwnd);
/* Wait until we have the screen resolution. We'll have this immediately
* unless we are dealing with the NX server.
@@ -292,7 +292,7 @@ int user_start(int argc, char **argv)
{
(void)sem_wait(&g_nxcon_vars.eventsem);
}
- message("user_start: Screen resolution (%d,%d)\n", g_nxcon_vars.xres, g_nxcon_vars.yres);
+ message("nxcon_main: Screen resolution (%d,%d)\n", g_nxcon_vars.xres, g_nxcon_vars.yres);
/* Determine the size and position of the window */
@@ -304,35 +304,35 @@ int user_start(int argc, char **argv)
/* Set the window position */
- message("user_start: Set window position to (%d,%d)\n",
+ message("nxcon_main: Set window position to (%d,%d)\n",
g_nxcon_vars.wpos.x, g_nxcon_vars.wpos.y);
ret = nxtk_setposition(g_nxcon_vars.hwnd, &g_nxcon_vars.wpos);
if (ret < 0)
{
- message("user_start: nxtk_setposition failed: %d\n", errno);
+ message("nxcon_main: nxtk_setposition failed: %d\n", errno);
goto errout_with_hwnd;
}
/* Set the window size */
- message("user_start: Set window size to (%d,%d)\n",
+ message("nxcon_main: Set window size to (%d,%d)\n",
g_nxcon_vars.wndo.wsize.w, g_nxcon_vars.wndo.wsize.h);
ret = nxtk_setsize(g_nxcon_vars.hwnd, &g_nxcon_vars.wndo.wsize);
if (ret < 0)
{
- message("user_start: nxtk_setsize failed: %d\n", errno);
+ message("nxcon_main: nxtk_setsize failed: %d\n", errno);
goto errout_with_hwnd;
}
/* Open the toolbar */
- message("user_start: Add toolbar to window\n");
+ message("nxcon_main: Add toolbar to window\n");
ret = nxtk_opentoolbar(g_nxcon_vars.hwnd, CONFIG_EXAMPLES_NXCON_TOOLBAR_HEIGHT, &g_nxtoolcb, NULL);
if (ret < 0)
{
- message("user_start: nxtk_opentoolbar failed: %d\n", errno);
+ message("nxcon_main: nxtk_opentoolbar failed: %d\n", errno);
goto errout_with_hwnd;
}
@@ -350,7 +350,7 @@ int user_start(int argc, char **argv)
g_nxcon_vars.hdrvr = nxtk_register(g_nxcon_vars.hwnd, &g_nxcon_vars.wndo, CONFIG_EXAMPLES_NXCON_MINOR);
if (!g_nxcon_vars.hdrvr)
{
- message("user_start: nxtk_register failed: %d\n", errno);
+ message("nxcon_main: nxtk_register failed: %d\n", errno);
goto errout_with_hwnd;
}
@@ -359,7 +359,7 @@ int user_start(int argc, char **argv)
fd = open(CONFIG_EXAMPLES_NXCON_DEVNAME, O_WRONLY);
if (fd < 0)
{
- message("user_start: open %s read-only failed: %d\n",
+ message("nxcon_main: open %s read-only failed: %d\n",
CONFIG_EXAMPLES_NXCON_DEVNAME, errno);
goto errout_with_driver;
}
@@ -369,7 +369,7 @@ int user_start(int argc, char **argv)
* Note that stdin is retained (file descriptor 0, probably the the serial console).
*/
- message("user_start: Starting the console task\n");
+ message("nxcon_main: Starting the console task\n");
msgflush();
(void)fflush(stdout);
diff --git a/apps/examples/nxffs/nxffs_main.c b/apps/examples/nxffs/nxffs_main.c
index bc28cfa737..5401fc932c 100644
--- a/apps/examples/nxffs/nxffs_main.c
+++ b/apps/examples/nxffs/nxffs_main.c
@@ -789,10 +789,10 @@ static int nxffs_directory(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: nxffs_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int nxffs_main(int argc, char *argv[])
{
FAR struct mtd_dev_s *mtd;
unsigned int i;
diff --git a/apps/examples/nxflat/nxflat_main.c b/apps/examples/nxflat/nxflat_main.c
index 12d88c3d5c..68c2979da6 100644
--- a/apps/examples/nxflat/nxflat_main.c
+++ b/apps/examples/nxflat/nxflat_main.c
@@ -145,10 +145,10 @@ static inline void testheader(FAR const char *progname)
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: nxflat_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int nxflat_main(int argc, char *argv[])
{
struct binary_s bin;
int ret;
diff --git a/apps/examples/nxhello/nxhello_main.c b/apps/examples/nxhello/nxhello_main.c
index cf8373856b..02344a45e2 100644
--- a/apps/examples/nxhello/nxhello_main.c
+++ b/apps/examples/nxhello/nxhello_main.c
@@ -203,18 +203,10 @@ static inline int nxhello_initialize(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start/nxhello_main
+ * Name: nxhello_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_NXHELLO_BUILTIN
-# define MAIN_NAME nxhello_main
-# define MAIN_NAME_STRING "nxhello_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int nxhello_main(int argc, char *argv[])
{
nxgl_mxpixel_t color;
int ret;
@@ -222,10 +214,10 @@ int MAIN_NAME(int argc, char *argv[])
/* Initialize NX */
ret = nxhello_initialize();
- message(MAIN_NAME_STRING ": NX handle=%p\n", g_nxhello.hnx);
+ message("nxhello_main: NX handle=%p\n", g_nxhello.hnx);
if (!g_nxhello.hnx || ret < 0)
{
- message(MAIN_NAME_STRING ": Failed to get NX handle: %d\n", errno);
+ message("nxhello_main: Failed to get NX handle: %d\n", errno);
g_nxhello.code = NXEXIT_NXOPEN;
goto errout;
}
@@ -235,21 +227,21 @@ int MAIN_NAME(int argc, char *argv[])
g_nxhello.hfont = nxf_getfonthandle(CONFIG_EXAMPLES_NXHELLO_FONTID);
if (!g_nxhello.hfont)
{
- message(MAIN_NAME_STRING ": Failed to get font handle: %d\n", errno);
+ message("nxhello_main: Failed to get font handle: %d\n", errno);
g_nxhello.code = NXEXIT_FONTOPEN;
goto errout;
}
/* Set the background to the configured background color */
- message(MAIN_NAME_STRING ": Set background color=%d\n",
+ message("nxhello_main: Set background color=%d\n",
CONFIG_EXAMPLES_NXHELLO_BGCOLOR);
color = CONFIG_EXAMPLES_NXHELLO_BGCOLOR;
ret = nx_setbgcolor(g_nxhello.hnx, &color);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxhello_main: nx_setbgcolor failed: %d\n", errno);
g_nxhello.code = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -259,7 +251,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = nx_requestbkgd(g_nxhello.hnx, &g_nxhellocb, NULL);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxhello_main: nx_setbgcolor failed: %d\n", errno);
g_nxhello.code = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -272,7 +264,7 @@ int MAIN_NAME(int argc, char *argv[])
{
(void)sem_wait(&g_nxhello.sem);
}
- message(MAIN_NAME_STRING ": Screen resolution (%d,%d)\n", g_nxhello.xres, g_nxhello.yres);
+ message("nxhello_main: Screen resolution (%d,%d)\n", g_nxhello.xres, g_nxhello.yres);
/* Now, say hello and exit, sleeping a little before each. */
@@ -287,7 +279,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Close NX */
errout_with_nx:
- message(MAIN_NAME_STRING ": Close NX\n");
+ message("nxhello_main: Close NX\n");
nx_close(g_nxhello.hnx);
errout:
return g_nxhello.code;
diff --git a/apps/examples/nximage/nximage_main.c b/apps/examples/nximage/nximage_main.c
index 861cf0e61e..5b0249605a 100644
--- a/apps/examples/nximage/nximage_main.c
+++ b/apps/examples/nximage/nximage_main.c
@@ -207,22 +207,14 @@ static inline int nximage_initialize(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start/nximage_main
+ * Name: nximage_main
*
* Description:
* Main entry pointer. Configures the basic display resources.
*
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_NXIMAGE_BUILTIN
-# define MAIN_NAME nximage_main
-# define MAIN_NAME_STRING "nximage_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int nximage_main(int argc, char *argv[])
{
nxgl_mxpixel_t color;
int ret;
@@ -230,10 +222,10 @@ int MAIN_NAME(int argc, char *argv[])
/* Initialize NX */
ret = nximage_initialize();
- message(MAIN_NAME_STRING ": NX handle=%p\n", g_nximage.hnx);
+ message("nximage_main: NX handle=%p\n", g_nximage.hnx);
if (!g_nximage.hnx || ret < 0)
{
- message(MAIN_NAME_STRING ": Failed to get NX handle: %d\n", errno);
+ message("nximage_main: Failed to get NX handle: %d\n", errno);
g_nximage.code = NXEXIT_NXOPEN;
goto errout;
}
@@ -241,12 +233,12 @@ int MAIN_NAME(int argc, char *argv[])
/* Set the background to the configured background color */
color = nximage_bgcolor();
- message(MAIN_NAME_STRING ": Set background color=%d\n", color);
+ message("nximage_main: Set background color=%d\n", color);
ret = nx_setbgcolor(g_nximage.hnx, &color);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nximage_main: nx_setbgcolor failed: %d\n", errno);
g_nximage.code = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -256,7 +248,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = nx_requestbkgd(g_nximage.hnx, &g_nximagecb, NULL);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nximage_main: nx_setbgcolor failed: %d\n", errno);
g_nximage.code = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -269,7 +261,7 @@ int MAIN_NAME(int argc, char *argv[])
{
(void)sem_wait(&g_nximage.sem);
}
- message(MAIN_NAME_STRING ": Screen resolution (%d,%d)\n", g_nximage.xres, g_nximage.yres);
+ message("nximage_main: Screen resolution (%d,%d)\n", g_nximage.xres, g_nximage.yres);
/* Now, put up the NuttX logo. */
@@ -282,7 +274,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Close NX */
errout_with_nx:
- message(MAIN_NAME_STRING ": Close NX\n");
+ message("nximage_main: Close NX\n");
nx_close(g_nximage.hnx);
errout:
return g_nximage.code;
diff --git a/apps/examples/nxlines/nxlines_main.c b/apps/examples/nxlines/nxlines_main.c
index df946b8685..331fab6317 100644
--- a/apps/examples/nxlines/nxlines_main.c
+++ b/apps/examples/nxlines/nxlines_main.c
@@ -199,18 +199,10 @@ static inline int nxlines_initialize(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start/nxlines_main
+ * Name: nxlines_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_NXLINES_BUILTIN
-# define MAIN_NAME nxlines_main
-# define MAIN_NAME_STRING "nxlines_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int nxlines_main(int argc, char *argv[])
{
nxgl_mxpixel_t color;
int ret;
@@ -218,24 +210,24 @@ int MAIN_NAME(int argc, char *argv[])
/* Initialize NX */
ret = nxlines_initialize();
- message(MAIN_NAME_STRING ": NX handle=%p\n", g_nxlines.hnx);
+ message("nxlines_main: NX handle=%p\n", g_nxlines.hnx);
if (!g_nxlines.hnx || ret < 0)
{
- message(MAIN_NAME_STRING ": Failed to get NX handle: %d\n", errno);
+ message("nxlines_main: Failed to get NX handle: %d\n", errno);
g_nxlines.code = NXEXIT_NXOPEN;
goto errout;
}
/* Set the background to the configured background color */
- message(MAIN_NAME_STRING ": Set background color=%d\n",
+ message("nxlines_main: Set background color=%d\n",
CONFIG_EXAMPLES_NXLINES_BGCOLOR);
color = CONFIG_EXAMPLES_NXLINES_BGCOLOR;
ret = nx_setbgcolor(g_nxlines.hnx, &color);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxlines_main: nx_setbgcolor failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -245,7 +237,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = nx_requestbkgd(g_nxlines.hnx, &g_nxlinescb, NULL);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxlines_main: nx_setbgcolor failed: %d\n", errno);
g_nxlines.code = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -258,7 +250,7 @@ int MAIN_NAME(int argc, char *argv[])
{
(void)sem_wait(&g_nxlines.sem);
}
- message(MAIN_NAME_STRING ": Screen resolution (%d,%d)\n", g_nxlines.xres, g_nxlines.yres);
+ message("nxlines_main: Screen resolution (%d,%d)\n", g_nxlines.xres, g_nxlines.yres);
/* Now, say perform the lines (these test does not return so the remaining
* logic is cosmetic).
@@ -273,7 +265,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Close NX */
errout_with_nx:
- message(MAIN_NAME_STRING ": Close NX\n");
+ message("nxlines_main: Close NX\n");
nx_close(g_nxlines.hnx);
errout:
return g_nxlines.code;
diff --git a/apps/examples/nxtext/nxtext_main.c b/apps/examples/nxtext/nxtext_main.c
index 437b03e5a2..9a4b8eea49 100644
--- a/apps/examples/nxtext/nxtext_main.c
+++ b/apps/examples/nxtext/nxtext_main.c
@@ -345,18 +345,10 @@ static int nxtext_initialize(void)
****************************************************************************/
/****************************************************************************
- * Name: user_start/nxtext_main
+ * Name: nxtext_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_NXTEXT_BUILTIN
-# define MAIN_NAME nxtext_main
-# define MAIN_NAME_STRING "nxtext_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char **argv)
+int nxtext_main(int argc, char **argv)
{
FAR struct nxtext_state_s *bgstate;
NXWINDOW hwnd = NULL;
@@ -368,10 +360,10 @@ int MAIN_NAME(int argc, char **argv)
/* Initialize NX */
ret = nxtext_initialize();
- message(MAIN_NAME_STRING ": NX handle=%p\n", g_hnx);
+ message("nxtext_main: NX handle=%p\n", g_hnx);
if (!g_hnx || ret < 0)
{
- message(MAIN_NAME_STRING ": Failed to get NX handle: %d\n", errno);
+ message("nxtext_main: Failed to get NX handle: %d\n", errno);
g_exitcode = NXEXIT_NXOPEN;
goto errout;
}
@@ -381,7 +373,7 @@ int MAIN_NAME(int argc, char **argv)
g_bghfont = nxf_getfonthandle(CONFIG_EXAMPLES_NXTEXT_BGFONTID);
if (!g_bghfont)
{
- message(MAIN_NAME_STRING ": Failed to get background font handle: %d\n", errno);
+ message("nxtext_main: Failed to get background font handle: %d\n", errno);
g_exitcode = NXEXIT_FONTOPEN;
goto errout;
}
@@ -389,19 +381,19 @@ int MAIN_NAME(int argc, char **argv)
g_puhfont = nxf_getfonthandle(CONFIG_EXAMPLES_NXTEXT_PUFONTID);
if (!g_puhfont)
{
- message(MAIN_NAME_STRING ": Failed to get pop-up font handle: %d\n", errno);
+ message("nxtext_main: Failed to get pop-up font handle: %d\n", errno);
g_exitcode = NXEXIT_FONTOPEN;
goto errout;
}
/* Set the background to the configured background color */
- message(MAIN_NAME_STRING ": Set background color=%d\n", CONFIG_EXAMPLES_NXTEXT_BGCOLOR);
+ message("nxtext_main: Set background color=%d\n", CONFIG_EXAMPLES_NXTEXT_BGCOLOR);
color = CONFIG_EXAMPLES_NXTEXT_BGCOLOR;
ret = nx_setbgcolor(g_hnx, &color);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxtext_main: nx_setbgcolor failed: %d\n", errno);
g_exitcode = NXEXIT_NXSETBGCOLOR;
goto errout_with_nx;
}
@@ -412,7 +404,7 @@ int MAIN_NAME(int argc, char **argv)
ret = nx_requestbkgd(g_hnx, &g_nxtextcb, bgstate);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_setbgcolor failed: %d\n", errno);
+ message("nxtext_main: nx_setbgcolor failed: %d\n", errno);
g_exitcode = NXEXIT_NXREQUESTBKGD;
goto errout_with_nx;
}
@@ -425,7 +417,7 @@ int MAIN_NAME(int argc, char **argv)
{
(void)sem_wait(&g_semevent);
}
- message(MAIN_NAME_STRING ": Screen resolution (%d,%d)\n", g_xres, g_yres);
+ message("nxtext_main: Screen resolution (%d,%d)\n", g_xres, g_yres);
/* Now loop, adding text to the background and periodically presenting
* a pop-up window.
@@ -453,11 +445,11 @@ int MAIN_NAME(int argc, char **argv)
/* Give keyboard input to the top window (which should be the pop-up) */
#ifdef CONFIG_NX_KBD
- message(MAIN_NAME_STRING ": Send keyboard input: %s\n", g_pumsg);
+ message("nxtext_main: Send keyboard input: %s\n", g_pumsg);
ret = nx_kbdin(g_hnx, strlen((FAR const char *)g_pumsg), g_pumsg);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": nx_kbdin failed: %d\n", errno);
+ message("nxtext_main: nx_kbdin failed: %d\n", errno);
goto errout_with_hwnd;
}
#endif
@@ -466,7 +458,7 @@ int MAIN_NAME(int argc, char **argv)
{
/* Destroy the pop-up window and restart the sequence */
- message(MAIN_NAME_STRING ": Close pop-up\n");
+ message("nxtext_main: Close pop-up\n");
(void)nxpu_close(hwnd);
popcnt = 0;
}
@@ -488,7 +480,7 @@ int MAIN_NAME(int argc, char **argv)
errout_with_hwnd:
if (popcnt >= 3)
{
- message(MAIN_NAME_STRING ": Close pop-up\n");
+ message("nxtext_main: Close pop-up\n");
(void)nxpu_close(hwnd);
}
@@ -499,12 +491,12 @@ errout_with_nx:
#ifdef CONFIG_NX_MULTIUSER
/* Disconnect from the server */
- message(MAIN_NAME_STRING ": Disconnect from the server\n");
+ message("nxtext_main: Disconnect from the server\n");
nx_disconnect(g_hnx);
#else
/* Close the server */
- message(MAIN_NAME_STRING ": Close NX\n");
+ message("nxtext_main: Close NX\n");
nx_close(g_hnx);
#endif
errout:
diff --git a/apps/examples/ostest/main.c b/apps/examples/ostest/main.c
index 7d63c0ff48..61a2af19a6 100644
--- a/apps/examples/ostest/main.c
+++ b/apps/examples/ostest/main.c
@@ -409,7 +409,7 @@ static int user_main(int argc, char *argv[])
check_test_memory_usage();
#endif /* CONFIG_PRIORITY_INHERITANCE && !CONFIG_DISABLE_SIGNALS && !CONFIG_DISABLE_PTHREAD */
- /* Compare memory usage at time user_start started until
+ /* Compare memory usage at time ostest_main started until
* user_main exits. These should not be identical, but should
* be similar enough that we can detect any serious OS memory
* leaks.
@@ -458,18 +458,10 @@ static void stdio_test(void)
****************************************************************************/
/****************************************************************************
- * user_start/ostest_main
+ * ostest_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_OSTEST_BUILTIN
-# define MAIN_NAME ostest_main
-# define MAIN_STRING "ostest_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int ostest_main(int argc, char *argv[])
{
int result;
@@ -492,19 +484,19 @@ int MAIN_NAME(int argc, char *argv[])
/* Set up some environment variables */
#ifndef CONFIG_DISABLE_ENVIRON
- printf(MAIN_STRING "putenv(%s)\n", g_putenv_value);
+ printf("ostest_main: putenv(%s)\n", g_putenv_value);
putenv(g_putenv_value); /* Varaible1=BadValue3 */
- printf(MAIN_STRING "setenv(%s, %s, TRUE)\n", g_var1_name, g_var1_value);
+ printf("ostest_main: setenv(%s, %s, TRUE)\n", g_var1_name, g_var1_value);
setenv(g_var1_name, g_var1_value, TRUE); /* Variable1=GoodValue1 */
- printf(MAIN_STRING "setenv(%s, %s, FALSE)\n", g_var2_name, g_bad_value1);
+ printf("ostest_main: setenv(%s, %s, FALSE)\n", g_var2_name, g_bad_value1);
setenv(g_var2_name, g_bad_value1, FALSE); /* Variable2=BadValue1 */
- printf(MAIN_STRING "setenv(%s, %s, TRUE)\n", g_var2_name, g_var2_value);
+ printf("ostest_main: setenv(%s, %s, TRUE)\n", g_var2_name, g_var2_value);
setenv(g_var2_name, g_var2_value, TRUE); /* Variable2=GoodValue2 */
- printf(MAIN_STRING "setenv(%s, %s, FALSE)\n", g_var3_name, g_var3_name);
+ printf("ostest_main: setenv(%s, %s, FALSE)\n", g_var3_name, g_var3_name);
setenv(g_var3_name, g_var3_value, FALSE); /* Variable3=GoodValue3 */
- printf(MAIN_STRING "setenv(%s, %s, FALSE)\n", g_var3_name, g_var3_name);
+ printf("ostest_main: setenv(%s, %s, FALSE)\n", g_var3_name, g_var3_name);
setenv(g_var3_name, g_bad_value2, FALSE); /* Variable3=GoodValue3 */
show_environment(true, true, true);
#endif
@@ -518,13 +510,13 @@ int MAIN_NAME(int argc, char *argv[])
#endif
if (result == ERROR)
{
- printf(MAIN_STRING "ERROR Failed to start user_main\n");
+ printf("ostest_main: ERROR Failed to start user_main\n");
}
else
{
- printf(MAIN_STRING "Started user_main at PID=%d\n", result);
+ printf("ostest_main: Started user_main at PID=%d\n", result);
}
- printf(MAIN_STRING "Exitting\n");
+ printf("ostest_main: Exitting\n");
return 0;
}
diff --git a/apps/examples/pashello/pashello.c b/apps/examples/pashello/pashello.c
index ae19c94f55..5e2fe8bf33 100644
--- a/apps/examples/pashello/pashello.c
+++ b/apps/examples/pashello/pashello.c
@@ -99,10 +99,10 @@ static void prun(FAR struct pexec_s *st)
****************************************************************************/
/****************************************************************************
- * user_start
+ * pashello_main
****************************************************************************/
-int user_start(int argc, FAR char *argv[])
+int pashello_main(int argc, FAR char *argv[])
{
FAR struct pexec_s *st;
@@ -115,11 +115,11 @@ int user_start(int argc, FAR char *argv[])
st = pload("/dev/hello", CONFIG_PASHELLO_VARSTACKSIZE, CONFIG_PASHELLO_STRSTACKSIZE);
if (!st)
{
- fprintf(stderr, "user_start: ERROR: Could not load /dev/hello\n");
+ fprintf(stderr, "pashello_main: ERROR: Could not load /dev/hello\n");
exit(1);
}
- printf("user_start: /dev/hello Loaded\n");
- printf("user_start: Interpreter started:\n");
+ printf("pashello_main: /dev/hello Loaded\n");
+ printf("pashello_main: Interpreter started:\n");
/* And start program execution */
@@ -127,7 +127,7 @@ int user_start(int argc, FAR char *argv[])
/* Clean up resources used by the interpreter */
- printf("user_start: Interpreter terminated");
+ printf("pashello_main: Interpreter terminated");
pexec_release(st);
return 0;
}
diff --git a/apps/examples/pipe/pipe_main.c b/apps/examples/pipe/pipe_main.c
index 1f0f73032a..406832a98a 100644
--- a/apps/examples/pipe/pipe_main.c
+++ b/apps/examples/pipe/pipe_main.c
@@ -69,21 +69,21 @@
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: pipe_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int pipe_main(int argc, char *argv[])
{
int filedes[2];
int ret;
/* Test FIFO logic */
- printf("\nuser_start: Performing FIFO test\n");
+ printf("\npipe_main: Performing FIFO test\n");
ret = mkfifo(FIFO_PATH1, 0666);
if (ret < 0)
{
- fprintf(stderr, "user_start: mkfifo failed with errno=%d\n", errno);
+ fprintf(stderr, "pipe_main: mkfifo failed with errno=%d\n", errno);
return 1;
}
@@ -96,7 +96,7 @@ int user_start(int argc, char *argv[])
filedes[1] = open(FIFO_PATH1, O_WRONLY);
if (filedes[1] < 0)
{
- fprintf(stderr, "user_start: Failed to open FIFO %s for writing, errno=%d\n",
+ fprintf(stderr, "pipe_main: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH1, errno);
return 2;
}
@@ -104,11 +104,11 @@ int user_start(int argc, char *argv[])
filedes[0] = open(FIFO_PATH1, O_RDONLY);
if (filedes[0] < 0)
{
- fprintf(stderr, "user_start: Failed to open FIFO %s for reading, errno=%d\n",
+ fprintf(stderr, "pipe_main: Failed to open FIFO %s for reading, errno=%d\n",
FIFO_PATH1, errno);
if (close(filedes[1]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
return 3;
}
@@ -118,28 +118,28 @@ int user_start(int argc, char *argv[])
ret = transfer_test(filedes[0], filedes[1]);
if (close(filedes[0]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
if (close(filedes[1]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
/* unlink(FIFO_PATH1); fails */
if (ret != 0)
{
- fprintf(stderr, "user_start: FIFO test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: FIFO test FAILED (%d)\n", ret);
return 4;
}
- printf("user_start: FIFO test PASSED\n");
+ printf("pipe_main: FIFO test PASSED\n");
/* Test PIPE logic */
- printf("\nuser_start: Performing pipe test\n");
+ printf("\npipe_main: Performing pipe test\n");
ret = pipe(filedes);
if (ret < 0)
{
- fprintf(stderr, "user_start: pipe failed with errno=%d\n", errno);
+ fprintf(stderr, "pipe_main: pipe failed with errno=%d\n", errno);
return 5;
}
@@ -148,41 +148,41 @@ int user_start(int argc, char *argv[])
ret = transfer_test(filedes[0], filedes[1]);
if (close(filedes[0]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
if (close(filedes[1]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
if (ret != 0)
{
- fprintf(stderr, "user_start: PIPE test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: PIPE test FAILED (%d)\n", ret);
return 6;
}
- printf("user_start: PIPE test PASSED\n");
+ printf("pipe_main: PIPE test PASSED\n");
/* Perform the FIFO interlock test */
- printf("\nuser_start: Performing pipe interlock test\n");
+ printf("\npipe_main: Performing pipe interlock test\n");
ret = interlock_test();
if (ret != 0)
{
- fprintf(stderr, "user_start: FIFO interlock test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: FIFO interlock test FAILED (%d)\n", ret);
return 7;
}
- printf("user_start: PIPE interlock test PASSED\n");
+ printf("pipe_main: PIPE interlock test PASSED\n");
/* Perform the pipe redirection test */
- printf("\nuser_start: Performing redirection test\n");
+ printf("\npipe_main: Performing redirection test\n");
ret = redirection_test();
if (ret != 0)
{
- fprintf(stderr, "user_start: FIFO redirection test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: FIFO redirection test FAILED (%d)\n", ret);
return 7;
}
- printf("user_start: PIPE redirection test PASSED\n");
+ printf("pipe_main: PIPE redirection test PASSED\n");
fflush(stdout);
return 0;
diff --git a/apps/examples/pipe/redirect_test.c b/apps/examples/pipe/redirect_test.c
index 45e86c3560..db7c0b99a3 100644
--- a/apps/examples/pipe/redirect_test.c
+++ b/apps/examples/pipe/redirect_test.c
@@ -301,16 +301,16 @@ int redirection_test(void)
if (close(filedes[0]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
if (close(filedes[1]) != 0)
{
- fprintf(stderr, "user_start: close failed: %d\n", errno);
+ fprintf(stderr, "pipe_main: close failed: %d\n", errno);
}
if (ret != 0)
{
- fprintf(stderr, "user_start: PIPE test FAILED (%d)\n", ret);
+ fprintf(stderr, "pipe_main: PIPE test FAILED (%d)\n", ret);
return 6;
}
diff --git a/apps/examples/poll/poll_main.c b/apps/examples/poll/poll_main.c
index 3db0150e77..9c3a096cba 100644
--- a/apps/examples/poll/poll_main.c
+++ b/apps/examples/poll/poll_main.c
@@ -74,10 +74,10 @@
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: poll_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int poll_main(int argc, char *argv[])
{
char buffer[64];
ssize_t nbytes;
@@ -94,20 +94,20 @@ int user_start(int argc, char *argv[])
/* Open FIFOs */
- message("\nuser_start: Creating FIFO %s\n", FIFO_PATH1);
+ message("\npoll_main: Creating FIFO %s\n", FIFO_PATH1);
ret = mkfifo(FIFO_PATH1, 0666);
if (ret < 0)
{
- message("user_start: mkfifo failed: %d\n", errno);
+ message("poll_main: mkfifo failed: %d\n", errno);
exitcode = 1;
goto errout;
}
- message("\nuser_start: Creating FIFO %s\n", FIFO_PATH2);
+ message("\npoll_main: Creating FIFO %s\n", FIFO_PATH2);
ret = mkfifo(FIFO_PATH2, 0666);
if (ret < 0)
{
- message("user_start: mkfifo failed: %d\n", errno);
+ message("poll_main: mkfifo failed: %d\n", errno);
exitcode = 2;
goto errout;
}
@@ -117,7 +117,7 @@ int user_start(int argc, char *argv[])
fd1 = open(FIFO_PATH1, O_WRONLY);
if (fd1 < 0)
{
- message("user_start: Failed to open FIFO %s for writing, errno=%d\n",
+ message("poll_main: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH1, errno);
exitcode = 3;
goto errout;
@@ -126,7 +126,7 @@ int user_start(int argc, char *argv[])
fd2 = open(FIFO_PATH2, O_WRONLY);
if (fd2 < 0)
{
- message("user_start: Failed to open FIFO %s for writing, errno=%d\n",
+ message("poll_main: Failed to open FIFO %s for writing, errno=%d\n",
FIFO_PATH2, errno);
exitcode = 4;
goto errout;
@@ -134,39 +134,39 @@ int user_start(int argc, char *argv[])
/* Start the listeners */
- message("user_start: Starting poll_listener thread\n");
+ message("poll_main: Starting poll_listener thread\n");
ret = pthread_create(&tid1, NULL, poll_listener, NULL);
if (ret != 0)
{
- message("user_start: Failed to create poll_listener thread: %d\n", ret);
+ message("poll_main: Failed to create poll_listener thread: %d\n", ret);
exitcode = 5;
goto errout;
}
- message("user_start: Starting select_listener thread\n");
+ message("poll_main: Starting select_listener thread\n");
ret = pthread_create(&tid2, NULL, select_listener, NULL);
if (ret != 0)
{
- message("user_start: Failed to create select_listener thread: %d\n", ret);
+ message("poll_main: Failed to create select_listener thread: %d\n", ret);
exitcode = 6;
goto errout;
}
#ifdef HAVE_NETPOLL
#ifdef CONFIG_NET_TCPBACKLOG
- message("user_start: Starting net_listener thread\n");
+ message("poll_main: Starting net_listener thread\n");
ret = pthread_create(&tid3, NULL, net_listener, NULL);
#else
- message("user_start: Starting net_reader thread\n");
+ message("poll_main: Starting net_reader thread\n");
ret = pthread_create(&tid3, NULL, net_reader, NULL);
#endif
if (ret != 0)
{
- message("user_start: Failed to create net_listener thread: %d\n", ret);
+ message("poll_main: Failed to create net_listener thread: %d\n", ret);
}
#endif
@@ -182,7 +182,7 @@ int user_start(int argc, char *argv[])
nbytes = write(fd1, buffer, strlen(buffer));
if (nbytes < 0)
{
- message("user_start: Write to fd1 failed: %d\n", errno);
+ message("poll_main: Write to fd1 failed: %d\n", errno);
exitcode = 7;
goto errout;
}
@@ -190,12 +190,12 @@ int user_start(int argc, char *argv[])
nbytes = write(fd2, buffer, strlen(buffer));
if (nbytes < 0)
{
- message("user_start: Write fd2 failed: %d\n", errno);
+ message("poll_main: Write fd2 failed: %d\n", errno);
exitcode = 8;
goto errout;
}
- message("\nuser_start: Sent '%s' (%d bytes)\n", buffer, nbytes);
+ message("\npoll_main: Sent '%s' (%d bytes)\n", buffer, nbytes);
msgflush();
/* Wait awhile. This delay should be long enough that the
diff --git a/apps/examples/pwm/pwm_main.c b/apps/examples/pwm/pwm_main.c
index 64c5dfb2c0..775bdba6b1 100644
--- a/apps/examples/pwm/pwm_main.c
+++ b/apps/examples/pwm/pwm_main.c
@@ -269,7 +269,7 @@ static void parse_args(FAR struct pwm_state_s *pwm, int argc, FAR char **argv)
****************************************************************************/
/****************************************************************************
- * Name: user_start/pwm_main
+ * Name: pwm_main
****************************************************************************/
int pwm_main(int argc, char *argv[])
diff --git a/apps/examples/qencoder/qe_main.c b/apps/examples/qencoder/qe_main.c
index c58a2b0ada..8c185ea1b7 100644
--- a/apps/examples/qencoder/qe_main.c
+++ b/apps/examples/qencoder/qe_main.c
@@ -59,14 +59,6 @@
* Pre-processor Definitions
****************************************************************************/
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME qe_main
-# define MAIN_STRING "qe_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
@@ -245,10 +237,10 @@ static void parse_args(int argc, FAR char **argv)
****************************************************************************/
/****************************************************************************
- * Name: user_start/qe_main
+ * Name: qe_main
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int qe_main(int argc, char *argv[])
{
int32_t position;
int fd;
@@ -266,11 +258,11 @@ int MAIN_NAME(int argc, char *argv[])
* this test.
*/
- message(MAIN_STRING "Initializing external encoder(s)\n");
+ message("qe_main: Initializing external encoder(s)\n");
ret = qe_devinit();
if (ret != OK)
{
- message(MAIN_STRING "qe_devinit failed: %d\n", ret);
+ message("qe_main: qe_devinit failed: %d\n", ret);
exitval = EXIT_FAILURE;
goto errout;
}
@@ -289,13 +281,13 @@ int MAIN_NAME(int argc, char *argv[])
/* Open the encoder device for reading */
- message(MAIN_STRING "Hardware initialized. Opening the encoder device: %s\n",
+ message("qe_main: Hardware initialized. Opening the encoder device: %s\n",
g_qeexample.devpath);
fd = open(g_qeexample.devpath, O_RDONLY);
if (fd < 0)
{
- message(MAIN_STRING "open %s failed: %d\n", g_qeexample.devpath, errno);
+ message("qe_main: open %s failed: %d\n", g_qeexample.devpath, errno);
exitval = EXIT_FAILURE;
goto errout_with_dev;
}
@@ -304,11 +296,11 @@ int MAIN_NAME(int argc, char *argv[])
if (g_qeexample.reset)
{
- message(MAIN_STRING "Resetting the count...\n");
+ message("qe_main: Resetting the count...\n");
ret = ioctl(fd, QEIOC_RESET, 0);
if (ret < 0)
{
- message(MAIN_STRING "ioctl(QEIOC_RESET) failed: %d\n", errno);
+ message("qe_main: ioctl(QEIOC_RESET) failed: %d\n", errno);
exitval = EXIT_FAILURE;
goto errout_with_dev;
}
@@ -319,10 +311,10 @@ int MAIN_NAME(int argc, char *argv[])
*/
#if defined(CONFIG_NSH_BUILTIN_APPS)
- message(MAIN_STRING "Number of samples: %d\n", g_qeexample.nloops);
+ message("qe_main: Number of samples: %d\n", g_qeexample.nloops);
for (nloops = 0; nloops < g_qeexample.nloops; nloops++)
#elif defined(CONFIG_EXAMPLES_QENCODER_NSAMPLES)
- message(MAIN_STRING "Number of samples: %d\n", CONFIG_EXAMPLES_QENCODER_NSAMPLES);
+ message("qe_main: Number of samples: %d\n", CONFIG_EXAMPLES_QENCODER_NSAMPLES);
for (nloops = 0; nloops < CONFIG_EXAMPLES_QENCODER_NSAMPLES; nloops++)
#else
for (;;)
@@ -339,7 +331,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = ioctl(fd, QEIOC_POSITION, (unsigned long)((uintptr_t)&position));
if (ret < 0)
{
- message(MAIN_STRING "ioctl(QEIOC_POSITION) failed: %d\n", errno);
+ message("qe_main: ioctl(QEIOC_POSITION) failed: %d\n", errno);
exitval = EXIT_FAILURE;
goto errout_with_dev;
}
@@ -348,7 +340,7 @@ int MAIN_NAME(int argc, char *argv[])
else
{
- message(MAIN_STRING "%3d. %d\n", nloops+1, position);
+ message("qe_main: %3d. %d\n", nloops+1, position);
}
/* Delay a little bit */
diff --git a/apps/examples/rgmp/main.c b/apps/examples/rgmp/main.c
index ec6450c50f..a1fa6cdc39 100644
--- a/apps/examples/rgmp/main.c
+++ b/apps/examples/rgmp/main.c
@@ -54,10 +54,10 @@
****************************************************************************/
/****************************************************************************
- * user_start
+ * rgmp_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int rgmp_main(int argc, char *argv[])
{
// TODO: add your code here
diff --git a/apps/examples/romfs/romfs_main.c b/apps/examples/romfs/romfs_main.c
index 32b3d2654b..4870ff4f81 100644
--- a/apps/examples/romfs/romfs_main.c
+++ b/apps/examples/romfs/romfs_main.c
@@ -452,10 +452,10 @@ static void checkdirectories(struct node_s *entry)
****************************************************************************/
/****************************************************************************
- * Name: user_start
+ * Name: romfs_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int romfs_main(int argc, char *argv[])
{
int ret;
diff --git a/apps/examples/sendmail/target.c b/apps/examples/sendmail/target.c
index a614c40cbb..8440c78137 100644
--- a/apps/examples/sendmail/target.c
+++ b/apps/examples/sendmail/target.c
@@ -99,10 +99,10 @@ static const char g_msg_body[] = CONFIG_EXAMPLE_SENDMAIL_BODY "\r\n";
****************************************************************************/
/****************************************************************************
- * user_start
+ * sendmail_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int sendmail_main(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_SENDMAIL_NOMAC)
diff --git a/apps/examples/serloop/main.c b/apps/examples/serloop/main.c
index 3c635fe886..f0e3ac2387 100644
--- a/apps/examples/serloop/main.c
+++ b/apps/examples/serloop/main.c
@@ -56,10 +56,10 @@
****************************************************************************/
/****************************************************************************
- * user_start
+ * serloop_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int serloop_main(int argc, char *argv[])
{
#ifdef CONFIG_EXAMPLES_SERLOOP_BUFIO
int ch;
diff --git a/apps/examples/telnetd/shell.c b/apps/examples/telnetd/shell.c
index 01c620e1eb..3033698c5f 100644
--- a/apps/examples/telnetd/shell.c
+++ b/apps/examples/telnetd/shell.c
@@ -222,14 +222,14 @@ static void shell_netinit(void)
* Public Functions
****************************************************************************/
-int MAIN_NAME(int argc, char *argv[])
+int shell_main(int argc, char *argv[])
{
struct telnetd_config_s config;
int ret;
/* Configure the network */
- printf(MAIN_STRING "Initializing the network\n");
+ printf("shell_main: Initializing the network\n");
shell_netinit();
/* Configure the telnet daemon */
@@ -243,13 +243,13 @@ int MAIN_NAME(int argc, char *argv[])
/* Start the telnet daemon */
- printf(MAIN_STRING "Starting the Telnet daemon\n");
+ printf("shell_main: Starting the Telnet daemon\n");
ret = telnetd_start(&config);
if (ret < 0)
{
printf("Failed to tart the Telnet daemon\n");
}
- printf(MAIN_STRING "Exiting\n");
+ printf("shell_main: Exiting\n");
return 0;
}
diff --git a/apps/examples/telnetd/shell.h b/apps/examples/telnetd/shell.h
index 23b30fda7f..a5cec32b38 100644
--- a/apps/examples/telnetd/shell.h
+++ b/apps/examples/telnetd/shell.h
@@ -81,16 +81,6 @@
# define CONFIG_EXAMPLE_TELNETD_NETMASK 0xffffff00
#endif
-/* Is this being built as an NSH built-in application? */
-
-#ifdef CONFIG_NSH_BUILTIN_APPS
-# define MAIN_NAME shell_main
-# define MAIN_STRING "shell_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
/* Other definitions ********************************************************/
#define SHELL_PROMPT "uIP 1.0> "
diff --git a/apps/examples/thttpd/main.c b/apps/examples/thttpd/main.c
index ab69c60b21..4f8315d959 100644
--- a/apps/examples/thttpd/main.c
+++ b/apps/examples/thttpd/main.c
@@ -166,10 +166,10 @@ int g_thttpdnsymbols;
****************************************************************************/
/****************************************************************************
- * user_start
+ * thttp_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int thttp_main(int argc, char *argv[])
{
struct in_addr addr;
#ifdef CONFIG_EXAMPLE_THTTPD_NOMAC
diff --git a/apps/examples/tiff/tiff_main.c b/apps/examples/tiff/tiff_main.c
index d59f42cb4c..1be2b09c5e 100644
--- a/apps/examples/tiff/tiff_main.c
+++ b/apps/examples/tiff/tiff_main.c
@@ -98,20 +98,14 @@
****************************************************************************/
/****************************************************************************
- * Name: tiff_main/user_start
+ * Name: tiff_main
*
* Description:
* TIFF unit test.
*
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_TIFF_BUILTIN
-# define MAIN_NAME tiff_main
-#else
-# define MAIN_NAME user_start
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int tiff_main(int argc, char *argv[])
{
struct tiff_info_s info;
uint8_t strip[3*256];
diff --git a/apps/examples/touchscreen/tc_main.c b/apps/examples/touchscreen/tc_main.c
index 162025c790..76653bb8f7 100644
--- a/apps/examples/touchscreen/tc_main.c
+++ b/apps/examples/touchscreen/tc_main.c
@@ -81,18 +81,10 @@
****************************************************************************/
/****************************************************************************
- * Name: user_start/nxhello_main
+ * Name: tc_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_TOUCHSCREEN_BUILTIN
-# define MAIN_NAME tc_main
-# define MAIN_STRING "tc_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int tc_main(int argc, char *argv[])
{
struct touch_sample_s sample;
ssize_t nbytes;
@@ -113,31 +105,31 @@ int MAIN_NAME(int argc, char *argv[])
{
nsamples = strtol(argv[1], NULL, 10);
}
- message(MAIN_STRING "nsamples: %d\n", nsamples);
+ message("tc_main: nsamples: %d\n", nsamples);
#elif defined(CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES)
- message(MAIN_STRING "nsamples: %d\n", CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES);
+ message("tc_main: nsamples: %d\n", CONFIG_EXAMPLES_TOUCHSCREEN_NSAMPLES);
#endif
/* Initialization of the touchscreen hardware is performed by logic
* external to this test.
*/
- message(MAIN_STRING "Initializing external touchscreen device\n");
+ message("tc_main: Initializing external touchscreen device\n");
ret = arch_tcinitialize(CONFIG_EXAMPLES_TOUCHSCREEN_MINOR);
if (ret != OK)
{
- message(MAIN_STRING "arch_tcinitialize failed: %d\n", ret);
+ message("tc_main: arch_tcinitialize failed: %d\n", ret);
errval = 1;
goto errout;
}
/* Open the touchscreen device for reading */
- message(MAIN_STRING "Opening %s\n", CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH);
+ message("tc_main: Opening %s\n", CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH);
fd = open(CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH, O_RDONLY);
if (fd < 0)
{
- message(MAIN_STRING "open %s failed: %d\n",
+ message("tc_main: open %s failed: %d\n",
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH, errno);
errval = 2;
goto errout_with_tc;
@@ -174,17 +166,17 @@ int MAIN_NAME(int argc, char *argv[])
errval = errno;
if (errval != EINTR)
{
- message(MAIN_STRING "read %s failed: %d\n",
+ message("tc_main: read %s failed: %d\n",
CONFIG_EXAMPLES_TOUCHSCREEN_DEVPATH, errval);
errval = 3;
goto errout_with_dev;
}
- message(MAIN_STRING "Interrupted read...\n");
+ message("tc_main: Interrupted read...\n");
}
else if (nbytes != sizeof(struct touch_sample_s))
{
- message(MAIN_STRING "Unexpected read size=%d, expected=%d, Ignoring\n",
+ message("tc_main: Unexpected read size=%d, expected=%d, Ignoring\n",
nbytes, sizeof(struct touch_sample_s));
}
diff --git a/apps/examples/udp/target.c b/apps/examples/udp/target.c
index defbc7e057..ac3dc6ce85 100644
--- a/apps/examples/udp/target.c
+++ b/apps/examples/udp/target.c
@@ -59,10 +59,10 @@
****************************************************************************/
/****************************************************************************
- * user_start
+ * udp_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int udp_main(int argc, char *argv[])
{
struct in_addr addr;
diff --git a/apps/examples/uip/main.c b/apps/examples/uip/main.c
index 8712b9a28f..9593d4d25f 100644
--- a/apps/examples/uip/main.c
+++ b/apps/examples/uip/main.c
@@ -105,10 +105,10 @@
****************************************************************************/
/****************************************************************************
- * user_start
+ * uip_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int uip_main(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_UIP_DHCPC) || defined(CONFIG_EXAMPLE_UIP_NOMAC)
diff --git a/apps/examples/usbserial/main.c b/apps/examples/usbserial/main.c
index 4e59c1ece4..c73881a44d 100644
--- a/apps/examples/usbserial/main.c
+++ b/apps/examples/usbserial/main.c
@@ -198,10 +198,10 @@ static void dumptrace(void)
****************************************************************************/
/****************************************************************************
- * user_start
+ * usbserial_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int usbserial_main(int argc, char *argv[])
{
#ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY
int infd;
@@ -220,7 +220,7 @@ int user_start(int argc, char *argv[])
/* Initialize the USB serial driver */
- message("user_start: Registering USB serial driver\n");
+ message("usbserial_main: Registering USB serial driver\n");
#ifdef CONFIG_CDCACM
ret = cdcacm_initialize(0, NULL);
#else
@@ -228,10 +228,10 @@ int user_start(int argc, char *argv[])
#endif
if (ret < 0)
{
- message("user_start: ERROR: Failed to create the USB serial device: %d\n", -ret);
+ message("usbserial_main: ERROR: Failed to create the USB serial device: %d\n", -ret);
return 1;
}
- message("user_start: Successfully registered the serial driver\n");
+ message("usbserial_main: Successfully registered the serial driver\n");
#if CONFIG_USBDEV_TRACE && CONFIG_USBDEV_TRACE_INITIALIDSET != 0
/* If USB tracing is enabled and tracing of initial USB events is specified,
@@ -251,25 +251,25 @@ int user_start(int argc, char *argv[])
#ifndef CONFIG_EXAMPLES_USBSERIAL_OUTONLY
do
{
- message("user_start: Opening USB serial driver\n");
+ message("usbserial_main: Opening USB serial driver\n");
outfd = open(USBSER_DEVNAME, O_WRONLY);
if (outfd < 0)
{
int errcode = errno;
- message("user_start: ERROR: Failed to open " USBSER_DEVNAME " for writing: %d\n", errcode);
+ message("usbserial_main: ERROR: Failed to open " USBSER_DEVNAME " for writing: %d\n", errcode);
/* ENOTCONN means that the USB device is not yet connected */
if (errcode == ENOTCONN)
{
- message("user_start: Not connected. Wait and try again.\n");
+ message("usbserial_main: Not connected. Wait and try again.\n");
sleep(5);
}
else
{
/* Give up on other errors */
- message("user_start: Aborting\n");
+ message("usbserial_main: Aborting\n");
return 2;
}
}
@@ -288,7 +288,7 @@ int user_start(int argc, char *argv[])
infd = open(USBSER_DEVNAME, O_RDONLY|O_NONBLOCK);
if (infd < 0)
{
- message("user_start: ERROR: Failed to open " USBSER_DEVNAME " for reading: %d\n", errno);
+ message("usbserial_main: ERROR: Failed to open " USBSER_DEVNAME " for reading: %d\n", errno);
close(outfd);
return 3;
}
@@ -299,20 +299,20 @@ int user_start(int argc, char *argv[])
if (infd < 0)
{
int errcode = errno;
- message("user_start: ERROR: Failed to open " USBSER_DEVNAME " for reading: %d\n", errno);
+ message("usbserial_main: ERROR: Failed to open " USBSER_DEVNAME " for reading: %d\n", errno);
/* ENOTCONN means that the USB device is not yet connected */
if (errcode == ENOTCONN)
{
- message("user_start: Not connected. Wait and try again.\n");
+ message("usbserial_main: Not connected. Wait and try again.\n");
sleep(5);
}
else
{
/* Give up on other errors */
- message("user_start: Aborting\n");
+ message("usbserial_main: Aborting\n");
return 3;
}
}
@@ -325,7 +325,7 @@ int user_start(int argc, char *argv[])
#endif
#endif
- message("user_start: Successfully opened the serial driver\n");
+ message("usbserial_main: Successfully opened the serial driver\n");
/* Send messages and get responses -- forever */
@@ -337,21 +337,21 @@ int user_start(int argc, char *argv[])
#if !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) && !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL)
if (count < 8)
{
- message("user_start: Saying hello\n");
+ message("usbserial_main: Saying hello\n");
nbytes = write(outfd, g_shortmsg, sizeof(g_shortmsg));
count++;
}
else
{
- message("user_start: Reciting QEI's speech of 1588\n");
+ message("usbserial_main: Reciting QEI's speech of 1588\n");
nbytes = write(outfd, g_longmsg, sizeof(g_longmsg));
count = 0;
}
#elif !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL)
- message("user_start: Reciting QEI's speech of 1588\n");
+ message("usbserial_main: Reciting QEI's speech of 1588\n");
nbytes = write(outfd, g_longmsg, sizeof(g_longmsg));
#else /* !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) */
- message("user_start: Saying hello\n");
+ message("usbserial_main: Saying hello\n");
nbytes = write(outfd, g_shortmsg, sizeof(g_shortmsg));
#endif
@@ -359,14 +359,14 @@ int user_start(int argc, char *argv[])
if (nbytes < 0)
{
- message("user_start: ERROR: write failed: %d\n", errno);
+ message("usbserial_main: ERROR: write failed: %d\n", errno);
#ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY
close(infd);
#endif
close(outfd);
return 4;
}
- message("user_start: %d bytes sent\n", nbytes);
+ message("usbserial_main: %d bytes sent\n", nbytes);
#endif /* CONFIG_EXAMPLES_USBSERIAL_OUTONLY */
/* Test OUT (host-to-device) messages */
@@ -374,7 +374,7 @@ int user_start(int argc, char *argv[])
#ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY
/* Poll for incoming messages */
- message("user_start: Polling for OUT messages\n");
+ message("usbserial_main: Polling for OUT messages\n");
for (i = 0; i < 5; i++)
{
memset(g_iobuffer, 'X', IOBUFFER_SIZE);
@@ -384,7 +384,7 @@ int user_start(int argc, char *argv[])
int errorcode = errno;
if (errorcode != EAGAIN)
{
- message("user_start: ERROR: read failed: %d\n", errno);
+ message("usbserial_main: ERROR: read failed: %d\n", errno);
close(infd);
#ifndef CONFIG_EXAMPLES_USBSERIAL_OUTONLY
close(outfd);
@@ -394,12 +394,12 @@ int user_start(int argc, char *argv[])
}
else
{
- message("user_start: Received %d bytes:\n", nbytes);
+ message("usbserial_main: Received %d bytes:\n", nbytes);
if (nbytes > 0)
{
for (j = 0; j < nbytes; j += 16)
{
- message("user_start: %03x: ", j);
+ message("usbserial_main: %03x: ", j);
for (k = 0; k < 16; k++)
{
if (k == 8)
@@ -445,7 +445,7 @@ int user_start(int argc, char *argv[])
sleep(1);
}
#else /* CONFIG_EXAMPLES_USBSERIAL_INONLY */
- message("user_start: Waiting\n");
+ message("usbserial_main: Waiting\n");
sleep(5);
#endif /* CONFIG_EXAMPLES_USBSERIAL_INONLY */
diff --git a/apps/examples/usbstorage/usbmsc_main.c b/apps/examples/usbstorage/usbmsc_main.c
index 45feafc591..ac7b82d017 100644
--- a/apps/examples/usbstorage/usbmsc_main.c
+++ b/apps/examples/usbstorage/usbmsc_main.c
@@ -379,7 +379,7 @@ static int usbmsc_enumerate(struct usbtrace_s *trace, void *arg)
****************************************************************************/
/****************************************************************************
- * user_start/msconn_main
+ * msconn_main
*
* Description:
* This is the main program that configures the USB mass storage device
@@ -389,15 +389,7 @@ static int usbmsc_enumerate(struct usbtrace_s *trace, void *arg)
*
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_USBMSC_BUILTIN
-# define MAIN_NAME msconn_main
-# define MAIN_NAME_STRING "msconn"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int msconn_main(int argc, char *argv[])
{
FAR void *handle;
int ret;
@@ -414,7 +406,7 @@ int MAIN_NAME(int argc, char *argv[])
if (g_usbmsc.mshandle)
{
- message(MAIN_NAME_STRING ": ERROR: Already connected\n");
+ message("msconn_main: ERROR: Already connected\n");
return 1;
}
#endif
@@ -436,33 +428,33 @@ int MAIN_NAME(int argc, char *argv[])
/* Register block drivers (architecture-specific) */
- message(MAIN_NAME_STRING ": Creating block drivers\n");
+ message("msconn_main: Creating block drivers\n");
ret = usbmsc_archinitialize();
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbmsc_archinitialize failed: %d\n", -ret);
+ message("msconn_main: usbmsc_archinitialize failed: %d\n", -ret);
return 2;
}
check_test_memory_usage("After usbmsc_archinitialize()");
/* Then exports the LUN(s) */
- message(MAIN_NAME_STRING ": Configuring with NLUNS=%d\n", CONFIG_EXAMPLES_USBMSC_NLUNS);
+ message("msconn_main: Configuring with NLUNS=%d\n", CONFIG_EXAMPLES_USBMSC_NLUNS);
ret = usbmsc_configure(CONFIG_EXAMPLES_USBMSC_NLUNS, &handle);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbmsc_configure failed: %d\n", -ret);
+ message("msconn_main: usbmsc_configure failed: %d\n", -ret);
usbmsc_uninitialize(handle);
return 3;
}
- message(MAIN_NAME_STRING ": handle=%p\n", handle);
+ message("msconn_main: handle=%p\n", handle);
check_test_memory_usage("After usbmsc_configure()");
- message(MAIN_NAME_STRING ": Bind LUN=0 to %s\n", CONFIG_EXAMPLES_USBMSC_DEVPATH1);
+ message("msconn_main: Bind LUN=0 to %s\n", CONFIG_EXAMPLES_USBMSC_DEVPATH1);
ret = usbmsc_bindlun(handle, CONFIG_EXAMPLES_USBMSC_DEVPATH1, 0, 0, 0, false);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbmsc_bindlun failed for LUN 1 using %s: %d\n",
+ message("msconn_main: usbmsc_bindlun failed for LUN 1 using %s: %d\n",
CONFIG_EXAMPLES_USBMSC_DEVPATH1, -ret);
usbmsc_uninitialize(handle);
return 4;
@@ -471,11 +463,11 @@ int MAIN_NAME(int argc, char *argv[])
#if CONFIG_EXAMPLES_USBMSC_NLUNS > 1
- message(MAIN_NAME_STRING ": Bind LUN=1 to %s\n", CONFIG_EXAMPLES_USBMSC_DEVPATH2);
+ message("msconn_main: Bind LUN=1 to %s\n", CONFIG_EXAMPLES_USBMSC_DEVPATH2);
ret = usbmsc_bindlun(handle, CONFIG_EXAMPLES_USBMSC_DEVPATH2, 1, 0, 0, false);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbmsc_bindlun failed for LUN 2 using %s: %d\n",
+ message("msconn_main: usbmsc_bindlun failed for LUN 2 using %s: %d\n",
CONFIG_EXAMPLES_USBMSC_DEVPATH2, -ret);
usbmsc_uninitialize(handle);
return 5;
@@ -484,11 +476,11 @@ int MAIN_NAME(int argc, char *argv[])
#if CONFIG_EXAMPLES_USBMSC_NLUNS > 2
- message(MAIN_NAME_STRING ": Bind LUN=2 to %s\n", CONFIG_EXAMPLES_USBMSC_DEVPATH3);
+ message("msconn_main: Bind LUN=2 to %s\n", CONFIG_EXAMPLES_USBMSC_DEVPATH3);
ret = usbmsc_bindlun(handle, CONFIG_EXAMPLES_USBMSC_DEVPATH3, 2, 0, 0, false);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbmsc_bindlun failed for LUN 3 using %s: %d\n",
+ message("msconn_main: usbmsc_bindlun failed for LUN 3 using %s: %d\n",
CONFIG_EXAMPLES_USBMSC_DEVPATH3, -ret);
usbmsc_uninitialize(handle);
return 6;
@@ -501,7 +493,7 @@ int MAIN_NAME(int argc, char *argv[])
ret = usbmsc_exportluns(handle);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbmsc_exportluns failed: %d\n", -ret);
+ message("msconn_main: usbmsc_exportluns failed: %d\n", -ret);
usbmsc_uninitialize(handle);
return 7;
}
@@ -522,17 +514,17 @@ int MAIN_NAME(int argc, char *argv[])
sleep(5);
# ifdef CONFIG_USBDEV_TRACE
- message("\nuser_start: USB TRACE DATA:\n");
+ message("\nmsconn_main: USB TRACE DATA:\n");
ret = usbtrace_enumerate(usbmsc_enumerate, NULL);
if (ret < 0)
{
- message(MAIN_NAME_STRING ": usbtrace_enumerate failed: %d\n", -ret);
+ message("msconn_main: usbtrace_enumerate failed: %d\n", -ret);
usbmsc_uninitialize(handle);
return 8;
}
check_test_memory_usage("After usbtrace_enumerate()");
# else
- message(MAIN_NAME_STRING ": Still alive\n");
+ message("msconn_main: Still alive\n");
# endif
}
#elif defined(CONFIG_EXAMPLES_USBMSC_BUILTIN)
@@ -541,7 +533,7 @@ int MAIN_NAME(int argc, char *argv[])
* command.
*/
- message(MAIN_NAME_STRING ": Connected\n");
+ message("msconn_main: Connected\n");
g_usbmsc.mshandle = handle;
check_test_memory_usage("After MS connection");
@@ -549,7 +541,7 @@ int MAIN_NAME(int argc, char *argv[])
/* Just exit */
- message(MAIN_NAME_STRING ": Exiting\n");
+ message("msconn_main: Exiting\n");
/* Dump debug memory usage */
diff --git a/apps/examples/usbterm/usbterm_main.c b/apps/examples/usbterm/usbterm_main.c
index 6e8e68412e..69301dfcd2 100644
--- a/apps/examples/usbterm/usbterm_main.c
+++ b/apps/examples/usbterm/usbterm_main.c
@@ -177,22 +177,14 @@ FAR void *usbterm_listener(FAR void *parameter)
****************************************************************************/
/****************************************************************************
- * Name: term_main/user_start
+ * Name: usbterm_main
*
* Description:
* Main entry point for the USB serial terminal example.
*
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_USBTERM_BUILTIN
-# define MAIN_NAME usbterm_main
-# define MAIN_STRING "usbterm_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int usbterm_main(int argc, char *argv[])
{
pthread_attr_t attr;
int ret;
@@ -206,18 +198,18 @@ int MAIN_NAME(int argc, char *argv[])
*/
#ifdef CONFIG_EXAMPLES_USBTERM_DEVINIT
- message(MAIN_STRING "Performing external device initialization\n");
+ message("usbterm_main: Performing external device initialization\n");
ret = usbterm_devinit();
if (ret != OK)
{
- message(MAIN_STRING "usbterm_devinit failed: %d\n", ret);
+ message("usbterm_main: usbterm_devinit failed: %d\n", ret);
goto errout;
}
#endif
/* Initialize the USB serial driver */
- message(MAIN_STRING "Registering USB serial driver\n");
+ message("usbterm_main: Registering USB serial driver\n");
#ifdef CONFIG_CDCACM
ret = cdcacm_initialize(0, NULL);
#else
@@ -225,10 +217,10 @@ int MAIN_NAME(int argc, char *argv[])
#endif
if (ret < 0)
{
- message(MAIN_STRING "ERROR: Failed to create the USB serial device: %d\n", -ret);
+ message("usbterm_main: ERROR: Failed to create the USB serial device: %d\n", -ret);
goto errout_with_devinit;
}
- message(MAIN_STRING "Successfully registered the serial driver\n");
+ message("usbterm_main: Successfully registered the serial driver\n");
#if CONFIG_USBDEV_TRACE && CONFIG_USBDEV_TRACE_INITIALIDSET != 0
/* If USB tracing is enabled and tracing of initial USB events is specified,
@@ -247,20 +239,20 @@ int MAIN_NAME(int argc, char *argv[])
do
{
- message(MAIN_STRING "Opening USB serial driver\n");
+ message("usbterm_main: Opening USB serial driver\n");
g_usbterm.outstream = fopen(USBTERM_DEVNAME, "w");
if (g_usbterm.outstream == NULL)
{
int errcode = errno;
- message(MAIN_STRING "ERROR: Failed to open " USBTERM_DEVNAME " for writing: %d\n",
+ message("usbterm_main: ERROR: Failed to open " USBTERM_DEVNAME " for writing: %d\n",
errcode);
/* ENOTCONN means that the USB device is not yet connected */
if (errcode == ENOTCONN)
{
- message(MAIN_STRING " Not connected. Wait and try again.\n");
+ message("usbterm_main: Not connected. Wait and try again.\n");
sleep(5);
}
else
@@ -284,20 +276,20 @@ int MAIN_NAME(int argc, char *argv[])
g_usbterm.instream = fopen(USBTERM_DEVNAME, "r");
if (g_usbterm.instream == NULL)
{
- message(MAIN_STRING "ERROR: Failed to open " USBTERM_DEVNAME " for reading: %d\n", errno);
+ message("usbterm_main: ERROR: Failed to open " USBTERM_DEVNAME " for reading: %d\n", errno);
goto errout_with_outstream;
}
- message(MAIN_STRING "Successfully opened the serial driver\n");
+ message("usbterm_main: Successfully opened the serial driver\n");
/* Start the USB term listener thread */
- message(MAIN_STRING "Starting the listener thread\n");
+ message("usbterm_main: Starting the listener thread\n");
ret = pthread_attr_init(&attr);
if (ret != OK)
{
- message(MAIN_STRING "pthread_attr_init failed: %d\n", ret);
+ message("usbterm_main: pthread_attr_init failed: %d\n", ret);
goto errout_with_streams;
}
@@ -305,13 +297,13 @@ int MAIN_NAME(int argc, char *argv[])
usbterm_listener, (pthread_addr_t)0);
if (ret != 0)
{
- message(MAIN_STRING "Error in thread creation: %d\n", ret);
+ message("usbterm_main: Error in thread creation: %d\n", ret);
goto errout_with_streams;
}
/* Send messages and get responses -- forever */
- message(MAIN_STRING "Waiting for local input\n");
+ message("usbterm_main: Waiting for local input\n");
for (;;)
{
/* Display the prompt string on stdout */
@@ -378,7 +370,7 @@ errout_with_devinit:
usbterm_devuninit();
errout:
#endif
- message(MAIN_STRING " Aborting\n");
+ message("usbterm_main: Aborting\n");
return 1;
}
diff --git a/apps/examples/watchdog/watchdog_main.c b/apps/examples/watchdog/watchdog_main.c
index c1341e0fb9..53099d21a5 100644
--- a/apps/examples/watchdog/watchdog_main.c
+++ b/apps/examples/watchdog/watchdog_main.c
@@ -217,7 +217,7 @@ static void parse_args(FAR struct wdog_example_s *wdog, int argc, FAR char **arg
****************************************************************************/
/****************************************************************************
- * Name: user_start/wdog_main
+ * Name: wdog_main
****************************************************************************/
int wdog_main(int argc, char *argv[])
diff --git a/apps/examples/wget/target.c b/apps/examples/wget/target.c
index fa30e037ba..5c5c656653 100644
--- a/apps/examples/wget/target.c
+++ b/apps/examples/wget/target.c
@@ -106,10 +106,10 @@ static void callback(FAR char **buffer, int offset, int datend,
****************************************************************************/
/****************************************************************************
- * user_start
+ * wget_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int wget_main(int argc, char *argv[])
{
struct in_addr addr;
#if defined(CONFIG_EXAMPLE_WGET_NOMAC)
diff --git a/apps/examples/wlan/wlan_main.c b/apps/examples/wlan/wlan_main.c
index d1fb44e94b..dcb8c770ac 100644
--- a/apps/examples/wlan/wlan_main.c
+++ b/apps/examples/wlan/wlan_main.c
@@ -258,32 +258,32 @@ static int wlan_waiter(int argc, char *argv[])
}
/****************************************************************************
- * Name: user_start
+ * Name: wlan_main
****************************************************************************/
-int user_start(int argc, char *argv[])
+int wlan_main(int argc, char *argv[])
{
pid_t pid;
int ret;
/* First, register all of the USB host Wireless LAN drivers */
- printf("user_start: Register drivers\n");
+ printf("wlan_main: Register drivers\n");
ret = usbhost_wlaninit();
if (ret != OK)
{
- printf("user_start: Failed to register the WLAN driver\n");
+ printf("wlan_main: Failed to register the WLAN driver\n");
}
/* Then get an instance of the USB host interface */
- printf("user_start: Initialize USB host WLAN driver\n");
+ printf("wlan_main: Initialize USB host WLAN driver\n");
g_drvr = usbhost_initialize(0);
if (g_drvr)
{
/* Start a thread to handle device connection. */
- printf("user_start: Start wlan_waiter\n");
+ printf("wlan_main: Start wlan_waiter\n");
#ifndef CONFIG_CUSTOM_STACK
pid = task_create("usbhost", CONFIG_EXAMPLES_WLAN_DEFPRIO,
diff --git a/apps/interpreters/README.txt b/apps/interpreters/README.txt
index 8cf7ce321b..f33c75df1c 100644
--- a/apps/interpreters/README.txt
+++ b/apps/interpreters/README.txt
@@ -58,7 +58,7 @@ pcode
Pascal P-Code at runtime. To use this example, place the following in
your appconfig file"
- # Path to example in apps/examples containing the user_start entry point
+ # Path to example in apps/examples containing the passhello_main entry point
CONFIGURED_APPS += examples/pashello
diff --git a/apps/system/i2c/i2c_main.c b/apps/system/i2c/i2c_main.c
index 2a0e5d626d..fbaf677aa6 100644
--- a/apps/system/i2c/i2c_main.c
+++ b/apps/system/i2c/i2c_main.c
@@ -351,15 +351,7 @@ static void i2c_teardown(FAR struct i2ctool_s *i2ctool)
* Name: i2c_main
****************************************************************************/
-#ifdef CONFIG_I2CTOOL_BUILTIN
-# define MAIN_NAME i2c_main
-# define MAIN_NAME_STRING "i2c_main"
-#else
-# define MAIN_NAME user_start
-# define MAIN_NAME_STRING "user_start"
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int i2c_main(int argc, char *argv[])
{
/* Verify settings */
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index d628fffbb9..9cf8f14be2 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3221,3 +3221,7 @@
common configurations and in configs/*/README.txt for board and MCU_
specific configurations.
* configs/stm3240g-eval: Add USB host support.
+ * sched/os_bring.c, configs/*/defconfig, tools/mkconfig.c, and others: Added
+ configuration variable CONFIG_USER_ENTRYPOINT that may be used to change
+ the default entry from user_start to some other symbol. Contributed by
+ Kate.
diff --git a/nuttx/Documentation/NuttShell.html b/nuttx/Documentation/NuttShell.html
index 2cb4bc9a42..bcf62a5a91 100644
--- a/nuttx/Documentation/NuttShell.html
+++ b/nuttx/Documentation/NuttShell.html
@@ -3066,7 +3066,7 @@ Builtin Apps:
<p>
<code><b>apps/examples/hello</code></b>.
The main routine for apps/examples/hello can be found in <code>apps/examples/hello/main.c</code>.
- When <code>CONFIG_EXAMPLES_HELLO_BUILTIN</code> is defined, this main routine simplifies to:
+ The main routine is:
</p>
<ul><pre>
int hello_main(int argc, char *argv[])
@@ -3165,10 +3165,8 @@ STACKSIZE = 2048
</p>
<ul><pre>
.context:
-ifeq ($(CONFIG_EXAMPLES_HELLO_BUILTIN),y)
$(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main)
@touch $@
-endif
</pre></ul>
</ol>
@@ -3189,7 +3187,7 @@ endif
CONFIG_BUILTIN_APP_START=&lt;application name&gt;
</pre></ul>
<p>
- that application will be invoked immediately after system starts instead of the normal, default <code>user_start()</code> entry point.
+ that application will be invoked immediately after system starts instead of the default <code>CONFIG_USER_ENTRYPOINT</code>() entry point.
Note that <code>&lt;application name&gt;</code> must be provided just as it would have been on the NSH command line.
For example, <code>hello</code> would result in <code>hello_main()</code> being started at power-up.
</p>
@@ -3276,8 +3274,8 @@ CONFIGURED_APPS += examples/hello
<p>
You replace the sample code at <code>apps/examples/nsh/nsh_main.c</code> with whatever start-up logic that you want.
NSH is a library at <code>apps/nshlib</code>.
- <code>apps.examplex/nsh</code> is just a tiny, example start-up function (<code>user_start()</code>) that that runs immediately and illustrates how to start NSH
- If you want something else to run immediately then you can write your write your own custom <code>user_start()</code> function and then start other tasks from your custom <code>user_start()</code>.
+ <code>apps.examplex/nsh</code> is just a tiny, example start-up function (<code>CONFIG_USER_ENTRYPOINT</code>()) that that runs immediately and illustrates how to start NSH
+ If you want something else to run immediately then you can write your write your own custom <code>CONFIG_USER_ENTRYPOINT</code>() function and then start other tasks from your custom <code>CONFIG_USER_ENTRYPOINT</code>().
</p>
<li>
<p>
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index bfde229edc..532da8c16c 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -4085,6 +4085,14 @@ build
<code>CONFIG_SCHED_ONEXIT_MAX</code>: By default if <code>CONFIG_SCHED_ONEXIT</code> is selected, only a single <code>on_exit()</code> function is supported.
That number can be increased by defined this setting to the number that you require.
</li>
+ <li>
+ <code>CONFIG_USER_ENTRYPOINT</code>: The name of the entry point for user
+ applications.
+ For the example applications this is of the form <code>app_main</code>
+ where <code>app</code> is the application name.
+ If not defined, <code>CONFIG_USER_ENTRYPOINT</code> defaults to
+ <code>user_start</code>.
+ </li>
</ul>
<p>
@@ -5792,13 +5800,14 @@ build
<li>
<code>CONFIG_IDLETHREAD_STACKSIZE</code>: The size of the initial stack.
This is the thread that (1) performs the initial boot of the system up
- to the point where user_start() is spawned, and (2) there after is the
- IDLE thread that executes only when there is no other thread ready to
- run.
+ to the point where <code>CONFIG_USER_ENTRYPOINT</code>() is spawned,
+ and (2) there after is the IDLE thread that executes only when there
+ is no other thread ready to run.
</li>
<li>
<code>CONFIG_USERMAIN_STACKSIZE</code>: The size of the stack to allocate
- for the main user thread that begins at the user_start() entry point.
+ for the main user thread that begins at the <code>CONFIG_USER_ENTRYPOINT</code>()
+ entry point.
</li>
<li>
<code>CONFIG_PTHREAD_STACK_MIN</code>: Minimum pthread stack size
diff --git a/nuttx/Documentation/UsbTrace.html b/nuttx/Documentation/UsbTrace.html
index 6d170044f5..ec48e260dd 100644
--- a/nuttx/Documentation/UsbTrace.html
+++ b/nuttx/Documentation/UsbTrace.html
@@ -150,7 +150,7 @@
</tr>
<tr>
<td align="center">&nbsp;</td>
- <td align="left"><code>user_start: Registering USB serial driver</code></td>
+ <td align="left"><code>usbserial_main: Registering USB serial driver</code></td>
</tr>
<tr>
<td align="center">&nbsp;</td>
@@ -158,7 +158,7 @@
</tr>
<tr>
<td align="center">&nbsp;</td>
- <td align="left"><code>user_start: Successfully registered the serial driver</code></td>
+ <td align="left"><code>usbserial_main: Successfully registered the serial driver</code></td>
</tr>
<tr>
<td align="center">1</td>
@@ -170,11 +170,11 @@
</tr>
<tr>
<td align="center">&nbsp;</td>
- <td align="left"><code>user_start: ERROR: Failed to open /dev/ttyUSB0 for reading: 107</code></td>
+ <td align="left"><code>usbserial_main: ERROR: Failed to open /dev/ttyUSB0 for reading: 107</code></td>
</tr>
<tr>
<td align="center">&nbsp;</td>
- <td align="left"><code>user_start: Not connected. Wait and try again.</code></td>
+ <td align="left"><code>usbserial_main: Not connected. Wait and try again.</code></td>
</tr>
<tr>
<td align="center">3</td>
diff --git a/nuttx/configs/README.txt b/nuttx/configs/README.txt
index 065759ce67..4b68d28bdd 100644
--- a/nuttx/configs/README.txt
+++ b/nuttx/configs/README.txt
@@ -268,6 +268,7 @@ defconfig -- This is a configuration file similar to the Linux
by default)
CONFIG_DEBUG_GRAPHICS - enable NX graphics debug output
(disabled by default)
+
CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot
time console output
CONFIG_MM_REGIONS - If the architecture includes multiple
@@ -375,6 +376,10 @@ defconfig -- This is a configuration file similar to the Linux
CONFIG_SCHED_ONEXIT_MAX - By default if CONFIG_SCHED_ONEXIT is selected,
only a single on_exit() function is supported. That number can be
increased by defined this setting to the number that you require.
+ CONFIG_USER_ENTRYPOINT - The name of the entry point for user
+ applications. For the example applications this is of the form 'app_main'
+ where 'app' is the application name. If not defined, CONFIG_USER_ENTRYPOINT
+ defaults to user_start.
System Logging:
CONFIG_SYSLOG enables general system logging support.
diff --git a/nuttx/configs/amber/hello/defconfig b/nuttx/configs/amber/hello/defconfig
index 44aebfe8ba..a6b5728252 100644
--- a/nuttx/configs/amber/hello/defconfig
+++ b/nuttx/configs/amber/hello/defconfig
@@ -115,6 +115,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="hello_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/avr32dev1/nsh/defconfig b/nuttx/configs/avr32dev1/nsh/defconfig
index a5194dbe92..dbb562eaef 100755
--- a/nuttx/configs/avr32dev1/nsh/defconfig
+++ b/nuttx/configs/avr32dev1/nsh/defconfig
@@ -141,6 +141,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/avr32dev1/ostest/defconfig b/nuttx/configs/avr32dev1/ostest/defconfig
index 5a0657c6fd..6d5aa4d08c 100755
--- a/nuttx/configs/avr32dev1/ostest/defconfig
+++ b/nuttx/configs/avr32dev1/ostest/defconfig
@@ -141,6 +141,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/c5471evm/httpd/defconfig b/nuttx/configs/c5471evm/httpd/defconfig
index 37fa5ca7bf..6c48506e60 100644
--- a/nuttx/configs/c5471evm/httpd/defconfig
+++ b/nuttx/configs/c5471evm/httpd/defconfig
@@ -91,6 +91,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="uip_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/c5471evm/nettest/defconfig b/nuttx/configs/c5471evm/nettest/defconfig
index fee66d62d0..ac1677b8fc 100644
--- a/nuttx/configs/c5471evm/nettest/defconfig
+++ b/nuttx/configs/c5471evm/nettest/defconfig
@@ -91,6 +91,7 @@ CONFIG_NET_C5471_BASET10=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/c5471evm/nsh/defconfig b/nuttx/configs/c5471evm/nsh/defconfig
index 1eaca45d6e..88db3508e8 100644
--- a/nuttx/configs/c5471evm/nsh/defconfig
+++ b/nuttx/configs/c5471evm/nsh/defconfig
@@ -91,6 +91,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/c5471evm/ostest/defconfig b/nuttx/configs/c5471evm/ostest/defconfig
index b1c8c92cd6..26ea842647 100644
--- a/nuttx/configs/c5471evm/ostest/defconfig
+++ b/nuttx/configs/c5471evm/ostest/defconfig
@@ -91,6 +91,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/compal_e88/nsh_highram/defconfig b/nuttx/configs/compal_e88/nsh_highram/defconfig
index 6f2aa4c11e..f1882aff68 100644
--- a/nuttx/configs/compal_e88/nsh_highram/defconfig
+++ b/nuttx/configs/compal_e88/nsh_highram/defconfig
@@ -93,6 +93,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/compal_e99/nsh_compalram/defconfig b/nuttx/configs/compal_e99/nsh_compalram/defconfig
index edd607d566..d06f685ee8 100644
--- a/nuttx/configs/compal_e99/nsh_compalram/defconfig
+++ b/nuttx/configs/compal_e99/nsh_compalram/defconfig
@@ -96,6 +96,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/compal_e99/nsh_highram/defconfig b/nuttx/configs/compal_e99/nsh_highram/defconfig
index 0bc0301de6..c221b4e55d 100644
--- a/nuttx/configs/compal_e99/nsh_highram/defconfig
+++ b/nuttx/configs/compal_e99/nsh_highram/defconfig
@@ -96,6 +96,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_GRAPHICS=n
CONFIG_DEBUG_VERBOSE=n
diff --git a/nuttx/configs/demo9s12ne64/ostest/defconfig b/nuttx/configs/demo9s12ne64/ostest/defconfig
index 70b6d70b27..fb2b85d0eb 100755
--- a/nuttx/configs/demo9s12ne64/ostest/defconfig
+++ b/nuttx/configs/demo9s12ne64/ostest/defconfig
@@ -115,6 +115,7 @@ CONFIG_PASS1_OBJECT=
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ea3131/nsh/defconfig b/nuttx/configs/ea3131/nsh/defconfig
index 3d164f3393..0f26f02b09 100644
--- a/nuttx/configs/ea3131/nsh/defconfig
+++ b/nuttx/configs/ea3131/nsh/defconfig
@@ -113,6 +113,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ea3131/ostest/defconfig b/nuttx/configs/ea3131/ostest/defconfig
index 8cbc94f575..7bf95899f2 100644
--- a/nuttx/configs/ea3131/ostest/defconfig
+++ b/nuttx/configs/ea3131/ostest/defconfig
@@ -113,6 +113,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ea3131/pgnsh/defconfig b/nuttx/configs/ea3131/pgnsh/defconfig
index 3e6a31f5e1..8bb50a4a40 100644
--- a/nuttx/configs/ea3131/pgnsh/defconfig
+++ b/nuttx/configs/ea3131/pgnsh/defconfig
@@ -126,6 +126,7 @@ CONFIG_PASS1_OBJECT=locked.r
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ea3131/usbserial/defconfig b/nuttx/configs/ea3131/usbserial/defconfig
index a3043a2628..13adb17ef7 100644
--- a/nuttx/configs/ea3131/usbserial/defconfig
+++ b/nuttx/configs/ea3131/usbserial/defconfig
@@ -113,6 +113,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="usbserial_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_FS=n
diff --git a/nuttx/configs/ea3131/usbstorage/defconfig b/nuttx/configs/ea3131/usbstorage/defconfig
index c618bf4a83..a350502d24 100644
--- a/nuttx/configs/ea3131/usbstorage/defconfig
+++ b/nuttx/configs/ea3131/usbstorage/defconfig
@@ -113,6 +113,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_FS=n
diff --git a/nuttx/configs/ea3152/ostest/defconfig b/nuttx/configs/ea3152/ostest/defconfig
index 431e215e75..b239db331e 100644
--- a/nuttx/configs/ea3152/ostest/defconfig
+++ b/nuttx/configs/ea3152/ostest/defconfig
@@ -113,6 +113,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/eagle100/httpd/defconfig b/nuttx/configs/eagle100/httpd/defconfig
index 225bafa9f0..8c0c4516ea 100644
--- a/nuttx/configs/eagle100/httpd/defconfig
+++ b/nuttx/configs/eagle100/httpd/defconfig
@@ -120,6 +120,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="uip_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/eagle100/nettest/defconfig b/nuttx/configs/eagle100/nettest/defconfig
index 898d405b6d..e0aa45e2f3 100644
--- a/nuttx/configs/eagle100/nettest/defconfig
+++ b/nuttx/configs/eagle100/nettest/defconfig
@@ -120,6 +120,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/eagle100/nsh/defconfig b/nuttx/configs/eagle100/nsh/defconfig
index 47ddc168c1..9eedda0a9a 100644
--- a/nuttx/configs/eagle100/nsh/defconfig
+++ b/nuttx/configs/eagle100/nsh/defconfig
@@ -120,6 +120,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/eagle100/nxflat/defconfig b/nuttx/configs/eagle100/nxflat/defconfig
index 8d291cb81c..fc5e6a2305 100644
--- a/nuttx/configs/eagle100/nxflat/defconfig
+++ b/nuttx/configs/eagle100/nxflat/defconfig
@@ -120,6 +120,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nxflat_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/eagle100/ostest/defconfig b/nuttx/configs/eagle100/ostest/defconfig
index 74a5afd4d7..008b23a455 100644
--- a/nuttx/configs/eagle100/ostest/defconfig
+++ b/nuttx/configs/eagle100/ostest/defconfig
@@ -120,6 +120,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/eagle100/thttpd/defconfig b/nuttx/configs/eagle100/thttpd/defconfig
index b2865a2eda..5201bca781 100644
--- a/nuttx/configs/eagle100/thttpd/defconfig
+++ b/nuttx/configs/eagle100/thttpd/defconfig
@@ -120,6 +120,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="thttp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ekk-lm3s9b96/nsh/defconfig b/nuttx/configs/ekk-lm3s9b96/nsh/defconfig
index 4f556d406d..6d24f5ac9e 100644
--- a/nuttx/configs/ekk-lm3s9b96/nsh/defconfig
+++ b/nuttx/configs/ekk-lm3s9b96/nsh/defconfig
@@ -137,6 +137,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ekk-lm3s9b96/ostest/defconfig b/nuttx/configs/ekk-lm3s9b96/ostest/defconfig
index 21c4466974..7de2f33ead 100644
--- a/nuttx/configs/ekk-lm3s9b96/ostest/defconfig
+++ b/nuttx/configs/ekk-lm3s9b96/ostest/defconfig
@@ -137,6 +137,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200kitg/ostest/defconfig b/nuttx/configs/ez80f910200kitg/ostest/defconfig
index 056ab3a1e5..5947962bc1 100644
--- a/nuttx/configs/ez80f910200kitg/ostest/defconfig
+++ b/nuttx/configs/ez80f910200kitg/ostest/defconfig
@@ -99,6 +99,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200zco/dhcpd/defconfig b/nuttx/configs/ez80f910200zco/dhcpd/defconfig
index dad606ed98..64591ad509 100644
--- a/nuttx/configs/ez80f910200zco/dhcpd/defconfig
+++ b/nuttx/configs/ez80f910200zco/dhcpd/defconfig
@@ -102,6 +102,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="dhcpd_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200zco/httpd/defconfig b/nuttx/configs/ez80f910200zco/httpd/defconfig
index 0902d80b2a..bc8c3bb65f 100644
--- a/nuttx/configs/ez80f910200zco/httpd/defconfig
+++ b/nuttx/configs/ez80f910200zco/httpd/defconfig
@@ -102,6 +102,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="uip_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200zco/nettest/defconfig b/nuttx/configs/ez80f910200zco/nettest/defconfig
index bd5f02e8b4..0a87a96e24 100644
--- a/nuttx/configs/ez80f910200zco/nettest/defconfig
+++ b/nuttx/configs/ez80f910200zco/nettest/defconfig
@@ -102,6 +102,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200zco/nsh/defconfig b/nuttx/configs/ez80f910200zco/nsh/defconfig
index efa02583c3..4066d0ea7d 100644
--- a/nuttx/configs/ez80f910200zco/nsh/defconfig
+++ b/nuttx/configs/ez80f910200zco/nsh/defconfig
@@ -102,6 +102,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200zco/ostest/defconfig b/nuttx/configs/ez80f910200zco/ostest/defconfig
index c5ffe7b122..11bba8dcff 100644
--- a/nuttx/configs/ez80f910200zco/ostest/defconfig
+++ b/nuttx/configs/ez80f910200zco/ostest/defconfig
@@ -101,6 +101,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ez80f910200zco/poll/defconfig b/nuttx/configs/ez80f910200zco/poll/defconfig
index 1467ed6bbd..8ac0dde327 100644
--- a/nuttx/configs/ez80f910200zco/poll/defconfig
+++ b/nuttx/configs/ez80f910200zco/poll/defconfig
@@ -102,6 +102,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="poll_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/hymini-stm32v/buttons/defconfig b/nuttx/configs/hymini-stm32v/buttons/defconfig
index d50ba3697e..fe9629ee46 100644
--- a/nuttx/configs/hymini-stm32v/buttons/defconfig
+++ b/nuttx/configs/hymini-stm32v/buttons/defconfig
@@ -175,6 +175,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="buttons_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/hymini-stm32v/nsh/defconfig b/nuttx/configs/hymini-stm32v/nsh/defconfig
index be3ba9640d..881e582102 100755
--- a/nuttx/configs/hymini-stm32v/nsh/defconfig
+++ b/nuttx/configs/hymini-stm32v/nsh/defconfig
@@ -173,6 +173,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/hymini-stm32v/nsh2/defconfig b/nuttx/configs/hymini-stm32v/nsh2/defconfig
index b18fd622bc..d309248453 100644
--- a/nuttx/configs/hymini-stm32v/nsh2/defconfig
+++ b/nuttx/configs/hymini-stm32v/nsh2/defconfig
@@ -180,6 +180,7 @@ CONFIG_RTC=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_GRAPHICS=y
diff --git a/nuttx/configs/hymini-stm32v/nx/defconfig b/nuttx/configs/hymini-stm32v/nx/defconfig
index 56960f2b42..16940a2a85 100644
--- a/nuttx/configs/hymini-stm32v/nx/defconfig
+++ b/nuttx/configs/hymini-stm32v/nx/defconfig
@@ -173,6 +173,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/hymini-stm32v/nxlines/defconfig b/nuttx/configs/hymini-stm32v/nxlines/defconfig
index 78e409955e..9ce18314a5 100644
--- a/nuttx/configs/hymini-stm32v/nxlines/defconfig
+++ b/nuttx/configs/hymini-stm32v/nxlines/defconfig
@@ -177,6 +177,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nxlines_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/hymini-stm32v/usbserial/defconfig b/nuttx/configs/hymini-stm32v/usbserial/defconfig
index 75b3b2dc90..285fefd9cd 100755
--- a/nuttx/configs/hymini-stm32v/usbserial/defconfig
+++ b/nuttx/configs/hymini-stm32v/usbserial/defconfig
@@ -175,6 +175,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="usbserial_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_USB=n
diff --git a/nuttx/configs/hymini-stm32v/usbstorage/defconfig b/nuttx/configs/hymini-stm32v/usbstorage/defconfig
index 612b6ca012..129a045c4e 100755
--- a/nuttx/configs/hymini-stm32v/usbstorage/defconfig
+++ b/nuttx/configs/hymini-stm32v/usbstorage/defconfig
@@ -174,6 +174,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_FS=n
diff --git a/nuttx/configs/kwikstik-k40/ostest/defconfig b/nuttx/configs/kwikstik-k40/ostest/defconfig
index f91fbc13cc..3f26570ce8 100755
--- a/nuttx/configs/kwikstik-k40/ostest/defconfig
+++ b/nuttx/configs/kwikstik-k40/ostest/defconfig
@@ -185,6 +185,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lincoln60/nsh/defconfig b/nuttx/configs/lincoln60/nsh/defconfig
index 3821f8a2a2..907a86291a 100644
--- a/nuttx/configs/lincoln60/nsh/defconfig
+++ b/nuttx/configs/lincoln60/nsh/defconfig
@@ -153,6 +153,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lincoln60/ostest/defconfig b/nuttx/configs/lincoln60/ostest/defconfig
index 40fa5d97dd..6d2ad64b78 100644
--- a/nuttx/configs/lincoln60/ostest/defconfig
+++ b/nuttx/configs/lincoln60/ostest/defconfig
@@ -159,6 +159,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s6432-s2e/nsh/defconfig b/nuttx/configs/lm3s6432-s2e/nsh/defconfig
index 4a929623d7..bc8f56ba69 100644
--- a/nuttx/configs/lm3s6432-s2e/nsh/defconfig
+++ b/nuttx/configs/lm3s6432-s2e/nsh/defconfig
@@ -136,6 +136,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s6432-s2e/ostest/defconfig b/nuttx/configs/lm3s6432-s2e/ostest/defconfig
index 92e77b457a..78934fbb2c 100644
--- a/nuttx/configs/lm3s6432-s2e/ostest/defconfig
+++ b/nuttx/configs/lm3s6432-s2e/ostest/defconfig
@@ -136,6 +136,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s6965-ek/nsh/defconfig b/nuttx/configs/lm3s6965-ek/nsh/defconfig
index 310eab1e83..46df76a3c5 100755
--- a/nuttx/configs/lm3s6965-ek/nsh/defconfig
+++ b/nuttx/configs/lm3s6965-ek/nsh/defconfig
@@ -136,6 +136,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s6965-ek/nx/defconfig b/nuttx/configs/lm3s6965-ek/nx/defconfig
index a579f4622e..bad0fe348d 100755
--- a/nuttx/configs/lm3s6965-ek/nx/defconfig
+++ b/nuttx/configs/lm3s6965-ek/nx/defconfig
@@ -141,6 +141,7 @@ CONFIG_SPI_CMDDATA=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s6965-ek/ostest/defconfig b/nuttx/configs/lm3s6965-ek/ostest/defconfig
index 6384936a93..7346d33893 100755
--- a/nuttx/configs/lm3s6965-ek/ostest/defconfig
+++ b/nuttx/configs/lm3s6965-ek/ostest/defconfig
@@ -136,6 +136,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s8962-ek/nsh/defconfig b/nuttx/configs/lm3s8962-ek/nsh/defconfig
index 2e1d5056e9..bc094bcc6f 100755
--- a/nuttx/configs/lm3s8962-ek/nsh/defconfig
+++ b/nuttx/configs/lm3s8962-ek/nsh/defconfig
@@ -136,6 +136,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s8962-ek/nx/defconfig b/nuttx/configs/lm3s8962-ek/nx/defconfig
index a918f1c430..6086e264b7 100755
--- a/nuttx/configs/lm3s8962-ek/nx/defconfig
+++ b/nuttx/configs/lm3s8962-ek/nx/defconfig
@@ -141,6 +141,7 @@ CONFIG_SPI_CMDDATA=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lm3s8962-ek/ostest/defconfig b/nuttx/configs/lm3s8962-ek/ostest/defconfig
index 757c0192a6..2ab5688788 100755
--- a/nuttx/configs/lm3s8962-ek/ostest/defconfig
+++ b/nuttx/configs/lm3s8962-ek/ostest/defconfig
@@ -136,6 +136,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpc4330-xplorer/nsh/defconfig b/nuttx/configs/lpc4330-xplorer/nsh/defconfig
index bab387d5d0..db3474a4a6 100644
--- a/nuttx/configs/lpc4330-xplorer/nsh/defconfig
+++ b/nuttx/configs/lpc4330-xplorer/nsh/defconfig
@@ -195,6 +195,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpc4330-xplorer/ostest/defconfig b/nuttx/configs/lpc4330-xplorer/ostest/defconfig
index 8c48275d22..40af52c5a9 100644
--- a/nuttx/configs/lpc4330-xplorer/ostest/defconfig
+++ b/nuttx/configs/lpc4330-xplorer/ostest/defconfig
@@ -193,6 +193,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
index bd7614b138..681744b6e0 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig
@@ -158,6 +158,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="dhcpd_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig b/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
index e6248f5203..718e071314 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig
@@ -161,6 +161,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig b/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig
index 15cbe34436..839eb2c9af 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig
@@ -162,6 +162,7 @@ CONFIG_SPI_CMDDATA=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig b/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig
index 69da0df725..da6da59483 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig
@@ -157,6 +157,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig b/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
index 5e74d0c563..8150d89f68 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig
@@ -158,6 +158,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="thttp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig
index 3595fa59d9..8d0f34b44f 100755
--- a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig
+++ b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig
@@ -157,6 +157,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/m68332evb/defconfig b/nuttx/configs/m68332evb/defconfig
index 326a46c705..79033bcd2f 100644
--- a/nuttx/configs/m68332evb/defconfig
+++ b/nuttx/configs/m68332evb/defconfig
@@ -72,6 +72,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mbed/hidkbd/defconfig b/nuttx/configs/mbed/hidkbd/defconfig
index 3bb55142f2..4d0a0b0d59 100644
--- a/nuttx/configs/mbed/hidkbd/defconfig
+++ b/nuttx/configs/mbed/hidkbd/defconfig
@@ -157,6 +157,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="hidkbd_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mbed/nsh/defconfig b/nuttx/configs/mbed/nsh/defconfig
index 806e090b99..0d40702939 100755
--- a/nuttx/configs/mbed/nsh/defconfig
+++ b/nuttx/configs/mbed/nsh/defconfig
@@ -153,6 +153,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mcu123-lpc214x/composite/defconfig b/nuttx/configs/mcu123-lpc214x/composite/defconfig
index e032428d5b..eae7dc791f 100644
--- a/nuttx/configs/mcu123-lpc214x/composite/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/composite/defconfig
@@ -95,6 +95,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="conn_main"
+#CONFIG_USER_ENTRYPOINT="disconn_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mcu123-lpc214x/nsh/defconfig b/nuttx/configs/mcu123-lpc214x/nsh/defconfig
index 9f860295ae..62b870f727 100644
--- a/nuttx/configs/mcu123-lpc214x/nsh/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/nsh/defconfig
@@ -95,6 +95,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mcu123-lpc214x/ostest/defconfig b/nuttx/configs/mcu123-lpc214x/ostest/defconfig
index d61ac67547..0a416b7f74 100644
--- a/nuttx/configs/mcu123-lpc214x/ostest/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/ostest/defconfig
@@ -95,6 +95,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
index 3d1b02030b..0749c7834a 100644
--- a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
@@ -95,6 +95,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="usbserial_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig b/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
index 4d88c2e78e..4b0ce174d7 100644
--- a/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
@@ -95,6 +95,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/micropendous3/hello/defconfig b/nuttx/configs/micropendous3/hello/defconfig
index 7a04763fa6..a76093424f 100644
--- a/nuttx/configs/micropendous3/hello/defconfig
+++ b/nuttx/configs/micropendous3/hello/defconfig
@@ -110,6 +110,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="hello_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mirtoo/nsh/defconfig b/nuttx/configs/mirtoo/nsh/defconfig
index 5a8ebbadd6..0ee9cc34e1 100644
--- a/nuttx/configs/mirtoo/nsh/defconfig
+++ b/nuttx/configs/mirtoo/nsh/defconfig
@@ -168,6 +168,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mirtoo/nxffs/defconfig b/nuttx/configs/mirtoo/nxffs/defconfig
index 6d27574b75..a9dce182b9 100644
--- a/nuttx/configs/mirtoo/nxffs/defconfig
+++ b/nuttx/configs/mirtoo/nxffs/defconfig
@@ -168,6 +168,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mirtoo/ostest/defconfig b/nuttx/configs/mirtoo/ostest/defconfig
index 3e759bbaca..e830aefa06 100644
--- a/nuttx/configs/mirtoo/ostest/defconfig
+++ b/nuttx/configs/mirtoo/ostest/defconfig
@@ -160,6 +160,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/mx1ads/ostest/defconfig b/nuttx/configs/mx1ads/ostest/defconfig
index 18b577a14b..6680246936 100644
--- a/nuttx/configs/mx1ads/ostest/defconfig
+++ b/nuttx/configs/mx1ads/ostest/defconfig
@@ -101,6 +101,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ne64badge/ostest/defconfig b/nuttx/configs/ne64badge/ostest/defconfig
index 2401f5ea6e..709467d830 100755
--- a/nuttx/configs/ne64badge/ostest/defconfig
+++ b/nuttx/configs/ne64badge/ostest/defconfig
@@ -121,6 +121,7 @@ CONFIG_PASS1_OBJECT=
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/nettest/defconfig b/nuttx/configs/ntosd-dm320/nettest/defconfig
index 7ade4f05ad..ce80f13cb4 100644
--- a/nuttx/configs/ntosd-dm320/nettest/defconfig
+++ b/nuttx/configs/ntosd-dm320/nettest/defconfig
@@ -93,6 +93,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/nsh/defconfig b/nuttx/configs/ntosd-dm320/nsh/defconfig
index 640fa449dd..b6116fb2cc 100644
--- a/nuttx/configs/ntosd-dm320/nsh/defconfig
+++ b/nuttx/configs/ntosd-dm320/nsh/defconfig
@@ -92,6 +92,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/ostest/defconfig b/nuttx/configs/ntosd-dm320/ostest/defconfig
index d6598a42c7..3f59be6369 100644
--- a/nuttx/configs/ntosd-dm320/ostest/defconfig
+++ b/nuttx/configs/ntosd-dm320/ostest/defconfig
@@ -93,6 +93,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/poll/defconfig b/nuttx/configs/ntosd-dm320/poll/defconfig
index 3fcdc7a73c..ba70d32445 100644
--- a/nuttx/configs/ntosd-dm320/poll/defconfig
+++ b/nuttx/configs/ntosd-dm320/poll/defconfig
@@ -93,6 +93,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="poll_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/thttpd/defconfig b/nuttx/configs/ntosd-dm320/thttpd/defconfig
index d7849310a3..27b0097b92 100644
--- a/nuttx/configs/ntosd-dm320/thttpd/defconfig
+++ b/nuttx/configs/ntosd-dm320/thttpd/defconfig
@@ -94,6 +94,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="thttp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/udp/defconfig b/nuttx/configs/ntosd-dm320/udp/defconfig
index 3747853349..e1174a13c9 100644
--- a/nuttx/configs/ntosd-dm320/udp/defconfig
+++ b/nuttx/configs/ntosd-dm320/udp/defconfig
@@ -93,6 +93,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="udp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ntosd-dm320/uip/defconfig b/nuttx/configs/ntosd-dm320/uip/defconfig
index a3b3eae095..63e21a93e8 100644
--- a/nuttx/configs/ntosd-dm320/uip/defconfig
+++ b/nuttx/configs/ntosd-dm320/uip/defconfig
@@ -115,6 +115,7 @@ CONFIG_FDCLONE_DISABLE=n
CONFIG_FDCLONE_STDIO=n
CONFIG_SDCLONE_DISABLE=y
CONFIG_NXFLAT=n
+CONFIG_USER_ENTRYPOINT="uip_main"
#
# The following can be used to disable categories of
diff --git a/nuttx/configs/nucleus2g/nsh/defconfig b/nuttx/configs/nucleus2g/nsh/defconfig
index cd8b148b56..d846e9a0d7 100755
--- a/nuttx/configs/nucleus2g/nsh/defconfig
+++ b/nuttx/configs/nucleus2g/nsh/defconfig
@@ -153,6 +153,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/nucleus2g/ostest/defconfig b/nuttx/configs/nucleus2g/ostest/defconfig
index 89d4245baa..194c5d817b 100755
--- a/nuttx/configs/nucleus2g/ostest/defconfig
+++ b/nuttx/configs/nucleus2g/ostest/defconfig
@@ -153,6 +153,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/nucleus2g/usbserial/defconfig b/nuttx/configs/nucleus2g/usbserial/defconfig
index d75e01f4dc..d3c8bc7dc7 100755
--- a/nuttx/configs/nucleus2g/usbserial/defconfig
+++ b/nuttx/configs/nucleus2g/usbserial/defconfig
@@ -153,6 +153,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="usbserial_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/nucleus2g/usbstorage/defconfig b/nuttx/configs/nucleus2g/usbstorage/defconfig
index c902909af6..2f1f6a3698 100755
--- a/nuttx/configs/nucleus2g/usbstorage/defconfig
+++ b/nuttx/configs/nucleus2g/usbstorage/defconfig
@@ -153,6 +153,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig b/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
index a7f4fb6d51..c11d40999e 100755
--- a/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig
@@ -163,6 +163,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ftpc_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/hidkbd/defconfig b/nuttx/configs/olimex-lpc1766stk/hidkbd/defconfig
index 85333830d0..ce40fc25dc 100755
--- a/nuttx/configs/olimex-lpc1766stk/hidkbd/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/hidkbd/defconfig
@@ -163,6 +163,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="hidkbd_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/nettest/defconfig b/nuttx/configs/olimex-lpc1766stk/nettest/defconfig
index d46de05f45..7c0046b857 100755
--- a/nuttx/configs/olimex-lpc1766stk/nettest/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/nettest/defconfig
@@ -163,6 +163,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/nsh/defconfig b/nuttx/configs/olimex-lpc1766stk/nsh/defconfig
index fac5a70393..9bc96d1bec 100755
--- a/nuttx/configs/olimex-lpc1766stk/nsh/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/nsh/defconfig
@@ -163,6 +163,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/nx/defconfig b/nuttx/configs/olimex-lpc1766stk/nx/defconfig
index be5d1657be..4096713778 100755
--- a/nuttx/configs/olimex-lpc1766stk/nx/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/nx/defconfig
@@ -164,7 +164,7 @@ CONFIG_SPI_CMDDATA=n
#
# General OS setup
#
-
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/ostest/defconfig b/nuttx/configs/olimex-lpc1766stk/ostest/defconfig
index bc28760fce..f7b701cc3c 100755
--- a/nuttx/configs/olimex-lpc1766stk/ostest/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/ostest/defconfig
@@ -159,6 +159,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig b/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
index f72bfd9361..6eb34db144 100755
--- a/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig
@@ -162,6 +162,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="thttp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig b/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
index 6a99e0da9b..9690f800f0 100755
--- a/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig
@@ -160,6 +160,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="thttp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig
index bd7bab899c..ed41b08d0f 100755
--- a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig
@@ -159,6 +159,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="usbserial_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig
index 1a94fef661..b01e79a5d4 100755
--- a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig
@@ -159,6 +159,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc1766stk/wlan/defconfig b/nuttx/configs/olimex-lpc1766stk/wlan/defconfig
index 73a30a7f77..a0e5da662d 100755
--- a/nuttx/configs/olimex-lpc1766stk/wlan/defconfig
+++ b/nuttx/configs/olimex-lpc1766stk/wlan/defconfig
@@ -154,6 +154,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="wlan_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-lpc2378/nsh/defconfig b/nuttx/configs/olimex-lpc2378/nsh/defconfig
index c21ddc13ab..5424927158 100755
--- a/nuttx/configs/olimex-lpc2378/nsh/defconfig
+++ b/nuttx/configs/olimex-lpc2378/nsh/defconfig
@@ -115,6 +115,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
#CONFIG_DEBUG_MM=y
diff --git a/nuttx/configs/olimex-lpc2378/ostest/defconfig b/nuttx/configs/olimex-lpc2378/ostest/defconfig
index 4231d9e852..ef883dfaab 100755
--- a/nuttx/configs/olimex-lpc2378/ostest/defconfig
+++ b/nuttx/configs/olimex-lpc2378/ostest/defconfig
@@ -115,6 +115,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
#CONFIG_DEBUG_MM=y
diff --git a/nuttx/configs/olimex-stm32-p107/nsh/defconfig b/nuttx/configs/olimex-stm32-p107/nsh/defconfig
index 1bfea5ce21..b38fd35a8e 100644
--- a/nuttx/configs/olimex-stm32-p107/nsh/defconfig
+++ b/nuttx/configs/olimex-stm32-p107/nsh/defconfig
@@ -210,6 +210,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-stm32-p107/ostest/defconfig b/nuttx/configs/olimex-stm32-p107/ostest/defconfig
index 7d37ffc39c..c51b52c149 100644
--- a/nuttx/configs/olimex-stm32-p107/ostest/defconfig
+++ b/nuttx/configs/olimex-stm32-p107/ostest/defconfig
@@ -223,6 +223,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-strp711/nettest/defconfig b/nuttx/configs/olimex-strp711/nettest/defconfig
index 7f05cf2f38..d0df26adf9 100755
--- a/nuttx/configs/olimex-strp711/nettest/defconfig
+++ b/nuttx/configs/olimex-strp711/nettest/defconfig
@@ -133,6 +133,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-strp711/nsh/defconfig b/nuttx/configs/olimex-strp711/nsh/defconfig
index 3573e8b2bb..84db85567d 100644
--- a/nuttx/configs/olimex-strp711/nsh/defconfig
+++ b/nuttx/configs/olimex-strp711/nsh/defconfig
@@ -133,6 +133,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/olimex-strp711/ostest/defconfig b/nuttx/configs/olimex-strp711/ostest/defconfig
index 18f6c953f9..cada293a95 100644
--- a/nuttx/configs/olimex-strp711/ostest/defconfig
+++ b/nuttx/configs/olimex-strp711/ostest/defconfig
@@ -133,6 +133,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/pcblogic-pic32mx/nsh/defconfig b/nuttx/configs/pcblogic-pic32mx/nsh/defconfig
index 6e30c5b27a..e79efc67a0 100644
--- a/nuttx/configs/pcblogic-pic32mx/nsh/defconfig
+++ b/nuttx/configs/pcblogic-pic32mx/nsh/defconfig
@@ -160,6 +160,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/pcblogic-pic32mx/ostest/defconfig b/nuttx/configs/pcblogic-pic32mx/ostest/defconfig
index 82d68e5af4..0fe51f08e2 100644
--- a/nuttx/configs/pcblogic-pic32mx/ostest/defconfig
+++ b/nuttx/configs/pcblogic-pic32mx/ostest/defconfig
@@ -160,6 +160,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/pic32-starterkit/nsh/defconfig b/nuttx/configs/pic32-starterkit/nsh/defconfig
index e0843ff876..fe18e1dbdf 100644
--- a/nuttx/configs/pic32-starterkit/nsh/defconfig
+++ b/nuttx/configs/pic32-starterkit/nsh/defconfig
@@ -220,6 +220,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
diff --git a/nuttx/configs/pic32-starterkit/nsh2/defconfig b/nuttx/configs/pic32-starterkit/nsh2/defconfig
index 68e22e41d8..1879e80da6 100644
--- a/nuttx/configs/pic32-starterkit/nsh2/defconfig
+++ b/nuttx/configs/pic32-starterkit/nsh2/defconfig
@@ -220,7 +220,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
-
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/pic32-starterkit/ostest/defconfig b/nuttx/configs/pic32-starterkit/ostest/defconfig
index 2b53d9a68b..bd1c372ed0 100644
--- a/nuttx/configs/pic32-starterkit/ostest/defconfig
+++ b/nuttx/configs/pic32-starterkit/ostest/defconfig
@@ -220,7 +220,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
-
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/pic32mx7mmb/nsh/defconfig b/nuttx/configs/pic32mx7mmb/nsh/defconfig
index 48591460c1..3a89bca7e6 100644
--- a/nuttx/configs/pic32mx7mmb/nsh/defconfig
+++ b/nuttx/configs/pic32mx7mmb/nsh/defconfig
@@ -220,6 +220,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
diff --git a/nuttx/configs/pic32mx7mmb/ostest/defconfig b/nuttx/configs/pic32mx7mmb/ostest/defconfig
index fe6a6f13e5..bc307e44a3 100644
--- a/nuttx/configs/pic32mx7mmb/ostest/defconfig
+++ b/nuttx/configs/pic32mx7mmb/ostest/defconfig
@@ -220,7 +220,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
-
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/pjrc-8051/defconfig b/nuttx/configs/pjrc-8051/defconfig
index d234bd82d2..109bc22a79 100644
--- a/nuttx/configs/pjrc-8051/defconfig
+++ b/nuttx/configs/pjrc-8051/defconfig
@@ -71,6 +71,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/qemu-i486/nsh/defconfig b/nuttx/configs/qemu-i486/nsh/defconfig
index 46fd300588..34475e69a8 100644
--- a/nuttx/configs/qemu-i486/nsh/defconfig
+++ b/nuttx/configs/qemu-i486/nsh/defconfig
@@ -119,6 +119,7 @@ CONFIG_UART3_2STOP=0
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/qemu-i486/ostest/defconfig b/nuttx/configs/qemu-i486/ostest/defconfig
index 32f3fcaea6..7372d34801 100644
--- a/nuttx/configs/qemu-i486/ostest/defconfig
+++ b/nuttx/configs/qemu-i486/ostest/defconfig
@@ -55,6 +55,7 @@ CONFIG_ARCH_DMA=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/rgmp/arm/default/defconfig b/nuttx/configs/rgmp/arm/default/defconfig
index b39fb54609..017e615002 100644
--- a/nuttx/configs/rgmp/arm/default/defconfig
+++ b/nuttx/configs/rgmp/arm/default/defconfig
@@ -45,6 +45,7 @@ CONFIG_ARCH_BOARD_RGMP=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="rgmp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/rgmp/arm/nsh/defconfig b/nuttx/configs/rgmp/arm/nsh/defconfig
index 67ff5fe93b..302d6fd78f 100644
--- a/nuttx/configs/rgmp/arm/nsh/defconfig
+++ b/nuttx/configs/rgmp/arm/nsh/defconfig
@@ -45,6 +45,7 @@ CONFIG_ARCH_BOARD_RGMP=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=y
diff --git a/nuttx/configs/rgmp/x86/default/defconfig b/nuttx/configs/rgmp/x86/default/defconfig
index ddbd1e51b9..27325c2a00 100644
--- a/nuttx/configs/rgmp/x86/default/defconfig
+++ b/nuttx/configs/rgmp/x86/default/defconfig
@@ -45,6 +45,7 @@ CONFIG_ARCH_BOARD_RGMP=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="rgmp_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/rgmp/x86/nsh/defconfig b/nuttx/configs/rgmp/x86/nsh/defconfig
index da8219af37..308915c042 100644
--- a/nuttx/configs/rgmp/x86/nsh/defconfig
+++ b/nuttx/configs/rgmp/x86/nsh/defconfig
@@ -45,6 +45,7 @@ CONFIG_ARCH_BOARD_RGMP=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=y
diff --git a/nuttx/configs/sam3u-ek/knsh/defconfig b/nuttx/configs/sam3u-ek/knsh/defconfig
index a4b5d6ed8c..07088cf311 100755
--- a/nuttx/configs/sam3u-ek/knsh/defconfig
+++ b/nuttx/configs/sam3u-ek/knsh/defconfig
@@ -157,6 +157,7 @@ CONFIG_PASS1_OBJECT=
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sam3u-ek/nsh/defconfig b/nuttx/configs/sam3u-ek/nsh/defconfig
index 502fa9f5a5..51d7a4a3e8 100755
--- a/nuttx/configs/sam3u-ek/nsh/defconfig
+++ b/nuttx/configs/sam3u-ek/nsh/defconfig
@@ -144,6 +144,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sam3u-ek/nx/defconfig b/nuttx/configs/sam3u-ek/nx/defconfig
index 60eece3689..386225647f 100755
--- a/nuttx/configs/sam3u-ek/nx/defconfig
+++ b/nuttx/configs/sam3u-ek/nx/defconfig
@@ -144,6 +144,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sam3u-ek/ostest/defconfig b/nuttx/configs/sam3u-ek/ostest/defconfig
index b223d6bd31..f8b8eb264b 100755
--- a/nuttx/configs/sam3u-ek/ostest/defconfig
+++ b/nuttx/configs/sam3u-ek/ostest/defconfig
@@ -145,6 +145,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sam3u-ek/touchscreen/defconfig b/nuttx/configs/sam3u-ek/touchscreen/defconfig
index cd6bf7bcc0..b1a33fd866 100755
--- a/nuttx/configs/sam3u-ek/touchscreen/defconfig
+++ b/nuttx/configs/sam3u-ek/touchscreen/defconfig
@@ -151,6 +151,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/mount/defconfig b/nuttx/configs/sim/mount/defconfig
index dfbad63f87..cbd5a9fefa 100644
--- a/nuttx/configs/sim/mount/defconfig
+++ b/nuttx/configs/sim/mount/defconfig
@@ -43,6 +43,7 @@ CONFIG_ARCH_BOARD_SIM=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="mount_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/nettest/defconfig b/nuttx/configs/sim/nettest/defconfig
index 3244a7a561..26d4f4388d 100644
--- a/nuttx/configs/sim/nettest/defconfig
+++ b/nuttx/configs/sim/nettest/defconfig
@@ -43,6 +43,7 @@ CONFIG_ARCH_BOARD_SIM=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/nsh/defconfig b/nuttx/configs/sim/nsh/defconfig
index 28c88bd5fa..bbab5615d5 100644
--- a/nuttx/configs/sim/nsh/defconfig
+++ b/nuttx/configs/sim/nsh/defconfig
@@ -43,6 +43,7 @@ CONFIG_ARCH_BOARD_SIM=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/nsh2/defconfig b/nuttx/configs/sim/nsh2/defconfig
index eeb9665231..bf14be9e13 100644
--- a/nuttx/configs/sim/nsh2/defconfig
+++ b/nuttx/configs/sim/nsh2/defconfig
@@ -67,6 +67,7 @@ CONFIG_SIM_TOUCHSCREEN=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=y
diff --git a/nuttx/configs/sim/nx/defconfig b/nuttx/configs/sim/nx/defconfig
index ae4fde6f0e..13159f00ed 100644
--- a/nuttx/configs/sim/nx/defconfig
+++ b/nuttx/configs/sim/nx/defconfig
@@ -51,6 +51,7 @@ CONFIG_SIM_FBBPP=8
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/nx11/defconfig b/nuttx/configs/sim/nx11/defconfig
index 0bc9dc1f35..58146ce18e 100644
--- a/nuttx/configs/sim/nx11/defconfig
+++ b/nuttx/configs/sim/nx11/defconfig
@@ -58,6 +58,7 @@ CONFIG_SIM_TOUCHSCREEN=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/nxffs/defconfig b/nuttx/configs/sim/nxffs/defconfig
index 40c8e40fdd..514f4770b2 100644
--- a/nuttx/configs/sim/nxffs/defconfig
+++ b/nuttx/configs/sim/nxffs/defconfig
@@ -43,6 +43,7 @@ CONFIG_ARCH_BOARD_SIM=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nxffs_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=y
diff --git a/nuttx/configs/sim/nxwm/defconfig b/nuttx/configs/sim/nxwm/defconfig
index 0a4150ff45..4f7586e856 100644
--- a/nuttx/configs/sim/nxwm/defconfig
+++ b/nuttx/configs/sim/nxwm/defconfig
@@ -67,6 +67,7 @@ CONFIG_SIM_TOUCHSCREEN=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=y
diff --git a/nuttx/configs/sim/ostest/defconfig b/nuttx/configs/sim/ostest/defconfig
index 3f7a3b06e4..3a814ed780 100644
--- a/nuttx/configs/sim/ostest/defconfig
+++ b/nuttx/configs/sim/ostest/defconfig
@@ -43,6 +43,7 @@ CONFIG_ARCH_BOARD_SIM=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/pashello/defconfig b/nuttx/configs/sim/pashello/defconfig
index c6c79be095..448b0a159c 100644
--- a/nuttx/configs/sim/pashello/defconfig
+++ b/nuttx/configs/sim/pashello/defconfig
@@ -43,6 +43,7 @@ CONFIG_ARCH_BOARD_SIM=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="pashello_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sim/touchscreen/defconfig b/nuttx/configs/sim/touchscreen/defconfig
index c0e4f4fc0a..3ef5553812 100644
--- a/nuttx/configs/sim/touchscreen/defconfig
+++ b/nuttx/configs/sim/touchscreen/defconfig
@@ -58,6 +58,7 @@ CONFIG_SIM_TOUCHSCREEN=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="tc_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/skp16c26/ostest/defconfig b/nuttx/configs/skp16c26/ostest/defconfig
index 2c901e34d9..c0ab37c7cd 100644
--- a/nuttx/configs/skp16c26/ostest/defconfig
+++ b/nuttx/configs/skp16c26/ostest/defconfig
@@ -98,6 +98,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3210e-eval/RIDE/defconfig b/nuttx/configs/stm3210e-eval/RIDE/defconfig
index e23446ae66..db01c2da5a 100755
--- a/nuttx/configs/stm3210e-eval/RIDE/defconfig
+++ b/nuttx/configs/stm3210e-eval/RIDE/defconfig
@@ -178,6 +178,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+#CONFIG_USER_ENTRYPOINT=
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3210e-eval/buttons/defconfig b/nuttx/configs/stm3210e-eval/buttons/defconfig
index a458e76534..8bc0e934e0 100644
--- a/nuttx/configs/stm3210e-eval/buttons/defconfig
+++ b/nuttx/configs/stm3210e-eval/buttons/defconfig
@@ -189,6 +189,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="buttons_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3210e-eval/composite/defconfig b/nuttx/configs/stm3210e-eval/composite/defconfig
index 14732772a7..6839e15aad 100755
--- a/nuttx/configs/stm3210e-eval/composite/defconfig
+++ b/nuttx/configs/stm3210e-eval/composite/defconfig
@@ -187,6 +187,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="conn_main"
+#CONFIG_USER_ENTRYPOINT="disconn_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_FS=n
diff --git a/nuttx/configs/stm3210e-eval/nsh/defconfig b/nuttx/configs/stm3210e-eval/nsh/defconfig
index aebd41dfc2..56d2af420b 100755
--- a/nuttx/configs/stm3210e-eval/nsh/defconfig
+++ b/nuttx/configs/stm3210e-eval/nsh/defconfig
@@ -187,6 +187,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3210e-eval/nsh2/defconfig b/nuttx/configs/stm3210e-eval/nsh2/defconfig
index 4ebcba0131..93dbef8a3d 100644
--- a/nuttx/configs/stm3210e-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3210e-eval/nsh2/defconfig
@@ -230,6 +230,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/stm3210e-eval/nx/defconfig b/nuttx/configs/stm3210e-eval/nx/defconfig
index 3de1ddb760..cee087a6c4 100644
--- a/nuttx/configs/stm3210e-eval/nx/defconfig
+++ b/nuttx/configs/stm3210e-eval/nx/defconfig
@@ -187,6 +187,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nx_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/stm3210e-eval/nxconsole/defconfig b/nuttx/configs/stm3210e-eval/nxconsole/defconfig
index 53339ffe6c..5af0985e6f 100644
--- a/nuttx/configs/stm3210e-eval/nxconsole/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxconsole/defconfig
@@ -187,6 +187,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/stm3210e-eval/nxlines/defconfig b/nuttx/configs/stm3210e-eval/nxlines/defconfig
index 044187ea28..a1e3775598 100644
--- a/nuttx/configs/stm3210e-eval/nxlines/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxlines/defconfig
@@ -187,6 +187,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nxlines_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/stm3210e-eval/nxtext/defconfig b/nuttx/configs/stm3210e-eval/nxtext/defconfig
index 2739c1ca77..d5669cdd27 100644
--- a/nuttx/configs/stm3210e-eval/nxtext/defconfig
+++ b/nuttx/configs/stm3210e-eval/nxtext/defconfig
@@ -187,6 +187,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nxtext_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/stm3210e-eval/ostest/defconfig b/nuttx/configs/stm3210e-eval/ostest/defconfig
index 14a36327fc..f9d777ebd4 100755
--- a/nuttx/configs/stm3210e-eval/ostest/defconfig
+++ b/nuttx/configs/stm3210e-eval/ostest/defconfig
@@ -199,6 +199,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3210e-eval/pm/defconfig b/nuttx/configs/stm3210e-eval/pm/defconfig
index b6e1c06d4b..dc5b27cd58 100644
--- a/nuttx/configs/stm3210e-eval/pm/defconfig
+++ b/nuttx/configs/stm3210e-eval/pm/defconfig
@@ -240,6 +240,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_GRAPHICS=n
diff --git a/nuttx/configs/stm3210e-eval/usbserial/defconfig b/nuttx/configs/stm3210e-eval/usbserial/defconfig
index 4aaf8f411b..fef61f6df4 100755
--- a/nuttx/configs/stm3210e-eval/usbserial/defconfig
+++ b/nuttx/configs/stm3210e-eval/usbserial/defconfig
@@ -188,6 +188,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="usbserial_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_USB=n
diff --git a/nuttx/configs/stm3210e-eval/usbstorage/defconfig b/nuttx/configs/stm3210e-eval/usbstorage/defconfig
index ff6eed8bd7..2ab5ed7829 100755
--- a/nuttx/configs/stm3210e-eval/usbstorage/defconfig
+++ b/nuttx/configs/stm3210e-eval/usbstorage/defconfig
@@ -187,6 +187,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_FS=n
diff --git a/nuttx/configs/stm3220g-eval/dhcpd/defconfig b/nuttx/configs/stm3220g-eval/dhcpd/defconfig
index bd0fe82381..d7d3c8aa93 100644
--- a/nuttx/configs/stm3220g-eval/dhcpd/defconfig
+++ b/nuttx/configs/stm3220g-eval/dhcpd/defconfig
@@ -241,6 +241,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="dhcpd_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3220g-eval/nettest/defconfig b/nuttx/configs/stm3220g-eval/nettest/defconfig
index 9a6d760675..44e9cf7cd8 100644
--- a/nuttx/configs/stm3220g-eval/nettest/defconfig
+++ b/nuttx/configs/stm3220g-eval/nettest/defconfig
@@ -241,6 +241,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3220g-eval/nsh/defconfig b/nuttx/configs/stm3220g-eval/nsh/defconfig
index 226c65d26f..f40dffeebd 100644
--- a/nuttx/configs/stm3220g-eval/nsh/defconfig
+++ b/nuttx/configs/stm3220g-eval/nsh/defconfig
@@ -264,6 +264,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3220g-eval/nsh2/defconfig b/nuttx/configs/stm3220g-eval/nsh2/defconfig
index 49f92aebe2..522840f228 100644
--- a/nuttx/configs/stm3220g-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3220g-eval/nsh2/defconfig
@@ -264,6 +264,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3220g-eval/nxwm/defconfig b/nuttx/configs/stm3220g-eval/nxwm/defconfig
index bb5155fe5a..f3ef33377a 100644
--- a/nuttx/configs/stm3220g-eval/nxwm/defconfig
+++ b/nuttx/configs/stm3220g-eval/nxwm/defconfig
@@ -264,6 +264,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3220g-eval/ostest/defconfig b/nuttx/configs/stm3220g-eval/ostest/defconfig
index d141b9c409..35e52507c3 100644
--- a/nuttx/configs/stm3220g-eval/ostest/defconfig
+++ b/nuttx/configs/stm3220g-eval/ostest/defconfig
@@ -241,6 +241,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3220g-eval/telnetd/defconfig b/nuttx/configs/stm3220g-eval/telnetd/defconfig
index 90ed21bec4..0b3f350777 100644
--- a/nuttx/configs/stm3220g-eval/telnetd/defconfig
+++ b/nuttx/configs/stm3220g-eval/telnetd/defconfig
@@ -241,6 +241,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="shell_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/dhcpd/defconfig b/nuttx/configs/stm3240g-eval/dhcpd/defconfig
index 35a7140e48..e79f774df1 100644
--- a/nuttx/configs/stm3240g-eval/dhcpd/defconfig
+++ b/nuttx/configs/stm3240g-eval/dhcpd/defconfig
@@ -247,6 +247,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="dhcpd_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/nettest/defconfig b/nuttx/configs/stm3240g-eval/nettest/defconfig
index 54d5f3fa8b..d4ba400ced 100644
--- a/nuttx/configs/stm3240g-eval/nettest/defconfig
+++ b/nuttx/configs/stm3240g-eval/nettest/defconfig
@@ -247,6 +247,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nettest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig
index 3e27810aa8..eab1cef665 100644
--- a/nuttx/configs/stm3240g-eval/nsh/defconfig
+++ b/nuttx/configs/stm3240g-eval/nsh/defconfig
@@ -270,6 +270,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/nsh2/defconfig b/nuttx/configs/stm3240g-eval/nsh2/defconfig
index 8e8c0fb8cb..b06ae45b73 100644
--- a/nuttx/configs/stm3240g-eval/nsh2/defconfig
+++ b/nuttx/configs/stm3240g-eval/nsh2/defconfig
@@ -271,6 +271,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/nxconsole/defconfig b/nuttx/configs/stm3240g-eval/nxconsole/defconfig
index ec66b3f99e..36273579f6 100644
--- a/nuttx/configs/stm3240g-eval/nxconsole/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxconsole/defconfig
@@ -270,6 +270,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/nxwm/defconfig b/nuttx/configs/stm3240g-eval/nxwm/defconfig
index 9f93fbf273..2e8bceb10e 100644
--- a/nuttx/configs/stm3240g-eval/nxwm/defconfig
+++ b/nuttx/configs/stm3240g-eval/nxwm/defconfig
@@ -270,6 +270,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/ostest/defconfig b/nuttx/configs/stm3240g-eval/ostest/defconfig
index b38005e4dd..e4bc6923b8 100644
--- a/nuttx/configs/stm3240g-eval/ostest/defconfig
+++ b/nuttx/configs/stm3240g-eval/ostest/defconfig
@@ -246,6 +246,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm3240g-eval/telnetd/defconfig b/nuttx/configs/stm3240g-eval/telnetd/defconfig
index 26686968a3..5de905c043 100644
--- a/nuttx/configs/stm3240g-eval/telnetd/defconfig
+++ b/nuttx/configs/stm3240g-eval/telnetd/defconfig
@@ -247,6 +247,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="shell_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm32f4discovery/nsh/defconfig b/nuttx/configs/stm32f4discovery/nsh/defconfig
index 16c9ea6491..47e4aeca65 100644
--- a/nuttx/configs/stm32f4discovery/nsh/defconfig
+++ b/nuttx/configs/stm32f4discovery/nsh/defconfig
@@ -244,6 +244,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm32f4discovery/nxlines/defconfig b/nuttx/configs/stm32f4discovery/nxlines/defconfig
index 4c34a26a7f..b57d72be1e 100644
--- a/nuttx/configs/stm32f4discovery/nxlines/defconfig
+++ b/nuttx/configs/stm32f4discovery/nxlines/defconfig
@@ -244,6 +244,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nxlines_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm32f4discovery/ostest/defconfig b/nuttx/configs/stm32f4discovery/ostest/defconfig
index 094a1c4855..0ff024904f 100644
--- a/nuttx/configs/stm32f4discovery/ostest/defconfig
+++ b/nuttx/configs/stm32f4discovery/ostest/defconfig
@@ -227,6 +227,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/stm32f4discovery/pm/defconfig b/nuttx/configs/stm32f4discovery/pm/defconfig
index 8d469b4c7e..6999949479 100644
--- a/nuttx/configs/stm32f4discovery/pm/defconfig
+++ b/nuttx/configs/stm32f4discovery/pm/defconfig
@@ -245,6 +245,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sure-pic32mx/nsh/defconfig b/nuttx/configs/sure-pic32mx/nsh/defconfig
index 41263d4cf0..d52bf55090 100644
--- a/nuttx/configs/sure-pic32mx/nsh/defconfig
+++ b/nuttx/configs/sure-pic32mx/nsh/defconfig
@@ -167,6 +167,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
diff --git a/nuttx/configs/sure-pic32mx/ostest/defconfig b/nuttx/configs/sure-pic32mx/ostest/defconfig
index b6d74f4bfe..ce09306f0c 100644
--- a/nuttx/configs/sure-pic32mx/ostest/defconfig
+++ b/nuttx/configs/sure-pic32mx/ostest/defconfig
@@ -161,6 +161,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/sure-pic32mx/usbnsh/defconfig b/nuttx/configs/sure-pic32mx/usbnsh/defconfig
index a57c85636f..76704a121a 100644
--- a/nuttx/configs/sure-pic32mx/usbnsh/defconfig
+++ b/nuttx/configs/sure-pic32mx/usbnsh/defconfig
@@ -167,6 +167,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
diff --git a/nuttx/configs/teensy/hello/defconfig b/nuttx/configs/teensy/hello/defconfig
index 9a4bfdc7d9..aa61354717 100644
--- a/nuttx/configs/teensy/hello/defconfig
+++ b/nuttx/configs/teensy/hello/defconfig
@@ -110,6 +110,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="hello_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/teensy/nsh/defconfig b/nuttx/configs/teensy/nsh/defconfig
index d27d89c526..7108d27fee 100755
--- a/nuttx/configs/teensy/nsh/defconfig
+++ b/nuttx/configs/teensy/nsh/defconfig
@@ -110,6 +110,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/teensy/usbstorage/defconfig b/nuttx/configs/teensy/usbstorage/defconfig
index c736f98d0b..87931ee248 100755
--- a/nuttx/configs/teensy/usbstorage/defconfig
+++ b/nuttx/configs/teensy/usbstorage/defconfig
@@ -110,6 +110,8 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="msconn_main"
+#CONFIG_USER_ENTRYPOINT="msdis_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/twr-k60n512/nsh/defconfig b/nuttx/configs/twr-k60n512/nsh/defconfig
index 024390eb77..d5e491dc25 100644
--- a/nuttx/configs/twr-k60n512/nsh/defconfig
+++ b/nuttx/configs/twr-k60n512/nsh/defconfig
@@ -184,6 +184,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/twr-k60n512/ostest/defconfig b/nuttx/configs/twr-k60n512/ostest/defconfig
index fcbb1d7900..af92b70b18 100644
--- a/nuttx/configs/twr-k60n512/ostest/defconfig
+++ b/nuttx/configs/twr-k60n512/ostest/defconfig
@@ -184,6 +184,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ubw32/nsh/defconfig b/nuttx/configs/ubw32/nsh/defconfig
index f54a68de15..c198067df5 100644
--- a/nuttx/configs/ubw32/nsh/defconfig
+++ b/nuttx/configs/ubw32/nsh/defconfig
@@ -160,6 +160,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/ubw32/ostest/defconfig b/nuttx/configs/ubw32/ostest/defconfig
index e9af9b5de3..dcbdc88ba0 100644
--- a/nuttx/configs/ubw32/ostest/defconfig
+++ b/nuttx/configs/ubw32/ostest/defconfig
@@ -160,6 +160,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/us7032evb1/nsh/defconfig b/nuttx/configs/us7032evb1/nsh/defconfig
index fabf35b1a6..f685371cb9 100644
--- a/nuttx/configs/us7032evb1/nsh/defconfig
+++ b/nuttx/configs/us7032evb1/nsh/defconfig
@@ -100,6 +100,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/us7032evb1/ostest/defconfig b/nuttx/configs/us7032evb1/ostest/defconfig
index 924efb8a0e..8ecf50ea1b 100644
--- a/nuttx/configs/us7032evb1/ostest/defconfig
+++ b/nuttx/configs/us7032evb1/ostest/defconfig
@@ -100,6 +100,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/vsn/nsh/defconfig b/nuttx/configs/vsn/nsh/defconfig
index f3f9881f45..5fbf2c7994 100755
--- a/nuttx/configs/vsn/nsh/defconfig
+++ b/nuttx/configs/vsn/nsh/defconfig
@@ -227,6 +227,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=y
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/xtrs/nsh/defconfig b/nuttx/configs/xtrs/nsh/defconfig
index 53e99e1607..748e766e20 100644
--- a/nuttx/configs/xtrs/nsh/defconfig
+++ b/nuttx/configs/xtrs/nsh/defconfig
@@ -64,6 +64,7 @@ CONFIG_LINKER_ROM_AT_0000=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/xtrs/ostest/defconfig b/nuttx/configs/xtrs/ostest/defconfig
index b5ac8b0352..97c0aaaedf 100644
--- a/nuttx/configs/xtrs/ostest/defconfig
+++ b/nuttx/configs/xtrs/ostest/defconfig
@@ -64,6 +64,7 @@ CONFIG_LINKER_ROM_AT_0000=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/xtrs/pashello/defconfig b/nuttx/configs/xtrs/pashello/defconfig
index d3f4be1872..8ac23069f9 100644
--- a/nuttx/configs/xtrs/pashello/defconfig
+++ b/nuttx/configs/xtrs/pashello/defconfig
@@ -64,6 +64,7 @@ CONFIG_LINKER_ROM_AT_0000=y
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="pashello_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z16f2800100zcog/ostest/defconfig b/nuttx/configs/z16f2800100zcog/ostest/defconfig
index 751e1805e7..24e228a4b7 100644
--- a/nuttx/configs/z16f2800100zcog/ostest/defconfig
+++ b/nuttx/configs/z16f2800100zcog/ostest/defconfig
@@ -78,6 +78,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z16f2800100zcog/pashello/defconfig b/nuttx/configs/z16f2800100zcog/pashello/defconfig
index 1fc2275567..95cb6f09b3 100644
--- a/nuttx/configs/z16f2800100zcog/pashello/defconfig
+++ b/nuttx/configs/z16f2800100zcog/pashello/defconfig
@@ -78,6 +78,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="pashello_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z80sim/nsh/defconfig b/nuttx/configs/z80sim/nsh/defconfig
index f6f46b24aa..a91a7a5783 100644
--- a/nuttx/configs/z80sim/nsh/defconfig
+++ b/nuttx/configs/z80sim/nsh/defconfig
@@ -60,6 +60,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z80sim/ostest/defconfig b/nuttx/configs/z80sim/ostest/defconfig
index cc070e8fc0..a179cacfd8 100644
--- a/nuttx/configs/z80sim/ostest/defconfig
+++ b/nuttx/configs/z80sim/ostest/defconfig
@@ -60,6 +60,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z80sim/pashello/defconfig b/nuttx/configs/z80sim/pashello/defconfig
index 2080b26358..d3b961b4af 100644
--- a/nuttx/configs/z80sim/pashello/defconfig
+++ b/nuttx/configs/z80sim/pashello/defconfig
@@ -60,6 +60,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="pashello_main"
CONFIG_DEBUG=n
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z8encore000zco/ostest/defconfig b/nuttx/configs/z8encore000zco/ostest/defconfig
index c59b266b2c..c193790972 100644
--- a/nuttx/configs/z8encore000zco/ostest/defconfig
+++ b/nuttx/configs/z8encore000zco/ostest/defconfig
@@ -76,6 +76,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/configs/z8f64200100kit/ostest/defconfig b/nuttx/configs/z8f64200100kit/ostest/defconfig
index 841d2e90ba..5108247230 100644
--- a/nuttx/configs/z8f64200100kit/ostest/defconfig
+++ b/nuttx/configs/z8f64200100kit/ostest/defconfig
@@ -76,6 +76,7 @@ CONFIG_HAVE_LIBM=n
#
# General OS setup
#
+CONFIG_USER_ENTRYPOINT="ostest_main"
CONFIG_DEBUG=y
CONFIG_DEBUG_VERBOSE=n
CONFIG_DEBUG_SYMBOLS=n
diff --git a/nuttx/include/assert.h b/nuttx/include/assert.h
index 89606b6f6a..31c9edf48d 100644
--- a/nuttx/include/assert.h
+++ b/nuttx/include/assert.h
@@ -91,6 +91,10 @@
#endif
+#ifndef assert
+#define assert ASSERT
+#endif
+
/****************************************************************************
* Included Files
****************************************************************************/
diff --git a/nuttx/include/nuttx/init.h b/nuttx/include/nuttx/init.h
index ecdad702f5..2d1b3c693c 100644
--- a/nuttx/include/nuttx/init.h
+++ b/nuttx/include/nuttx/init.h
@@ -68,7 +68,7 @@ extern "C" {
/* This entry point must be supplied by the application */
-EXTERN int user_start(int argc, char *argv[]);
+EXTERN int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]);
/* Functions contained in os_task.c *****************************************/
diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig
index 9d7a38549d..37ce0ebd61 100644
--- a/nuttx/sched/Kconfig
+++ b/nuttx/sched/Kconfig
@@ -202,6 +202,14 @@ config SCHED_ONEXIT_MAX
is supported. That number can be increased by defined this setting to the
number that you require.
+config USER_ENTRYPOINT
+ string "Appliation entry point"
+ default "user_start"
+ ---help---
+ The name of the entry point for user applications. For the example
+ applications this is of the form 'app_main' where 'app' is the application
+ name. If not defined, USER_ENTRYPOINT defaults to "user_start."
+
config DISABLE_OS_API
bool "Disable NuttX interfaces"
default y
diff --git a/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c
index 646f491583..d6d9431377 100644
--- a/nuttx/sched/os_bringup.c
+++ b/nuttx/sched/os_bringup.c
@@ -71,12 +71,6 @@
* then the default entry point is user_start.
*/
-#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_USER_ENTRYPOINT)
-# define USER_ENTRYPOINT (main_t)CONFIG_USER_ENTRYPOINT
-#else
-# define USER_ENTRYPOINT user_start
-#endif
-
/****************************************************************************
* Private Types
****************************************************************************/
@@ -175,11 +169,11 @@ int os_bringup(void)
init_taskid = exec_namedapp(CONFIG_BUILTIN_APP_START, argv);
#else
- /* Start the default application at USER_ENTRYPOINT() */
+ /* Start the default application at CONFIG_USER_ENTRYPOINT() */
init_taskid = TASK_CREATE("init", SCHED_PRIORITY_DEFAULT,
CONFIG_USERMAIN_STACKSIZE,
- (main_t)USER_ENTRYPOINT, (const char **)NULL);
+ (main_t)CONFIG_USER_ENTRYPOINT, (const char **)NULL);
#endif
ASSERT(init_taskid != ERROR);
return OK;
diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk
index 004a7e5bdd..07d88392ec 100644
--- a/nuttx/tools/Config.mk
+++ b/nuttx/tools/Config.mk
@@ -33,6 +33,9 @@
#
############################################################################
-CONFIG_ARCH := $(shell echo $(CONFIG_ARCH))
-CONFIG_ARCH_CHIP := $(shell echo $(CONFIG_ARCH_CHIP))
-CONFIG_ARCH_BOARD := $(shell echo $(CONFIG_ARCH_BOARD))
+# These are configuration variables that are quoted by configuration tool
+# but which must be unquoated when used in the build system.
+
+CONFIG_ARCH := $(patsubst "%",%,$(strip $(CONFIG_ARCH)))
+CONFIG_ARCH_CHIP := $(patsubst "%",%,$(strip $(CONFIG_ARCH_CHIP)))
+CONFIG_ARCH_BOARD := $(patsubst "%",%,$(strip $(CONFIG_ARCH_BOARD)))
diff --git a/nuttx/tools/cfgparser.c b/nuttx/tools/cfgparser.c
index 655fac5739..e49b29d5e4 100644
--- a/nuttx/tools/cfgparser.c
+++ b/nuttx/tools/cfgparser.c
@@ -52,21 +52,41 @@
char line[LINESIZE+1];
/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* These are configuration variable name that are quoted by configuration tool
+ * but which must be unquoated when used in C code.
+ */
+
+static const char *dequote_list[] =
+{
+ "CONFIG_USER_ENTRYPOINT",
+ NULL
+};
+
+ /****************************************************************************
* Private Functions
****************************************************************************/
+ /* Skip over any spaces */
+
static char *skip_space(char *ptr)
{
while (*ptr && isspace((int)*ptr)) ptr++;
return ptr;
}
+/* Find the end of a variable string */
+
static char *find_name_end(char *ptr)
{
while (*ptr && (isalnum((int)*ptr) || *ptr == '_')) ptr++;
return ptr;
}
+/* Find the end of a value string */
+
static char *find_value_end(char *ptr)
{
while (*ptr && !isspace((int)*ptr))
@@ -84,6 +104,8 @@ static char *find_value_end(char *ptr)
return ptr;
}
+/* Read the next line from the configuration file */
+
static char *read_line(FILE *stream)
{
char *ptr;
@@ -106,31 +128,127 @@ static char *read_line(FILE *stream)
}
}
+/* Parse the line from the configuration file into a variable name
+ * string and a value string.
+ */
+
static void parse_line(char *ptr, char **varname, char **varval)
{
- *varname = ptr;
+ /* Skip over any leading spaces */
+
+ ptr = skip_space(ptr);
+
+ /* The first no-space is the beginning of the variable name */
+
+ *varname = skip_space(ptr);
*varval = NULL;
- ptr = find_name_end(ptr);
- if (*ptr && *ptr != '=')
+ /* Parse to the end of the variable name */
+
+ ptr = find_name_end(ptr);
+
+ /* An equal sign is expected next, perhaps after some white space */
+
+ if (*ptr && *ptr != '=')
{
+ /* Some else follows the variable name. Terminate the variable
+ * name and skip over any spaces.
+ */
+
*ptr = '\0';
ptr = skip_space(ptr + 1);
}
+ /* Verify that the equal sign is present */
+
if (*ptr == '=')
{
+ /* Make sure that the variable name is terminated (this was already
+ * done if the name was followed by white space.
+ */
+
*ptr = '\0';
+
+ /* The variable value should follow =, perhaps separated by some
+ * white space.
+ */
+
ptr = skip_space(ptr + 1);
if (*ptr)
{
+ /* Yes.. a variable follows. Save the pointer to the start
+ * of the variable string.
+ */
+
*varval = ptr;
+
+ /* Find the end of the variable string and make sure that it
+ * is terminated.
+ */
+
ptr = find_value_end(ptr);
*ptr = '\0';
}
}
}
+static char *dequote_value(const char *varname, char *varval)
+{
+ const char **dqnam;
+ char *dqval = varval;
+ int len;
+
+ if (dqval)
+ {
+ /* Check if the variable name is in the list of strings to be dequoated */
+
+ for (dqnam = dequote_list; *dqnam; dqnam++)
+ {
+ if (strcmp(*dqnam, varname) == 0)
+ {
+ break;
+ }
+ }
+
+ /* Did we find the variable name in the list of configuration variables
+ * to be dequoated?
+ */
+
+ if (*dqnam)
+ {
+ /* Yes... Check if there is a traiing quote */
+
+ len = strlen(dqval);
+ if (dqval[len-1] == '"')
+ {
+ /* Yes... replace it with a terminator */
+
+ dqval[len-1] = '\0';
+ len--;
+ }
+
+ /* Is there a leading quote? */
+
+ if (dqval[0] == '"')
+ {
+ /* Yes.. skip over the leading quote */
+
+ dqval++;
+ len--;
+ }
+
+ /* Handle the case where nothing is left after dequoting */
+
+ if (len < 0)
+ {
+ dqval = NULL;
+ }
+ }
+ }
+
+ return dqval;
+}
+
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -141,22 +259,47 @@ void parse_file(FILE *stream)
char *varval;
char *ptr;
+ /* Loop until the entire file has been parsed. */
+
do
{
+ /* Read the next line from the file */
+
ptr = read_line(stream);
if (ptr)
{
+ /* Parse the line into a variable and a value field */
+
parse_line(ptr, &varname, &varval);
+
+ /* Was a variable name found? */
+
if (varname)
{
+ /* Yes.. dequote the value if necessary */
+
+ varval = dequote_value(varname, varval);
+
+ /* If no value was provided or if the special value 'n' was provided,
+ * then undefine the configuration variable.
+ */
+
if (!varval || strcmp(varval, "n") == 0)
{
printf("#undef %s\n", varname);
}
+
+ /* Simply define the configuration variable if it has the special
+ * value "y"
+ */
+
else if (strcmp(varval, "y") == 0)
{
printf("#define %s 1\n", varname);
}
+
+ /* Otherwise, use the value as provided */
+
else
{
printf("#define %s %s\n", varname, varval);
diff --git a/nuttx/tools/mkconfig.c b/nuttx/tools/mkconfig.c
index b3749266c1..2d2fff5c56 100644
--- a/nuttx/tools/mkconfig.c
+++ b/nuttx/tools/mkconfig.c
@@ -44,7 +44,7 @@
#include "cfgparser.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
#define DEFCONFIG ".config"
@@ -265,6 +265,12 @@ int main(int argc, char **argv, char **envp)
printf("# undef CONFIG_DEBUG_SPI\n");
printf("# undef CONFIG_DEBUG_STACK\n");
printf("#endif\n\n");
+ printf("/* User entry point. This is provided as a fall-back to keep compatibility\n");
+ printf(" * with existing code, for builds which do not define CONFIG_USER_ENTRYPOINT.\n");
+ printf(" */\n\n");
+ printf("#ifndef CONFIG_USER_ENTRYPOINT\n");
+ printf("# define CONFIG_USER_ENTRYPOINT user_start\n");
+ printf("#endif\n\n");
printf("#endif /* __INCLUDE_NUTTX_CONFIG_H */\n");
fclose(stream);
return 0;