source: rtems/testsuites/libtests/top/task3.c @ 410bcdfe

4.115
Last change on this file since 410bcdfe was 410bcdfe, checked in by Jennifer Averett <jennifer.averett@…>, on 09/29/14 at 19:31:18

top: Add new test.

  • Property mode set to 100644
File size: 969 bytes
Line 
1/*  Task_3
2 *
3 *  This routine serves as a test task.  It receives a task
4 *  number and uses it to force each progressive task created
5 *  to have a higher cpu utilization than the previous.
6 *
7 *  Input parameters:
8 *    argument - task argument
9 *
10 *  Output parameters:  NONE
11 *
12 *  COPYRIGHT (c) 2014.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include "system.h"
25
26rtems_task Task_3(
27  rtems_task_argument argument
28)
29{
30  rtems_status_code status;
31  uint32_t sum;
32  uint32_t next;
33  uint32_t per_loop;
34
35  sum  = 0;
36  next = 0;
37  per_loop = argument * 1000;
38
39  while( FOREVER ) {
40    add_some( per_loop, &sum, &next );
41
42    status = rtems_task_wake_after (TicksPerSecond * 1);
43    directive_failed( status, "rtems_task_wake_after" );
44 }
45}
Note: See TracBrowser for help on using the repository browser.