source: rtems/testsuites/tmtests/include/timesys.h @ 1d7a927

4.104.115
Last change on this file since 1d7a927 was 1d7a927, checked in by Joel Sherrill <joel.sherrill@…>, on 10/02/08 at 21:01:58

2008-10-02 Joel Sherrill <joel.sherrill@…>

  • include/timesys.h: Use inttypes.h.
  • tmck/task1.c: Use uint32_t for count.
  • Property mode set to 100644
File size: 1.9 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.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#include <tmacros.h>
17#include <inttypes.h>
18
19/*
20 *  This constant determines the maximum number of a resource
21 *  that will be created.  For example, some test create multiple
22 *  blocking tasks to determine the execution time of blocking
23 *  services.  By default, the blocking time of 100 tasks will
24 *  be measured.  Small targets often do not have enough memory
25 *  to create 100 tasks.  By overriding the default OPERATION_COUNT
26 *  with a lower number (typically 10 or less), all of the time tests
27 *  can usually be run.  This is stil not very fine-grained but
28 *  is enough to significantly reduce memory consumption.
29 */
30
31#ifndef OPERATION_COUNT
32#define OPERATION_COUNT 100
33#endif
34
35/* functions */
36
37#define put_time( _message, _total_time, \
38                  _iterations, _loop_overhead, _overhead ) \
39    printf( \
40      "%s %" PRId32 "\n", \
41      (_message), \
42      (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \
43    )
44
45#if  defined(CONFIGURE_STACK_CHECKER_ENABLED) || defined(RTEMS_DEBUG)
46#define Print_Warning() \
47  do { \
48    puts( \
49      "\n" \
50      "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \
51      "\n" \
52    ); \
53  } while (0)
54
55#else
56#define Print_Warning()
57#endif
58
59/* variables */
60
61TEST_EXTERN volatile uint32_t   end_time;   /* ending time variable */
62TEST_EXTERN volatile uint32_t   overhead;   /* loop overhead variable */
63
64TEST_EXTERN rtems_id   Task_id[ OPERATION_COUNT+1 ];   /* array of task ids */
65TEST_EXTERN rtems_id   Task_name[ OPERATION_COUNT+1 ]; /* array of task names */
66
67/* end of include file */
Note: See TracBrowser for help on using the repository browser.