source: rtems/testsuites/tmtests/tm18/task1.c

Last change on this file was fdeaa64, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 3, 2020 at 12:01:56 PM

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.0 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
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 18";
24
25uint32_t   taskcount;
26rtems_task_priority taskpri;
27
28extern void test_init(void);
29
30rtems_task First_task(
31  rtems_task_argument argument
32);
33
34rtems_task Middle_tasks(
35  rtems_task_argument argument
36);
37
38rtems_task Last_task(
39  rtems_task_argument argument
40);
41
42
43rtems_task Init(
44  rtems_task_argument argument
45)
46{
47  Print_Warning();
48
49  TEST_BEGIN();
50
51  test_init();
52
53  rtems_task_exit();
54}
55
56void test_init(void)
57{
58  rtems_id          id;
59  rtems_task_entry  task_entry;
60  uint32_t          index;
61  rtems_status_code status;
62
63  for ( index = 0 ; index <= OPERATION_COUNT ; index++ ) {
64    status = rtems_task_create(
65      rtems_build_name( 'T', 'I', 'M', 'E' ),
66      (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u,
67      RTEMS_MINIMUM_STACK_SIZE,
68      RTEMS_DEFAULT_MODES,
69      RTEMS_DEFAULT_ATTRIBUTES,
70      &id
71    );
72    directive_failed( status, "rtems_task_create loop" );
73
74    if ( index == OPERATION_COUNT ) task_entry = Last_task;
75    else if ( index == 0 )          task_entry = First_task;
76    else                            task_entry = Middle_tasks;
77
78
79    status = rtems_task_start( id, task_entry, 0 );
80    directive_failed( status, "rtems_task_start loop" );
81  }
82
83}
84
85rtems_task First_task(
86  rtems_task_argument argument
87)
88{
89  benchmark_timer_initialize();
90
91  rtems_task_exit();
92}
93
94rtems_task Middle_tasks(
95  rtems_task_argument argument
96)
97{
98  rtems_task_exit();
99}
100
101rtems_task Last_task(
102  rtems_task_argument argument
103)
104{
105  end_time = benchmark_timer_read();
106
107  put_time(
108    "rtems_task_delete: calling task",
109    end_time,
110    OPERATION_COUNT,
111    0,
112    0
113  );
114
115  TEST_END();
116  rtems_test_exit( 0 );
117}
Note: See TracBrowser for help on using the repository browser.