Remove illegal calls into OS to initialize BINFMT support. This must be moved to the board initialization logic within the OS.

This commit is contained in:
anchao 2018-08-22 07:53:15 -06:00 committed by Gregory Nutt
parent 5d72cae1d9
commit 9fe6d2e1c3
3 changed files with 0 additions and 67 deletions

View File

@ -53,7 +53,6 @@
#include <errno.h>
#include <nuttx/drivers/ramdisk.h>
#include <nuttx/binfmt/elf.h>
#include <nuttx/binfmt/symtab.h>
#include "filesystem/romfs.h"
@ -248,18 +247,6 @@ int spawn_main(int argc, char *argv[])
mm_initmonitor();
/* Initialize the ELF binary loader */
message("Initializing the ELF binary loader\n");
ret = elf_initialize();
if (ret < 0)
{
errmsg("ERROR: Initialization of the ELF loader failed: %d\n", ret);
exit(1);
}
mm_update(&g_mmstep, "after elf_initialize");
/* Create a ROM disk for the ROMFS filesystem */
message("Registering romdisk at /dev/ram%d\n", CONFIG_EXAMPLES_ELF_DEVMINOR);
@ -268,7 +255,6 @@ int spawn_main(int argc, char *argv[])
if (ret < 0)
{
errmsg("ERROR: romdisk_register failed: %d\n", ret);
elf_uninitialize();
exit(1);
}
@ -284,7 +270,6 @@ int spawn_main(int argc, char *argv[])
{
errmsg("ERROR: mount(%s,%s,romfs) failed: %s\n",
CONFIG_EXAMPLES_ELF_DEVPATH, MOUNTPT, errno);
elf_uninitialize();
}
mm_update(&g_mmstep, "after mount");
@ -477,8 +462,6 @@ int spawn_main(int argc, char *argv[])
/* Clean-up */
elf_uninitialize();
mm_update(&g_mmstep, "End-of-Test");
return 0;
}

View File

@ -58,15 +58,9 @@
#include "netutils/thttpd.h"
#include <nuttx/drivers/ramdisk.h>
#include <nuttx/binfmt/binfmt.h>
#ifdef CONFIG_THTTPD_NXFLAT
# include <nuttx/binfmt/nxflat.h>
#endif
#ifdef CONFIG_THTTPD_BINFS
# include <nuttx/fs/unionfs.h>
# include <nuttx/binfmt/builtin.h>
#endif
#ifdef CONFIG_NET_SLIP
@ -260,18 +254,6 @@ int thttp_main(int argc, char *argv[])
netlib_ifup("eth0");
#ifdef CONFIG_THTTPD_NXFLAT
/* Initialize the NXFLAT binary loader */
printf("Initializing the NXFLAT binary loader\n");
ret = nxflat_initialize();
if (ret < 0)
{
printf("ERROR: Initialization of the NXFLAT loader failed: %d\n", ret);
exit(2);
}
#endif
/* Create a ROM disk for the ROMFS filesystem */
printf("Registering romdisk\n");
@ -280,9 +262,6 @@ int thttp_main(int argc, char *argv[])
if (ret < 0)
{
printf("ERROR: romdisk_register failed: %d\n", ret);
#ifdef CONFIG_THTTPD_NXFLAT
nxflat_uninitialize();
#endif
exit(1);
}
@ -296,23 +275,9 @@ int thttp_main(int argc, char *argv[])
{
printf("ERROR: mount(%s,%s,romfs) failed: %d\n",
ROMFSDEV, ROMFS_MOUNTPT, errno);
#ifdef CONFIG_THTTPD_NXFLAT
nxflat_uninitialize();
#endif
}
#ifdef CONFIG_THTTPD_BINFS
/* Initialize the BINFS binary loader */
printf("Initializing the Built-In binary loader\n");
ret = builtin_initialize();
if (ret < 0)
{
printf("ERROR: Initialization of the Built-In loader failed: %d\n", ret);
exit(2);
}
/* Mount the BINFS file system */
printf("Mounting BINFS filesystem at %s\n", BINFS_MOUNTPT);

View File

@ -46,10 +46,6 @@
#include <sched.h>
#include <errno.h>
#if defined(CONFIG_FS_BINFS) && (CONFIG_BUILTIN)
# include <nuttx/binfmt/builtin.h>
#endif
#if defined(CONFIG_LIBC_EXECFUNCS)
# include <nuttx/binfmt/symtab.h>
#endif
@ -215,17 +211,6 @@ static int nsh_task(void)
(void)boardctl(BOARDIOC_APP_SYMTAB, (uintptr_t)&symdesc);
#endif
#if defined(CONFIG_FS_BINFS) && (CONFIG_BUILTIN)
/* Register the BINFS file system */
ret = builtin_initialize();
if (ret < 0)
{
fprintf(stderr, "ERROR: builtin_initialize failed: %d\n", ret);
exitval = 1;
}
#endif
/* Initialize the NSH library */
nsh_initialize();