source: rtems/testsuites/sptests/sp19/task1.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  Task_1
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-1997.
12 *  On-Line Applications Research Corporation (OAR).
13 *  Copyright assigned to U.S. Government, 1994.
14 *
15 *  The license and distribution terms for this file may in
16 *  the file LICENSE in this distribution or at
17 *  http://www.OARcorp.com/rtems/license.html.
18 *
19 *  $Id$
20 */
21
22#include "system.h"
23#include "inttest.h"
24
25rtems_task Task_1(
26  rtems_task_argument argument
27)
28{
29  rtems_status_code status;
30  rtems_id          tid;
31  rtems_time_of_day time;
32  rtems_unsigned32  task_index;
33  INTEGER_DECLARE;
34
35  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
36  directive_failed( status, "rtems_task_ident" );
37
38  task_index = task_number( tid );
39
40  INTEGER_LOAD( INTEGER_factors[ task_index ] );
41
42  put_name( Task_name[ task_index ], FALSE );
43  printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] );
44
45  while( FOREVER ) {
46    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
47    directive_failed( status, "rtems_clock_get" );
48
49    put_name( Task_name[ task_number( tid ) ], FALSE );
50    print_time( " - rtems_clock_get - ", &time, "\n" );
51
52    INTEGER_CHECK( INTEGER_factors[ task_index ] );
53
54    status = rtems_task_wake_after(
55      ( task_number( tid ) ) * 5 * TICKS_PER_SECOND
56    );
57    directive_failed( status, "rtems_task_wake_after" );
58  }
59}
Note: See TracBrowser for help on using the repository browser.