[ccc4203] | 1 | /* |
---|
[be8bdff] | 2 | * COPYRIGHT (c) 1989-2010. |
---|
[6cc1c29] | 3 | * On-Line Applications Research Corporation (OAR). |
---|
| 4 | * |
---|
| 5 | * The license and distribution terms for this file may be |
---|
| 6 | * found in the file LICENSE in this distribution or at |
---|
| 7 | * http://www.rtems.com/license/LICENSE. |
---|
[ccc4203] | 8 | * |
---|
| 9 | * $Id$ |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | #ifndef __TEST_SUPPORT_h |
---|
| 13 | #define __TEST_SUPPORT_h |
---|
| 14 | |
---|
| 15 | #ifdef __cplusplus |
---|
| 16 | extern "C" { |
---|
| 17 | #endif |
---|
| 18 | |
---|
[6cc1c29] | 19 | /* |
---|
[be8bdff] | 20 | * Allocate a number of small blocks from the workspace |
---|
[6cc1c29] | 21 | * until the largest free block of memory available is |
---|
| 22 | * smaller than smallest. |
---|
| 23 | * |
---|
| 24 | * NOTE: The memory CANNOT be freed. |
---|
| 25 | */ |
---|
| 26 | void Allocate_majority_of_workspace( int smallest ); |
---|
| 27 | |
---|
[be8bdff] | 28 | /* |
---|
| 29 | * Allocate a number of small blocks from the heap |
---|
| 30 | * until the largest free block of memory available is |
---|
| 31 | * smaller than smallest. |
---|
| 32 | * |
---|
| 33 | * NOTE: The memory CANNOT be freed. |
---|
| 34 | */ |
---|
| 35 | void Allocate_majority_of_heap( int smallest ); |
---|
| 36 | |
---|
[6cc1c29] | 37 | /* |
---|
| 38 | * Return a pointer to the POSIX name that is slightly |
---|
| 39 | * beyond the legal limit. |
---|
| 40 | */ |
---|
| 41 | const char *Get_Too_Long_Name(void); |
---|
| 42 | |
---|
| 43 | /* |
---|
| 44 | * Return a pointer to the longest legal POSIX name. |
---|
| 45 | */ |
---|
| 46 | const char *Get_Longest_Name(void); |
---|
| 47 | |
---|
| 48 | /* |
---|
| 49 | * Spin for specified number of ticks. |
---|
| 50 | */ |
---|
| 51 | void rtems_test_spin_for_ticks(int ticks); |
---|
| 52 | |
---|
| 53 | /* |
---|
| 54 | * Spin until the next clock tick |
---|
| 55 | */ |
---|
| 56 | void rtems_test_spin_until_next_tick( void ); |
---|
[ccc4203] | 57 | |
---|
[82fbd35] | 58 | /*********************************************************************/ |
---|
| 59 | /*********************************************************************/ |
---|
| 60 | /************** TMTEST SUPPORT **************/ |
---|
| 61 | /*********************************************************************/ |
---|
| 62 | /*********************************************************************/ |
---|
| 63 | |
---|
| 64 | /* |
---|
| 65 | * Type of method used for timing operations |
---|
| 66 | */ |
---|
| 67 | typedef void (*rtems_time_test_method_t)( |
---|
| 68 | int iteration, |
---|
| 69 | void *argument |
---|
| 70 | ); |
---|
| 71 | |
---|
| 72 | /* |
---|
| 73 | * Obtain baseline timing information for benchmark tests. |
---|
| 74 | */ |
---|
| 75 | void rtems_time_test_measure_operation( |
---|
| 76 | const char *description, |
---|
| 77 | rtems_time_test_method_t operation, |
---|
| 78 | void *argument, |
---|
| 79 | int iterations, |
---|
| 80 | int overhead |
---|
| 81 | ); |
---|
| 82 | |
---|
[ccc4203] | 83 | #ifdef __cplusplus |
---|
| 84 | }; |
---|
| 85 | #endif |
---|
| 86 | |
---|
| 87 | #endif |
---|