source: rtems/testsuites/sptests/spcbssched01/task1.c @ 4e8589d

4.115
Last change on this file since 4e8589d was 4e8589d, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/29/11 at 16:20:49

2011-09-29 Ralf Corsépius <ralf.corsepius@…>

  • sp75/init.c, spcbssched01/init.c, spcbssched01/task1.c spcbssched02/init.c, spcbssched02/task_periodic.c, spcbssched03/init.c, spcbssched03/tasks_aperiodic.c, spcbssched03/tasks_periodic.c, spedfsched01/init.c, spedfsched01/task1.c, spedfsched02/getall.c, spedfsched02/init.c, spedfsched02/task1.c, spedfsched03/init.c, spedfsched03/tasks_aperiodic.c, spedfsched03/tasks_periodic.c, sprbtree01/init.c: Add HAVE_CONFIG_H.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  Task_1_through_3
2 *
3 *  This routine serves as a test task.  It verifies the basic task
4 *  switching capabilities of the executive.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#ifdef HAVE_CONFIG_H
22#include "config.h"
23#endif
24
25#include "system.h"
26
27rtems_task Task_1_through_3(
28  rtems_task_argument argument
29)
30{
31  rtems_id          tid;
32  rtems_time_of_day time;
33  rtems_status_code status;
34  rtems_interval    ticks;
35
36  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
37  directive_failed( status, "rtems_task_ident" );
38
39  /*
40   * Use TOD_MILLISECONDS_TO_TICKS not RTEMS_MILLISECONDS_TO_TICKS to
41   * test C implementation in SuperCore -- not macro version used
42   * everywhere else.
43   */
44  ticks = TOD_MILLISECONDS_TO_TICKS( task_number( tid ) * 5 * 1000 );
45
46  while( FOREVER ) {
47    status = rtems_clock_get_tod( &time );
48    directive_failed( status, "rtems_clock_get_tod" );
49
50    if ( time.second >= 35 ) {
51      puts( "*** END OF CBS SCHEDULER TEST 1 ***" );
52      rtems_test_exit( 0 );
53    }
54
55    put_name( Task_name[ task_number( tid ) ], FALSE );
56    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
57
58    status = rtems_task_wake_after( ticks );
59    directive_failed( status, "rtems_task_wake_after" );
60  }
61}
Note: See TracBrowser for help on using the repository browser.