summaryrefslogtreecommitdiff
path: root/testsuites/tmtests/tm05/task1.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/tmtests/tm05/task1.c')
-rw-r--r--testsuites/tmtests/tm05/task1.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/testsuites/tmtests/tm05/task1.c b/testsuites/tmtests/tm05/task1.c
index 295a649840..fcaf56b8f9 100644
--- a/testsuites/tmtests/tm05/task1.c
+++ b/testsuites/tmtests/tm05/task1.c
@@ -1,6 +1,5 @@
/*
- *
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -13,7 +12,7 @@
#define CONFIGURE_INIT
#include "system.h"
-rtems_id Task_id[OPERATION_COUNT+1];
+rtems_id Task_id[OPERATION_COUNT+1];
uint32_t Task_index;
rtems_task High_task(
@@ -30,6 +29,8 @@ rtems_task Low_task(
void test_init();
+int operation_count = OPERATION_COUNT;
+
rtems_task Init(
rtems_task_argument argument
)
@@ -53,9 +54,12 @@ void test_init()
rtems_task_priority priority;
uint32_t index;
- priority = 250;
+ priority = RTEMS_MAXIMUM_PRIORITY - 1;
+
+ if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 )
+ operation_count = RTEMS_MAXIMUM_PRIORITY - 2;
- for( index = 0; index <= OPERATION_COUNT ; index++ ) {
+ for( index = 0; index <= operation_count ; index++ ) {
status = rtems_task_create(
rtems_build_name( 'T', 'I', 'M', 'E' ),
@@ -70,7 +74,7 @@ void test_init()
priority--;
if ( index==0 ) task_entry = Low_task;
- else if ( index==OPERATION_COUNT ) task_entry = High_task;
+ else if ( index==operation_count ) task_entry = High_task;
else task_entry = Middle_tasks;
status = rtems_task_start( Task_id[ index ], task_entry, 0 );
@@ -91,7 +95,7 @@ rtems_task High_task(
put_time(
"rtems_task_resume: task readied -- preempts caller",
end_time,
- OPERATION_COUNT,
+ operation_count,
0,
CALLING_OVERHEAD_TASK_RESUME
);
@@ -120,7 +124,7 @@ rtems_task Low_task(
put_time(
"rtems_task_suspend: calling task",
end_time,
- OPERATION_COUNT,
+ operation_count,
0,
CALLING_OVERHEAD_TASK_SUSPEND
);