source: rtems/testsuites/sptests/spedfsched03/tasks_aperiodic.c @ 1d39e96

5
Last change on this file since 1d39e96 was 51b3cbca, checked in by Sebastian Huber <sebastian.huber@…>, on 10/04/18 at 13:23:25

tests: Use rtems_task_exit()

Update #3533.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*  Tasks_Aperiodic
2 *
3 *  This routine serves as a test task for the EDF scheduler
4 *  implementation. This is for aperiodic task execution.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#ifdef HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include "system.h"
21
22rtems_task Tasks_Aperiodic(
23  rtems_task_argument argument
24)
25{
26  rtems_status_code   status;
27  int                 start;
28  int                 stop;
29  int                 now;
30
31  put_name( Task_name[ argument ], FALSE );
32
33  status = rtems_task_wake_after( 2 + Phases[argument] );
34  directive_failed( status, "rtems_task_wake_after" );
35
36  if ( argument == 6 ) {
37    rtems_task_suspend( Task_id[5] );
38    rtems_task_resume( Task_id[5] );
39  }
40
41  start = rtems_clock_get_ticks_since_boot();
42  printf("AT%" PRIdPTR "-S ticks:%d\n", argument, start);
43  /* active computing */
44
45  while(FOREVER) {
46    now = rtems_clock_get_ticks_since_boot();
47    if (now >= start + Execution[argument]) break;
48  }
49  stop = rtems_clock_get_ticks_since_boot();
50  printf("P%" PRIdPTR "-F ticks:%d\n", argument, stop);
51
52  /* delete SELF */
53  fflush(stdout);
54  printf( "Killing task %" PRIdPTR "\n", argument);
55  rtems_task_exit();
56}
Note: See TracBrowser for help on using the repository browser.