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

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 2.1 KB
RevLine 
[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
20rtems_id barrier[ OPERATION_COUNT ];
21
[865bffd1]22rtems_task Init(
23  rtems_task_argument argument
24);
25
[ee22b25]26static void benchmark_barrier_create(
[f63801a2]27  int    iteration,
28  void  *argument
29)
30{
31  rtems_status_code status;
32
33  status = rtems_barrier_create(
34    iteration + 1,
35    RTEMS_LOCAL | RTEMS_FIFO,
36    2,
37    &barrier[iteration]
38  );
39  directive_failed(status, "rtems_barrier_create");
40}
41
[ee22b25]42static void benchmark_barrier_ident(
[f63801a2]43  int    iteration,
44  void  *argument
45)
46{
47  rtems_status_code status;
48  rtems_id          id;
49
50  status = rtems_barrier_ident( iteration+1, &id );
51  directive_failed(status, "rtems_barrier_ident");
52}
53
[ee22b25]54static void benchmark_barrier_delete(
[f63801a2]55  int    iteration,
56  void  *argument
57)
58{
59  rtems_status_code status;
60
61  status = rtems_barrier_delete( barrier[iteration] );
62  directive_failed(status, "rtems_barrier_delete");
63}
64
65rtems_task Init(
66  rtems_task_argument argument
67)
68{
69  puts( "\n\n*** TIME TEST 30 ***" );
70
71  rtems_time_test_measure_operation(
[9410d011]72    "rtems_barrier_create: only case",
[f63801a2]73    benchmark_barrier_create,
74    NULL,
75    OPERATION_COUNT,
76    0
77  );
78 
79  rtems_time_test_measure_operation(
[9410d011]80    "rtems_barrier_ident: only case",
[f63801a2]81    benchmark_barrier_ident,
82    NULL,
83    OPERATION_COUNT,
84    0
85  );
86 
87  rtems_time_test_measure_operation(
[9410d011]88    "rtems_barrier_delete: only case",
[f63801a2]89    benchmark_barrier_delete,
90    NULL,
91    OPERATION_COUNT,
92    0
93  );
94 
95  puts( "*** END OF TIME TEST 30 ***" );
96
97  rtems_test_exit(0);
98}
99
100/* configuration information */
101
102#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
103#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
104
105#define CONFIGURE_MAXIMUM_TASKS             1
106#define CONFIGURE_MAXIMUM_BARRIERS          OPERATION_COUNT
107#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
108
109#define CONFIGURE_INIT
110
111#include <rtems/confdefs.h>
112/* end of file */
Note: See TracBrowser for help on using the repository browser.