[f63801a2] | 1 | /* |
---|
[9410d011] | 2 | * COPYRIGHT (c) 1989-2013. |
---|
[f63801a2] | 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 |
---|
[c499856] | 7 | * http://www.rtems.org/license/LICENSE. |
---|
[f63801a2] | 8 | */ |
---|
| 9 | |
---|
[a4bc4d6e] | 10 | #ifdef HAVE_CONFIG_H |
---|
| 11 | #include "config.h" |
---|
| 12 | #endif |
---|
| 13 | |
---|
[f63801a2] | 14 | #include <bsp.h> |
---|
| 15 | #include <coverhd.h> |
---|
| 16 | #include <tmacros.h> |
---|
| 17 | #include <timesys.h> |
---|
| 18 | #include "test_support.h" |
---|
| 19 | |
---|
[2ead50a] | 20 | const char rtems_test_name[] = "TIME TEST 30"; |
---|
| 21 | |
---|
[f63801a2] | 22 | rtems_id barrier[ OPERATION_COUNT ]; |
---|
| 23 | |
---|
[865bffd1] | 24 | rtems_task Init( |
---|
| 25 | rtems_task_argument argument |
---|
| 26 | ); |
---|
| 27 | |
---|
[ee22b25] | 28 | static void benchmark_barrier_create( |
---|
[f63801a2] | 29 | int iteration, |
---|
| 30 | void *argument |
---|
| 31 | ) |
---|
| 32 | { |
---|
| 33 | rtems_status_code status; |
---|
| 34 | |
---|
| 35 | status = rtems_barrier_create( |
---|
| 36 | iteration + 1, |
---|
| 37 | RTEMS_LOCAL | RTEMS_FIFO, |
---|
| 38 | 2, |
---|
| 39 | &barrier[iteration] |
---|
| 40 | ); |
---|
| 41 | directive_failed(status, "rtems_barrier_create"); |
---|
| 42 | } |
---|
| 43 | |
---|
[ee22b25] | 44 | static void benchmark_barrier_ident( |
---|
[f63801a2] | 45 | int iteration, |
---|
| 46 | void *argument |
---|
| 47 | ) |
---|
| 48 | { |
---|
| 49 | rtems_status_code status; |
---|
| 50 | rtems_id id; |
---|
| 51 | |
---|
| 52 | status = rtems_barrier_ident( iteration+1, &id ); |
---|
| 53 | directive_failed(status, "rtems_barrier_ident"); |
---|
| 54 | } |
---|
| 55 | |
---|
[ee22b25] | 56 | static void benchmark_barrier_delete( |
---|
[f63801a2] | 57 | int iteration, |
---|
| 58 | void *argument |
---|
| 59 | ) |
---|
| 60 | { |
---|
| 61 | rtems_status_code status; |
---|
| 62 | |
---|
| 63 | status = rtems_barrier_delete( barrier[iteration] ); |
---|
| 64 | directive_failed(status, "rtems_barrier_delete"); |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | rtems_task Init( |
---|
| 68 | rtems_task_argument argument |
---|
| 69 | ) |
---|
| 70 | { |
---|
[2ead50a] | 71 | TEST_BEGIN(); |
---|
[f63801a2] | 72 | |
---|
| 73 | rtems_time_test_measure_operation( |
---|
[9410d011] | 74 | "rtems_barrier_create: only case", |
---|
[f63801a2] | 75 | benchmark_barrier_create, |
---|
| 76 | NULL, |
---|
| 77 | OPERATION_COUNT, |
---|
| 78 | 0 |
---|
| 79 | ); |
---|
| 80 | |
---|
| 81 | rtems_time_test_measure_operation( |
---|
[9410d011] | 82 | "rtems_barrier_ident: only case", |
---|
[f63801a2] | 83 | benchmark_barrier_ident, |
---|
| 84 | NULL, |
---|
| 85 | OPERATION_COUNT, |
---|
| 86 | 0 |
---|
| 87 | ); |
---|
| 88 | |
---|
| 89 | rtems_time_test_measure_operation( |
---|
[9410d011] | 90 | "rtems_barrier_delete: only case", |
---|
[f63801a2] | 91 | benchmark_barrier_delete, |
---|
| 92 | NULL, |
---|
| 93 | OPERATION_COUNT, |
---|
| 94 | 0 |
---|
| 95 | ); |
---|
| 96 | |
---|
[2ead50a] | 97 | TEST_END(); |
---|
[f63801a2] | 98 | |
---|
| 99 | rtems_test_exit(0); |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | /* configuration information */ |
---|
| 103 | |
---|
| 104 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
| 105 | #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
| 106 | |
---|
| 107 | #define CONFIGURE_MAXIMUM_TASKS 1 |
---|
| 108 | #define CONFIGURE_MAXIMUM_BARRIERS OPERATION_COUNT |
---|
| 109 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 110 | |
---|
| 111 | #define CONFIGURE_INIT |
---|
| 112 | |
---|
| 113 | #include <rtems/confdefs.h> |
---|
| 114 | /* end of file */ |
---|