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 | |
---|
61 | TEST_EXTERN volatile uint32_t end_time; /* ending time variable */ |
---|
62 | TEST_EXTERN volatile uint32_t overhead; /* loop overhead variable */ |
---|
63 | |
---|
64 | TEST_EXTERN rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ |
---|
65 | TEST_EXTERN rtems_id Task_name[ OPERATION_COUNT+1 ]; /* array of task names */ |
---|
66 | |
---|
67 | /* end of include file */ |
---|