configs: Several applications in apps/ were callign elf_initialize() nxflat_initialize(), or builtin_initialize() in violation of the portable POSIX interface. Those calls were removed from the applications and added to the appropriate board initialization with this commit.

This commit is contained in:
Gregory Nutt 2018-08-22 08:30:36 -06:00
parent b56d5a7548
commit e3a1d4213c
12 changed files with 188 additions and 92 deletions

View File

@ -47,6 +47,10 @@
#include <nuttx/spi/spi.h>
#include <nuttx/mmcsd.h>
#ifdef CONFIG_NXFLAT
# include <nuttx/binfmt/nxflat.h>
#endif
#include "tiva_ssi.h"
/****************************************************************************
@ -107,7 +111,7 @@
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
@ -125,6 +129,18 @@ int board_app_initialize(uintptr_t arg)
FAR struct spi_dev_s *spi;
int ret;
#ifdef CONFIG_NXFLAT
/* Initialize the NXFLAT binary loader */
ret = nxflat_initialize();
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Initialization of the NXFLAT loader failed: %d\n",
ret);
}
#endif
/* Get the SPI port */
syslog(LOG_INFO, "Initializing SPI port %d\n",

View File

@ -47,6 +47,10 @@
#include <nuttx/spi/spi.h>
#include <nuttx/mmcsd.h>
#ifdef CONFIG_FS_BINFS
# include <nuttx/binfmt/builtin.h>
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -76,5 +80,17 @@
int board_app_initialize(uintptr_t arg)
{
#ifdef CONFIG_FS_BINFS
/* Initialize the BINFS binary loader */
int ret = builtin_initialize();
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Initialization of the Built-In loader failed: %d\n",
ret);
}
#endif
return OK;
}

View File

@ -47,6 +47,10 @@
#include <nuttx/spi/spi.h>
#include <nuttx/mmcsd.h>
#ifdef CONFIG_NXFLAT
# include <nuttx/binfmt/nxflat.h>
#endif
#include "lpc17_ssp.h"
/****************************************************************************
@ -124,7 +128,7 @@
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
@ -139,11 +143,24 @@
int board_app_initialize(uintptr_t arg)
{
int ret;
#ifdef NSH_HAVEMMCSD
FAR struct spi_dev_s *ssp;
#endif
int ret;
#ifdef CONFIG_NXFLAT
/* Initialize the NXFLAT binary loader */
ret = nxflat_initialize();
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Initialization of the NXFLAT loader failed: %d\n",
ret);
}
#endif
#ifdef NSH_HAVEMMCSD
/* Get the SSP port */
ssp = lpc17_sspbus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);

View File

@ -65,12 +65,16 @@
#endif
#endif
#ifdef CONFIG_STM32_OTGFS
# include "stm32_usbhost.h"
#ifdef CONFIG_AUDIO
# include <nuttx/audio/audio.h>
#endif
#ifdef CONFIG_AUDIO
# include "nuttx/audio/audio.h"
#if defined(CONFIG_FS_BINFS) && (CONFIG_BUILTIN)
# include <nuttx/binfmt/builtin.h>
#endif
#ifdef CONFIG_STM32_OTGFS
# include "stm32_usbhost.h"
#endif
#include "stm32.h"
@ -182,6 +186,17 @@ int board_app_initialize(uintptr_t arg)
#endif
int ret = OK;
#if defined(CONFIG_FS_BINFS) && defined(CONFIG_BUILTIN)
/* Register the BINFS file system */
ret = builtin_initialize();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: builtin_initialize failed: %d\n", ret);
return ret;
}
#endif
/* Configure SPI-based devices */
#ifdef CONFIG_STM32_SPI3

View File

@ -47,6 +47,10 @@
#include <nuttx/board.h>
#include <nuttx/net/ftmac100.h>
#if defined(CONFIG_FS_BINFS) && defined(CONFIG_BUILTIN)
# include <nuttx/binfmt/builtin.h>
#endif
#include <arch/board/board.h>
/****************************************************************************
@ -90,6 +94,16 @@
int board_app_initialize(uintptr_t arg)
{
#ifndef CONFIG_BOARD_INITIALIZE
#if defined(CONFIG_FS_BINFS) && (CONFIG_BUILTIN)
/* Register the BINFS file system */
int ret = builtin_initialize();
if (ret < 0)
{
fprintf(stderr, "ERROR: builtin_initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_NET_FTMAC100
/* Perform board-specific initialization */

View File

@ -73,6 +73,16 @@
#ifdef CONFIG_BOARD_INITIALIZE
void board_initialize(void)
{
#if defined(CONFIG_FS_BINFS) && (CONFIG_BUILTIN)
/* Register the BINFS file system */
int ret = builtin_initialize();
if (ret < 0)
{
fprintf(stderr, "ERROR: builtin_initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_NET_FTMAC100
/* Perform board-specific initialization */

View File

@ -310,11 +310,6 @@ Configuration Sub-Directories
This configuration exercises the poll()/select() text at
examples/poll
thttpd
This builds the THTTPD web server example using the THTTPD and
the examples/thttpd application.
udp
This alternative configuration directory is similar to nettest

View File

@ -1,52 +0,0 @@
# CONFIG_ARCH_LEDS is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="ntosd-dm320"
CONFIG_ARCH_BOARD_NTOSD_DM320=y
CONFIG_ARCH_CHIP_DM320=y
CONFIG_ARM_TOOLCHAIN_CODESOURCERYL=y
CONFIG_BOARD_LOOPSPERMSEC=16945
CONFIG_BOOT_RUNFROMSDRAM=y
CONFIG_DISABLE_MQUEUE=y
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
CONFIG_DM9X_BASE=0xd0000300
CONFIG_DM9X_IRQ=27
CONFIG_EXAMPLES_THTTPD=y
CONFIG_FS_ROMFS=y
CONFIG_IDLETHREAD_STACKSIZE=4096
CONFIG_MAX_TASKS=64
CONFIG_NET=y
CONFIG_NETDEVICES=y
CONFIG_NETUTILS_NETLIB=y
CONFIG_NETUTILS_THTTPD=y
CONFIG_NET_DM90x0=y
CONFIG_NET_ICMP=y
CONFIG_NET_MAX_LISTENPORTS=8
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCP_CONNS=16
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NFILE_STREAMS=8
CONFIG_NSOCKET_DESCRIPTORS=16
CONFIG_NXFLAT=y
CONFIG_PIPES=y
CONFIG_PREALLOC_WDOGS=8
CONFIG_PTHREAD_STACK_DEFAULT=4096
CONFIG_RAM_SIZE=33554432
CONFIG_RAM_START=0x01100000
CONFIG_RAM_VSTART=0x00000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_HPWORK=y
CONFIG_START_DAY=2
CONFIG_START_MONTH=8
CONFIG_START_YEAR=2009
CONFIG_TASK_NAME_SIZE=0
CONFIG_THTTPD_CGI_BYTECOUNT=20000
CONFIG_THTTPD_CGI_PRIORITY=50
CONFIG_THTTPD_CGI_STACKSIZE=1024
CONFIG_UART0_SERIAL_CONSOLE=y
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_USER_ENTRYPOINT="thttp_main"
CONFIG_WDOG_INTRESERVE=0

View File

@ -51,6 +51,10 @@
#include <nuttx/mmcsd.h>
#include <nuttx/usb/usbhost.h>
#ifdef CONFIG_NXFLAT
# include <nuttx/binfmt/nxflat.h>
#endif
#include "lpc17_ssp.h"
#include "lpc17_gpio.h"
#include "lpc17_usbhost.h"
@ -330,7 +334,7 @@ static int nsh_usbhostinitialize(void)
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
@ -347,12 +351,26 @@ int board_app_initialize(uintptr_t arg)
{
int ret;
#ifdef CONFIG_NXFLAT
/* Initialize the NXFLAT binary loader */
ret = nxflat_initialize();
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Initialization of the NXFLAT loader failed: %d\n",
ret);
}
#endif
/* Initialize SPI-based microSD */
ret = nsh_sdinitialize();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to initialize SPI-based SD card: %d\n", ret);
syslog(LOG_ERR,
"ERROR: Failed to initialize SPI-based SD card: %d\n",
ret);
}
/* Initialize USB host */

View File

@ -46,6 +46,10 @@
#include <nuttx/board.h>
#ifdef CONFIG_NXFLAT
# include <nuttx/binfmt/nxflat.h>
#endif
#include "stm32.h"
#include "shenzhou.h"
@ -150,7 +154,7 @@
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
@ -167,9 +171,21 @@ int board_app_initialize(uintptr_t arg)
{
int ret;
/* Initialize and register the W25 FLASH file system. */
#ifdef CONFIG_NXFLAT
/* Initialize the NXFLAT binary loader */
ret = nxflat_initialize();
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Initialization of the NXFLAT loader failed: %d\n",
ret);
}
#endif
#ifdef HAVE_W25
/* Initialize and register the W25 FLASH file system. */
ret = stm32_w25initialize(CONFIG_NSH_W25MINOR);
if (ret < 0)
{
@ -179,9 +195,9 @@ int board_app_initialize(uintptr_t arg)
}
#endif
#ifdef HAVE_MMCSD
/* Initialize the SPI-based MMC/SD slot */
#ifdef HAVE_MMCSD
ret = stm32_sdinitialize(CONFIG_NSH_MMCSDMINOR);
if (ret < 0)
{
@ -191,11 +207,11 @@ int board_app_initialize(uintptr_t arg)
}
#endif
#ifdef HAVE_USBHOST
/* Initialize USB host operation. stm32_usbhost_initialize() starts a thread
* will monitor for USB connection and disconnection events.
*/
#ifdef HAVE_USBHOST
ret = stm32_usbhost_initialize();
if (ret != OK)
{

View File

@ -56,6 +56,10 @@
#include <nuttx/wireless/bluetooth/bt_null.h>
#include <nuttx/wireless/ieee802154/ieee802154_loopback.h>
#if defined(CONFIG_FS_BINFS) && defined(CONFIG_BUILTIN)
# include <nuttx/binfmt/builtin.h>
#endif
#include "up_internal.h"
#include "sim.h"
@ -107,12 +111,39 @@ int sim_bringup(void)
#endif
int ret;
#if defined(CONFIG_FS_BINFS) && defined(CONFIG_BUILTIN)
/* Register the BINFS file system */
ret = builtin_initialize();
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: builtin_initialize failed: %d\n", ret);
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, SIM_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
SIM_PROCFS_MOUNTPOINT, ret);
}
#endif
#ifdef CONFIG_LIB_ZONEINFO_ROMFS
/* Mount the TZ database */
(void)sim_zoneinfo(3);
#endif
#ifdef CONFIG_GRAPHICS_TRAVELER_ROMFSDEMO
/* Special initialization for the Traveler game simulation */
(void)trv_mount_world(0, CONFIG_GRAPHICS_TRAVELER_DEFPATH);
#endif
#ifdef CONFIG_EXAMPLES_GPIO
/* Initialize simulated GPIO drivers */
@ -211,23 +242,6 @@ int sim_bringup(void)
}
#endif
#ifdef CONFIG_GRAPHICS_TRAVELER_ROMFSDEMO
/* Special initialization for the Traveler game simulation */
(void)trv_mount_world(0, CONFIG_GRAPHICS_TRAVELER_DEFPATH);
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, SIM_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at %s: %d\n",
SIM_PROCFS_MOUNTPOINT, ret);
}
#endif
#ifdef NEED_FRAMEBUFFER
/* Initialize and register the simulated framebuffer driver */

View File

@ -52,6 +52,10 @@
#include <nuttx/spi/spi.h>
#include <nuttx/mmcsd.h>
#ifdef CONFIG_NXFLAT
# include <nuttx/binfmt/nxflat.h>
#endif
#include "lpc17_spi.h"
#include "zkit-arm-1769.h"
@ -146,7 +150,7 @@
* arg - The boardctl() argument is passed to the board_app_initialize()
* implementation without modification. The argument has no
* meaning to NuttX; the meaning of the argument is a contract
* between the board-specific initalization logic and the
* between the board-specific initialization logic and the
* matching application logic. The value cold be such things as a
* mode enumeration value, a set of DIP switch switch settings, a
* pointer to configuration data read from a file or serial FLASH,
@ -161,11 +165,24 @@
int board_app_initialize(uintptr_t arg)
{
int ret;
#ifdef CONFIG_NSH_HAVEMMCSD
FAR struct spi_dev_s *spi;
#endif
int ret;
#ifdef CONFIG_NXFLAT
/* Initialize the NXFLAT binary loader */
ret = nxflat_initialize();
if (ret < 0)
{
syslog(LOG_ERR,
"ERROR: Initialization of the NXFLAT loader failed: %d\n",
ret);
}
#endif
#ifdef CONFIG_NSH_HAVEMMCSD
/* Get the SPI port */
spi = lpc17_spibus_initialize(CONFIG_NSH_MMCSDSPIPORTNO);
@ -189,7 +206,7 @@ int board_app_initialize(uintptr_t arg)
return ret;
}
message("Successfuly bound SPI port %d to MMC/SD slot %d\n",
message("Successfully bound SPI port %d to MMC/SD slot %d\n",
CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO);
#endif