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