source: rtems/testsuites/sptests/spcbssched03/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.3 KB
Line 
1/*  Tasks_Aperiodic
2 *
3 *  This routine serves as a test task for the CBS 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
18#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include "system.h"
23
24rtems_task Tasks_Aperiodic(
25  rtems_task_argument argument
26)
27{
28  rtems_status_code status;
29  int start, stop, 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  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
37  printf("AT%" PRIdPTR "-S ticks:%d\n", argument, start);
38  /* active computing */
39
40  while(FOREVER) {
41    rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
42    if (now >= start + Execution[argument]) break;
43  }
44  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &stop);
45  printf("P%" PRIdPTR "-F ticks:%d\n", argument, stop);
46
47  /* delete SELF */
48  fflush(stdout);
49  printf( "Killing task %" PRIdPTR "\n", argument);
50  status = rtems_task_delete(RTEMS_SELF);
51  directive_failed(status, "rtems_task_delete of RTEMS_SELF");
52}
Note: See TracBrowser for help on using the repository browser.