From e870941bb0f2f300e8fd252c7e30ecaabbe50841 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 4 Dec 2014 09:38:27 +0100 Subject: libmisc: More useful default configuration The dummy.c was a de-facto default configuration. Rename it to default-configuration.c. Use unlimited objects and the stack checker. This makes it easier for new RTEMS users which will likely use this file if they just work with the usual main() function as the application entry point. Provide proper arguments for main() using the BSP command line. Add spare user extensions and drivers. Do not initialize the network by default. Delete bspinit.c. --- c/src/lib/libbsp/shared/bspinit.c | 98 --------------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 c/src/lib/libbsp/shared/bspinit.c (limited to 'c/src/lib/libbsp/shared/bspinit.c') diff --git a/c/src/lib/libbsp/shared/bspinit.c b/c/src/lib/libbsp/shared/bspinit.c deleted file mode 100644 index b524389de2..0000000000 --- a/c/src/lib/libbsp/shared/bspinit.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * COPYRIGHT (c) 1989-2009. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include -#include - -#include -#include -#ifdef RTEMS_NETWORKING - #include -#endif - -/* - * Necessary prototypes - */ -rtems_task Init (rtems_task_argument arg); -int main (int argc, char* argv[]); - -/* - * This routine calls main from a confdefs.h default Init task - * set up. The bootcard will provide the task argument as - * command line string (ASCIIZ). - */ - -rtems_task Init (rtems_task_argument arg) -{ - const char* boot_cmdline = *((const char**) arg); - char* cmdline = 0; - char* command; - int argc = 0; - char** argv = NULL; - int result = -124; - - if (boot_cmdline) { - cmdline = malloc (strlen (boot_cmdline) + 1); - - if (cmdline) { - strcpy (cmdline, boot_cmdline); - - command = cmdline; - - /* - * Break the line up into arguments with "" being ignored. - */ - while (true) { - command = strtok (command, " \t\r\n"); - if (command == NULL) - break; - argc++; - command = '\0'; - } - - /* - * If there are arguments, allocate enough memory for the argv - * array to be passed into main(). - * - * NOTE: If argc is 0, then argv will be NULL. - */ - argv = calloc (argc, sizeof (char*)); - - if (argv) { - int a; - - command = cmdline; - argv[0] = command; - - for (a = 1; a < argc; a++) { - command += strlen (command) + 1; - argv[a] = command; - } - } else - argc = 0; - } - } - -#ifdef RTEMS_NETWORKING - rtems_bsdnet_initialize_network (); -#endif - - result = main (argc, argv); - - free (argv); - free (cmdline); - - exit (result); -} - -/* - * By making this a weak alias and a user can provide there own. - */ - -void Init (rtems_task_argument arg) __attribute__ ((weak)); -- cgit v1.2.3