source: rtems/testsuites/sptests/spedfsched03/tasks_aperiodic.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
RevLine 
[0d6aee4]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.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
[4e8589d]18#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
[0d6aee4]22#include "system.h"
23
24rtems_task Tasks_Aperiodic(
25  rtems_task_argument argument
26)
27{
[74416035]28  rtems_status_code   status;
29  int                 start;
30  int                 stop;
31  int                 now;
[0d6aee4]32
33  put_name( Task_name[ argument ], FALSE );
34
35  status = rtems_task_wake_after( 2 + Phases[argument] );
36  directive_failed( status, "rtems_task_wake_after" );
37
[74416035]38  if ( argument == 6 ) {
39    rtems_task_suspend( Task_id[5] );
40    rtems_task_resume( Task_id[5] );
41  }
42
[0d6aee4]43  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
44  printf("AT%" PRIdPTR "-S ticks:%d\n", argument, start);
45  /* active computing */
46
47  while(FOREVER) {
48    rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
49    if (now >= start + Execution[argument]) break;
50  }
51  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &stop);
52  printf("P%" PRIdPTR "-F ticks:%d\n", argument, stop);
53
54  /* delete SELF */
55  fflush(stdout);
56  printf( "Killing task %" PRIdPTR "\n", argument);
57  status = rtems_task_delete(RTEMS_SELF);
58  directive_failed(status, "rtems_task_delete of RTEMS_SELF");
59}
Note: See TracBrowser for help on using the repository browser.