X-Git-Url: http://rtime.felk.cvut.cz/gitweb/rtems-devel.git/blobdiff_plain/bdbb41b7f3c3d1e9a4c339dd0866e33a009e4050..ed88b855399a4f66900e4f5d82b9e3951de88cec:/rtems-omk-template/appsmptest/init.c diff --git a/rtems-omk-template/appsmptest/init.c b/rtems-omk-template/appsmptest/init.c new file mode 100644 index 0000000..0773fce --- /dev/null +++ b/rtems-omk-template/appsmptest/init.c @@ -0,0 +1,152 @@ +/* Init + * + * This routine is the initialization task for this test program. + * It is called from init_exec and has the responsibility for creating + * and starting the tasks that make up the test. If the time of day + * clock is required for the test, it should also be set to a known + * value by this function. + * + * Input parameters: NONE + * + * Output parameters: NONE + * + * COPYRIGHT (c) 1989-1999. + * 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.com/license/LICENSE. + * + * $Id: init.c,v 1.12.4.1 2003/09/04 18:46:30 joel Exp $ + */ + +#define CONFIGURE_INIT +#include +#include "system.h" +#include "app_def.h" +#include +#include +#include +#include +#include + +#define CONFIGURE_SHELL_COMMANDS_INIT +#define CONFIGURE_SHELL_COMMANDS_ALL +#define CONFIGURE_SHELL_MOUNT_MSDOS + +#include + +#define BUILD_VERSION_STRING(major,minor,patch) \ + __XSTRING(major) "." __XSTRING(minor) "." __XSTRING(patch) + +#define RTEMS_VER_CODE VER_CODE(__RTEMS_MAJOR__ ,__RTEMS_MINOR__ ,__RTEMS_REVISION__) + +#if RTEMS_VER_CODE < VER_CODE(4,7,99) + #define rtems_shell_add_cmd shell_add_cmd + #define rtems_shell_init(m_task_name,m_task_stacksize,m_task_priority,m_devname,m_forever,m_wait,m_login_check) \ + shell_init(m_task_name,m_task_stacksize,m_task_priority,m_devname,B19200 | CS8,m_forever) +#elif RTEMS_VER_CODE < VER_CODE(4,9,99) + #define rtems_shell_init(m_task_name,m_task_stacksize,m_task_priority,m_devname,m_forever,m_wait,m_login_check) \ + rtems_shell_init(m_task_name,m_task_stacksize,m_task_priority,m_devname,m_forever,m_wait) +#endif + +void +bad_rtems_status(rtems_status_code status, int fail_level, const char *text) +{ + printf("ERROR: %s status %s", text, rtems_status_text(status)); + status = rtems_task_delete( RTEMS_SELF ); +} + +int testcmd_forshell(int argc, char **argv) +{ + int i; + printf("Command %s called\n",argv[0]); + for(i=1;i