41#include <rtems/testopts.h>
49#if !defined( MAX_TLS_SIZE )
50#define MAX_TLS_SIZE TEST_MAXIMUM_TLS_SIZE
53#define MAX_TASKS ( TEST_MAXIMUM_TASKS - 1 )
55#define TASK_ATTRIBUTES RTEMS_FLOATING_POINT
57#define TASK_STORAGE_SIZE \
58 RTEMS_TASK_STORAGE_SIZE( \
59 MAX_TLS_SIZE + TEST_MINIMUM_STACK_SIZE + \
60 CPU_STACK_ALIGNMENT - CPU_HEAP_ALIGNMENT, \
64static char buffer[ 512 ];
66static const T_action actions[] = {
70 T_check_rtems_barriers,
71 T_check_rtems_extensions,
72 T_check_rtems_message_queues,
73 T_check_rtems_partitions,
74 T_check_rtems_periods,
75 T_check_rtems_semaphores,
83 .buf_size =
sizeof( buffer ),
85 .verbosity = RTEMS_TEST_VERBOSITY,
91 .allocate = T_memory_allocate,
92 .deallocate = T_memory_deallocate,
93 .action_count = T_ARRAY_SIZE( actions ),
102 storage[ TASK_STORAGE_SIZE ];
116 test_runner_argument = arg;
121 &test_runner_initial_modes
127 &test_runner_initial_priority
130 rtems_chain_initialize(
134 sizeof( task_storage[ 0 ] )
139 exit_code = T_main( &test_config );
141 if ( exit_code == 0 ) {
148void *test_task_stack_allocate(
size_t size )
150 if (
size >
sizeof( task_storage[ 0 ] ) ) {
154 T_quiet_ge_sz(
size, TEST_MINIMUM_STACK_SIZE );
156 return rtems_chain_get_unprotected( &free_task_storage );
159void test_task_stack_deallocate(
void *stack )
161 rtems_chain_append_unprotected(
167#if !defined( CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER )
168#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
171#define CONFIGURE_MINIMUM_TASK_STACK_SIZE TEST_MINIMUM_STACK_SIZE
173#define CONFIGURE_INTERRUPT_STACK_SIZE TEST_INTERRUPT_STACK_SIZE
175#define CONFIGURE_MAXIMUM_BARRIERS TEST_MAXIMUM_BARRIERS
177#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES TEST_MAXIMUM_MESSAGE_QUEUES
179#define CONFIGURE_MAXIMUM_PARTITIONS TEST_MAXIMUM_PARTITIONS
181#define CONFIGURE_MAXIMUM_PERIODS TEST_MAXIMUM_PERIODS
183#define CONFIGURE_MAXIMUM_SEMAPHORES TEST_MAXIMUM_SEMAPHORES
185#define CONFIGURE_MAXIMUM_TASKS TEST_MAXIMUM_TASKS
187#define CONFIGURE_MINIMUM_TASKS_WITH_USER_PROVIDED_STORAGE \
188 CONFIGURE_MAXIMUM_TASKS
190#define CONFIGURE_MAXIMUM_TIMERS TEST_MAXIMUM_TIMERS
192#define CONFIGURE_MAXIMUM_USER_EXTENSIONS TEST_MAXIMUM_USER_EXTENSIONS
194#define CONFIGURE_MICROSECONDS_PER_TICK TEST_MICROSECONDS_PER_TICK
196#define CONFIGURE_TICKS_PER_TIMESLICE TEST_TICKS_PER_TIMESLICE
198#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 0
200#define CONFIGURE_DISABLE_NEWLIB_REENTRANCY
202#define CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
204#define CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE MAX_TLS_SIZE
206#define CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
208#define CONFIGURE_TASK_STACK_ALLOCATOR test_task_stack_allocate
210#define CONFIGURE_TASK_STACK_DEALLOCATOR test_task_stack_deallocate
212#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
214#define CONFIGURE_INIT_TASK_ARGUMENTS TEST_RUNNER_ARGUMENT
216#define CONFIGURE_INIT_TASK_ATTRIBUTES ( RTEMS_SYSTEM_TASK | TASK_ATTRIBUTES )
218#define CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE TASK_STORAGE_SIZE
220#define CONFIGURE_INIT_TASK_ENTRY_POINT Runner
222#define CONFIGURE_INIT_TASK_INITIAL_MODES TEST_RUNNER_INITIAL_MODES
224#define CONFIGURE_INIT_TASK_NAME TEST_RUNNER_NAME
226#define CONFIGURE_INIT_TASK_PRIORITY 0
228#if !defined( CONFIGURE_INITIAL_EXTENSIONS )
229#define CONFIGURE_INITIAL_EXTENSIONS { .fatal = FatalInitialExtension }
232#if defined( RTEMS_SMP ) && \
233 ( CONFIGURE_MAXIMUM_PROCESSORS == 4 || CONFIGURE_MAXIMUM_PROCESSORS == 5 )
239 SCHEDULER_EDF_SMP_ENTRY_POINTS,
240 SCHEDULER_EDF_SMP_ENTRY_POINTS,
241 SCHEDULER_EDF_SMP_ENTRY_POINTS,
242#if CONFIGURE_MAXIMUM_PROCESSORS >= 5
243 SCHEDULER_EDF_SMP_ENTRY_POINTS,
245 SCHEDULER_EDF_SMP_ENTRY_POINTS
248#undef SCHEDULER_EDF_SMP_ENTRY_POINTS
250#define SCHEDULER_EDF_SMP_ENTRY_POINTS T_SCHEDULER_ENTRY_POINTS
252#define CONFIGURE_SCHEDULER_EDF_SMP
254#include <rtems/scheduler.h>
264#define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
265 RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME ), \
266 RTEMS_SCHEDULER_TABLE_EDF_SMP( b, TEST_SCHEDULER_B_NAME ), \
267 RTEMS_SCHEDULER_TABLE_EDF_SMP( c, TEST_SCHEDULER_C_NAME ), \
268 RTEMS_SCHEDULER_TABLE_EDF_SMP( d, TEST_SCHEDULER_D_NAME )
270#if CONFIGURE_MAXIMUM_PROCESSORS == 5
271#define CONFIGURE_SCHEDULER_ASSIGNMENTS \
272 RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
273 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
274 RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
275 RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
276 RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER
278#define CONFIGURE_SCHEDULER_ASSIGNMENTS \
279 RTEMS_SCHEDULER_ASSIGN(0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY), \
280 RTEMS_SCHEDULER_ASSIGN(1, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
281 RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL), \
282 RTEMS_SCHEDULER_ASSIGN(2, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL)
285#elif !defined( CONFIGURE_SCHEDULER_ASSIGNMENTS )
289#undef CONFIGURE_MAXIMUM_PROCESSORS
290#define CONFIGURE_MAXIMUM_PROCESSORS 1
297#undef SCHEDULER_PRIORITY_ENTRY_POINTS
299#define SCHEDULER_PRIORITY_ENTRY_POINTS T_SCHEDULER_ENTRY_POINTS
301#define CONFIGURE_SCHEDULER_PRIORITY
303#if defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
305#include <rtems/scheduler.h>
311#define CONFIGURE_SCHEDULER_NAME TEST_SCHEDULER_A_NAME
313#define CONFIGURE_MAXIMUM_PRIORITY 127
319#define CONFIGURE_IDLE_TASK_STACK_SIZE TEST_IDLE_STACK_SIZE
323 MAX_TLS_SIZE + TEST_IDLE_STACK_SIZE + CPU_IDLE_TASK_IS_FP *
CONTEXT_FP_SIZE,
330void *test_idle_task_stack_allocate( uint32_t cpu_index,
size_t *
size )
332 if ( *
size >
sizeof( test_idle_stacks[ 0 ] ) ) {
336 return &test_idle_stacks[ cpu_index ][0];
339#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE test_idle_task_stack_allocate
341#define CONFIGURE_INIT
#define MAX_TASKS
Maximum number of tasks in the system. This number is hardware-dependent and not user configuration.
Definition: bestcomm_api.h:71
This header file provides the kernel character input/output support API.
This header file provides the Chains API.
This header file evaluates the application configuration options defined by the application.
#define RTEMS_ALIGN_UP(_value, _alignment)
Aligns up the value to the alignment.
Definition: basedefs.h:141
#define RTEMS_SECTION(_section)
Instructs the compiler to place the variable or function in the section.
Definition: basedefs.h:411
#define RTEMS_ALIGNED(_alignment)
Instructs the compiler in a declaration or definition to enforce the alignment.
Definition: basedefs.h:157
#define RTEMS_ARRAY_SIZE(_array)
Gets the element count of the array.
Definition: basedefs.h:244
#define RTEMS_CHAIN_INITIALIZER_EMPTY(name)
Chain initializer for an empty chain with designator name.
Definition: chain.h:67
#define RTEMS_ASR_MASK
This mode constant corresponds to the signal enable/disable bit.
Definition: modes.h:101
#define RTEMS_ASR
This task mode constant indicates that signal processing is disabled.
Definition: modes.h:92
uint32_t rtems_mode
This type represents a Classic API task mode set.
Definition: modes.h:174
#define RTEMS_SELF
This compile time constant may be used to identify the calling task in task related directives.
Definition: tasks.h:351
#define RTEMS_TASK_STORAGE_ALIGNMENT
This compile time constant defines the recommended alignment of a task storage area in bytes.
Definition: tasks.h:365
rtems_status_code rtems_task_mode(rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set)
Gets and optionally sets the mode of the calling task.
Definition: taskmode.c:50
rtems_status_code rtems_task_set_priority(rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority)
Sets the real priority or gets the current priority of the task.
Definition: tasksetpriority.c:82
CPU_Uint32ptr rtems_task_argument
This integer type represents task argument values.
Definition: tasks.h:100
uint32_t rtems_task_priority
This integer type represents task priorities of the Classic API.
Definition: types.h:257
void rtems_put_char(int c, void *unused)
Puts the character using rtems_putc()
Definition: rtems_put_char.c:42
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
This configuration option is a boolean feature define.
Definition: appl-config.h:1270
#define RTEMS_SCHEDULER_EDF_SMP(name)
Defines an EDF SMP Scheduler instantiation.
Definition: scheduler.h:259
#define RTEMS_SCHEDULER_PRIORITY(name, prio_count)
Defines a Deterministic Priority Scheduler instantiation.
Definition: scheduler.h:324
#define CONFIGURE_MAXIMUM_PROCESSORS
This configuration option is an integer define.
Definition: appl-config.h:2929
#define CONTEXT_FP_SIZE
Size of floating point context area.
Definition: context.h:70
@ RTEMS_FATAL_SOURCE_APPLICATION
Fatal source for application specific errors.
Definition: interr.h:93
@ RTEMS_FATAL_SOURCE_EXIT
Fatal source of exit().
Definition: interr.h:100
#define SCHEDULER_PRIORITY_ENTRY_POINTS
Definition: schedulerpriority.h:64
#define PRIO_DEFAULT
This constants represents the default priority of the runner task.
Definition: tx-support.h:70
const char rtems_test_name[]
Each test must define a test name string.
Definition: init.c:6903
int rtems_test_begin(const char *name, const RTEMS_TEST_STATE state)
Prints a begin of test message using printf().
Definition: testbeginend.c:61
int rtems_test_end(const char *name)
Prints an end of test message using printf().
Definition: testbeginend.c:98
#define NULL
Requests a GPIO pin group configuration.
Definition: xil_types.h:54
#define CPU_INTERRUPT_STACK_ALIGNMENT
Definition: cpu.h:632
This header file provides the interfaces of the Earliest Deadline First (EDF) Priority SMP Scheduler.
This header file provides interfaces of the Deterministic Priority Scheduler which are used by the im...
This structure represents a chain node.
Definition: chain.h:78
The scheduler operations.
Definition: scheduler.h:62
unsigned size
Definition: tte.h:1
This header file provides interfaces of the RTEMS Test Support.
This header file defines the scheduler test support API.
This header file provides interfaces of the RTEMS Test Framework.
This header file provides the constants used by the test suite configuration.
This header file provides the support functions for the validation test cases.
This union represents a chain control block.
Definition: chain.h:96