source: rtems/testsuites/samples/base_sp/init.c @ 7c1e6942

4.115
Last change on this file since 7c1e6942 was 7c1e6942, checked in by Joel Sherrill <joel.sherrill@…>, on 05/05/11 at 16:45:40

2011-05-05 Joel Sherrill <joel.sherrill@…>

  • base_sp/apptask.c, base_sp/init.c, fileio/init.c, fileio/system.h, nsecs/init.c, ticker/init.c, ticker/system.h, ticker/tasks.c: Remove warnings.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is called from init_exec and has the responsibility for creating
5 *  and starting the tasks that make up the test.  If the time of day
6 *  clock is required for the application, the current time might be
7 *  set by this task.
8 *
9 *  Input parameters:  NONE
10 *
11 *  Output parameters:  NONE
12 *
13 *  COPYRIGHT (c) 1989-2011.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.com/license/LICENSE.
19 *
20 *  $Id$
21 */
22
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#define CONFIGURE_INIT
28#include "system.h"
29#include "tmacros.h"
30#include <stdio.h>
31
32#define ARGUMENT 0
33
34rtems_task Init(
35  rtems_task_argument argument
36)
37{
38  rtems_name        task_name;
39  rtems_id          tid;
40  rtems_status_code status;
41
42  printf( "\n\n*** SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
43  printf( "Creating and starting an application task\n" );
44
45  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
46
47  status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
48             RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
49  directive_failed( status, "create" );
50
51  status = rtems_task_start( tid, Application_task, ARGUMENT );
52  directive_failed( status, "start" );
53
54  status = rtems_task_delete( RTEMS_SELF );
55  directive_failed( status, "delete" );
56}
Note: See TracBrowser for help on using the repository browser.