source: rtems/testsuites/sptests/sp07/system.h @ 7f8a978

4.11
Last change on this file since 7f8a978 was 7f8a978, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 16, 2014 at 1:43:15 PM

sptests/sp07: Minimize thread dispatch latency

Do not use sprintf() in thread dispatch critical sections to avoid
corruption of profiling samples. Update test to reflect thread the life
cycle changes.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*  system.h
2 *
3 *  This include file contains information that is included in every
4 *  function in the test set.
5 *
6 *  COPYRIGHT (c) 1989-2009.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.org/license/LICENSE.
12 */
13
14#include <tmacros.h>
15
16/* functions */
17
18rtems_task Init(
19  rtems_task_argument argument
20);
21
22rtems_task Task_1(
23  rtems_task_argument argument
24);
25
26rtems_task Task_2(
27  rtems_task_argument argument
28);
29
30rtems_task Task_3(
31  rtems_task_argument argument
32);
33
34rtems_task Task_4(
35  rtems_task_argument argument
36);
37
38bool Task_create_extension(
39  rtems_tcb *unused,
40  rtems_tcb *created_task
41);
42
43void Task_delete_extension(
44  rtems_tcb *running_task,
45  rtems_tcb *deleted_task
46);
47
48void Task_restart_extension(
49  rtems_tcb *unused,
50  rtems_tcb *restarted_task
51);
52
53void Task_start_extension(
54  rtems_tcb *unused,
55  rtems_tcb *started_task
56);
57
58void Task_exit_extension(
59  rtems_tcb *running_task
60);
61
62/* configuration information */
63
64#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
65#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
66
67#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     2
68#define CONFIGURE_TICKS_PER_TIMESLICE       100
69
70#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
71
72#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
73
74#define CONFIGURE_EXTRA_TASK_STACKS         (4 * RTEMS_MINIMUM_STACK_SIZE)
75#define CONFIGURE_MAXIMUM_TASKS             5
76
77#include <rtems/confdefs.h>
78
79/* global variables */
80
81TEST_EXTERN rtems_id   Task_id[ 5 ];         /* array of task ids */
82TEST_EXTERN rtems_name Task_name[ 5 ];       /* array of task names */
83
84TEST_EXTERN rtems_id   Extension_id[ 4 ];
85TEST_EXTERN rtems_name Extension_name[ 4 ];  /* array of task names */
86
87TEST_EXTERN int Task_created[ RTEMS_ARRAY_SIZE( Task_id ) ];
88
89TEST_EXTERN int Task_started[ RTEMS_ARRAY_SIZE( Task_id ) ];
90
91TEST_EXTERN int Task_restarted[ RTEMS_ARRAY_SIZE( Task_id ) ];
92
93TEST_EXTERN int Task_deleted[ RTEMS_ARRAY_SIZE( Task_id ) ];
94
95RTEMS_INLINE_ROUTINE void assert_extension_counts( const int *table, int tasks )
96{
97  size_t i;
98
99  for ( i = 0; i < RTEMS_ARRAY_SIZE( Task_id ); ++i ) {
100    rtems_test_assert(
101      ( tasks & ( 1 << i ) ) != 0 ? table[ i ] == 1 : table[ i ] == 0
102    );
103  }
104}
105
106/* end of include file */
Note: See TracBrowser for help on using the repository browser.