source: rtems/c/src/tests/tmtests/include/timesys.h @ 08311cc3

4.104.114.84.95
Last change on this file since 08311cc3 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*  timesys.h
2 *
3 *  This header file contains the global variables for the Time
4 *  suite.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#include <tmacros.h>
17
18/*
19 *  This constant determines the maximum number of a resource
20 *  that will be created.  For example, some test create multiple
21 *  blocking tasks to determine the execution time of blocking
22 *  services.  By default, the blocking time of 100 tasks will
23 *  be measured.  Small targets often do not have enough memory
24 *  to create 100 tasks.  By setting the BSP_MAXIMUM_OPERATION_COUNT
25 *  to a lower number (typically 10), all of the time tests can be
26 *  run.
27 */
28
29#ifndef BSP_MAXIMUM_OPERATION_COUNT
30#define OPERATION_COUNT 100
31#else
32#define OPERATION_COUNT BSP_MAXIMUM_OPERATION_COUNT
33#endif
34
35/*
36 *  Some tests are repeated (iterated) multiple times over
37 *  "operation count" operations.  For example, a semaphore
38 *  test may acquire and release the semaphore "operation count"
39 *  times per loop and the body of the loop is repeated "iteration
40 *  count" times.  This value is a repitition factor which does
41 *  not increase memory usage -- only execution time.
42 */
43
44#ifndef BSP_ITERATION_COUNT
45#define IT_COUNT        100
46#else
47#define IT_COUNT BSP_ITERATION_COUNT
48#endif
49
50/* functions */
51
52#define put_time( _message, _total_time, \
53                  _iterations, _loop_overhead, _overhead ) \
54    printf( \
55      "%s %d\n", \
56      (_message), \
57      (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \
58    )
59
60#if  defined(STACK_CHECKER_ON) || defined(RTEMS_DEBUG)
61#define Print_Warning() \
62  do { \
63    puts( \
64      "\n" \
65      "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \
66      "\n" \
67    ); \
68  } while (0)
69
70#else
71#define Print_Warning()
72#endif
73
74/* variables */
75
76TEST_EXTERN volatile rtems_unsigned32 end_time;   /* ending time variable */
77TEST_EXTERN volatile rtems_unsigned32 overhead;   /* loop overhead variable */
78
79TEST_EXTERN rtems_id   Task_id[ OPERATION_COUNT+1 ];   /* array of task ids */
80TEST_EXTERN rtems_id   Task_name[ OPERATION_COUNT+1 ]; /* array of task names */
81
82/* end of include file */
Note: See TracBrowser for help on using the repository browser.