source: rtems/testsuites/tmtests/tm25/task1.c @ 8b73ee5

5
Last change on this file since 8b73ee5 was fdeaa64, checked in by Sebastian Huber <sebastian.huber@…>, on 03/03/20 at 12:01:56

config: Remove <rtems/btimer.h> include

The use of CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER does not define
anything, so remove the <rtems/btimer.h> include.

Update #3875.

  • Property mode set to 100644
File size: 2.3 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#if !defined(OPERATION_COUNT)
11#define OPERATION_COUNT 100
12#endif
13
14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#endif
17
18#include <rtems/btimer.h>
19
20#define CONFIGURE_INIT
21#include "system.h"
22
23const char rtems_test_name[] = "TIME TEST 25";
24
25rtems_id Semaphore_id;
26
27rtems_task High_tasks(
28  rtems_task_argument argument
29);
30
31rtems_task Low_task(
32  rtems_task_argument argument
33);
34
35rtems_task Init(
36  rtems_task_argument argument
37)
38{
39  rtems_id          task_id;
40  uint32_t    index;
41  rtems_status_code status;
42
43  Print_Warning();
44
45  TEST_BEGIN();
46
47  status = rtems_semaphore_create(
48    rtems_build_name( 'S', 'M', '1', ' ') ,
49    0,
50    RTEMS_DEFAULT_ATTRIBUTES,
51    RTEMS_NO_PRIORITY,
52    &Semaphore_id
53  );
54  directive_failed( status, "rtems_semaphore_create of SM1" );
55
56  status = rtems_task_create(
57    rtems_build_name( 'L', 'O', 'W', ' ' ),
58    RTEMS_MAXIMUM_PRIORITY - 1u,
59    RTEMS_MINIMUM_STACK_SIZE,
60    RTEMS_DEFAULT_MODES,
61    RTEMS_DEFAULT_ATTRIBUTES,
62    &task_id
63  );
64  directive_failed( status, "rtems_task_create LOW" );
65
66  status = rtems_task_start( task_id, Low_task, 0 );
67  directive_failed( status, "rtems_task_start LOW" );
68
69  for ( index=1 ; index <= OPERATION_COUNT ; index++ ) {
70    status = rtems_task_create(
71      rtems_build_name( 'T', 'I', 'M', 'E' ),
72      (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u,
73      RTEMS_MINIMUM_STACK_SIZE,
74      RTEMS_DEFAULT_MODES,
75      RTEMS_DEFAULT_ATTRIBUTES,
76      &task_id
77    );
78    directive_failed( status, "rtems_task_create LOOP" );
79
80    status = rtems_task_start( task_id, High_tasks, 0 );
81    directive_failed( status, "rtems_task_start LOOP" );
82  }
83
84  rtems_task_exit();
85}
86
87rtems_task High_tasks(
88  rtems_task_argument argument
89)
90{
91  (void) rtems_semaphore_obtain(
92    Semaphore_id,
93    RTEMS_DEFAULT_OPTIONS,
94    0xffffffff
95  );
96}
97
98rtems_task Low_task(
99  rtems_task_argument argument
100)
101{
102  benchmark_timer_initialize();
103    (void) rtems_clock_tick();
104  end_time = benchmark_timer_read();
105
106  put_time(
107    "rtems_clock_tick: only case",
108    end_time,
109    1,
110    0,
111    0
112  );
113
114  TEST_END();
115  rtems_test_exit( 0 );
116}
Note: See TracBrowser for help on using the repository browser.