Move program control to thread structure

This commit is contained in:
Sebastian Huber
2013-10-17 10:38:34 +02:00
parent c333babc98
commit d01564c473
14 changed files with 558 additions and 115 deletions

View File

@@ -114,25 +114,6 @@ static struct afswtch *af_getbyname(const char *name);
static struct afswtch *af_getbyfamily(int af);
static void af_other_status(int);
#ifdef __rtems__
static int main_ifconfig(int argc, char *argv[]);
static int rtems_shell_main_ifconfig(int argc, char *argv[])
{
rtems_shell_globals_t ifconfig_globals;
rtems_shell_globals = &ifconfig_globals;
memset (rtems_shell_globals, 0, sizeof (ifconfig_globals));
descr = NULL;
descrlen = 64;
newaddr = 1;
supmedia = 0;
printkeys = 0;
ifconfig_globals.exit_code = 1;
if (setjmp (ifconfig_globals.exit_jmp) == 0)
return main_ifconfig ( argc, argv);
return ifconfig_globals.exit_code;
}
#endif
#ifdef __rtems__
static struct ifconfig_option *opts = NULL;
@@ -182,12 +163,23 @@ usage(void)
}
#ifdef __rtems__
int
main_ifconfig(int argc, char *argv[])
#else
#include <machine/rtems-bsd-program.h>
static int main(int argc, char *argv[]);
static int rtems_shell_main_ifconfig(int argc, char *argv[])
{
descr = NULL;
descrlen = 64;
newaddr = 1;
supmedia = 0;
printkeys = 0;
return rtems_bsd_program_call_main("ifconfig", main, argc, argv);
}
#endif /* __rtems__ */
int
main(int argc, char *argv[])
#endif
{
int c, all, namesonly, downonly, uponly;
const struct afswtch *afp = NULL;