source: rtems/testsuites/tmtests/tm18/task1.c @ 60b76933

5
Last change on this file since 60b76933 was 96e4b22, checked in by Chris Johns <chrisj@…>, on 03/06/19 at 09:39:29

testsuite: Make the OPERATION_COUNT a test configuration parameter.

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