source: rtems/testsuites/sptests/spedfsched03/tasks_aperiodic.c @ 0d6aee4

4.115
Last change on this file since 0d6aee4 was 0d6aee4, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/11 at 20:56:45

2011-09-11 Petr Benes <benesp16@…>

PR 1897/testing

  • Makefile.am, configure.ac: Add tests for Earliest Deadline First (EDF) Scheduling Algorithm implementation.
  • spedfsched01/.cvsignore, spedfsched01/Makefile.am, spedfsched01/init.c, spedfsched01/spedfsched01.doc, spedfsched01/spedfsched01.scn, spedfsched01/system.h, spedfsched01/task1.c, spedfsched02/.cvsignore, spedfsched02/Makefile.am, spedfsched02/getall.c, spedfsched02/init.c, spedfsched02/spedfsched02.doc, spedfsched02/spedfsched02.scn, spedfsched02/system.h, spedfsched02/task1.c, spedfsched03/.cvsignore, spedfsched03/Makefile.am, spedfsched03/edfparams.h, spedfsched03/init.c, spedfsched03/spedfsched03.doc, spedfsched03/spedfsched03.scn, spedfsched03/system.h, spedfsched03/tasks_aperiodic.c, spedfsched03/tasks_periodic.c: New files.
  • 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.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#include "system.h"
19
20rtems_task Tasks_Aperiodic(
21  rtems_task_argument argument
22)
23{
24  rtems_status_code  status;
25  int                start;
26  int                stop;
27  int                now;
28
29  put_name( Task_name[ argument ], FALSE );
30
31  status = rtems_task_wake_after( 2 + Phases[argument] );
32  directive_failed( status, "rtems_task_wake_after" );
33
34  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
35  printf("AT%" PRIdPTR "-S ticks:%d\n", argument, start);
36  /* active computing */
37
38  while(FOREVER) {
39    rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now);
40    if (now >= start + Execution[argument]) break;
41  }
42  rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &stop);
43  printf("P%" PRIdPTR "-F ticks:%d\n", argument, stop);
44
45  /* delete SELF */
46  fflush(stdout);
47  printf( "Killing task %" PRIdPTR "\n", argument);
48  status = rtems_task_delete(RTEMS_SELF);
49  directive_failed(status, "rtems_task_delete of RTEMS_SELF");
50}
Note: See TracBrowser for help on using the repository browser.