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

4.115
Last change on this file since 7f8a978 was 7f8a978, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/14 at 13:43:15

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
RevLine 
[ac7d5ef0]1/*  system.h
2 *
3 *  This include file contains information that is included in every
4 *  function in the test set.
5 *
[ac85d56]6 *  COPYRIGHT (c) 1989-2009.
[ac7d5ef0]7 *  On-Line Applications Research Corporation (OAR).
8 *
[98e4ebf5]9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
[c499856]11 *  http://www.rtems.org/license/LICENSE.
[ac7d5ef0]12 */
13
[4b374f36]14#include <tmacros.h>
[ac7d5ef0]15
[3a4ae6c]16/* functions */
[ac7d5ef0]17
[3a4ae6c]18rtems_task Init(
19  rtems_task_argument argument
20);
[ac7d5ef0]21
[3a4ae6c]22rtems_task Task_1(
23  rtems_task_argument argument
24);
[1b4f2b30]25
[3a4ae6c]26rtems_task Task_2(
27  rtems_task_argument argument
28);
[1b4f2b30]29
[3a4ae6c]30rtems_task Task_3(
31  rtems_task_argument argument
32);
[1b4f2b30]33
[3a4ae6c]34rtems_task Task_4(
35  rtems_task_argument argument
36);
[1b4f2b30]37
[6d97132]38bool Task_create_extension(
[3a4ae6c]39  rtems_tcb *unused,
40  rtems_tcb *created_task
41);
[1b4f2b30]42
[ac85d56]43void Task_delete_extension(
[3a4ae6c]44  rtems_tcb *running_task,
45  rtems_tcb *deleted_task
46);
[1b4f2b30]47
[ac85d56]48void Task_restart_extension(
[3a4ae6c]49  rtems_tcb *unused,
50  rtems_tcb *restarted_task
51);
[1b4f2b30]52
[ac85d56]53void Task_start_extension(
[3a4ae6c]54  rtems_tcb *unused,
55  rtems_tcb *started_task
56);
[1b4f2b30]57
[ac85d56]58void Task_exit_extension(
[3a4ae6c]59  rtems_tcb *running_task
60);
[ac7d5ef0]61
[3a4ae6c]62/* configuration information */
[ac7d5ef0]63
[df49c60]64#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
65#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
[ac7d5ef0]66
[79542d7]67#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     2
[3a4ae6c]68#define CONFIGURE_TICKS_PER_TIMESLICE       100
[ac7d5ef0]69
[6c0301d]70#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
71
[be1c11ed]72#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
73
[9a993ed5]74#define CONFIGURE_EXTRA_TASK_STACKS         (4 * RTEMS_MINIMUM_STACK_SIZE)
[df49c60]75#define CONFIGURE_MAXIMUM_TASKS             5
[9a993ed5]76
[e8064503]77#include <rtems/confdefs.h>
[3a4ae6c]78
79/* global variables */
80
[cc51de91]81TEST_EXTERN rtems_id   Task_id[ 5 ];         /* array of task ids */
82TEST_EXTERN rtems_name Task_name[ 5 ];       /* array of task names */
[3a4ae6c]83
84TEST_EXTERN rtems_id   Extension_id[ 4 ];
85TEST_EXTERN rtems_name Extension_name[ 4 ];  /* array of task names */
[1b4f2b30]86
[7f8a978]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
[ac7d5ef0]106/* end of include file */
Note: See TracBrowser for help on using the repository browser.