source: rtems/testsuites/tmtests/tm30/init.c @ e58e29fd

5
Last change on this file since e58e29fd was e58e29fd, checked in by Sebastian Huber <sebastian.huber@…>, on 11/24/17 at 06:58:55

Remove coverhd.h

This header file contained timing overhead values which are hard to
maintain.

Update #3254.

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