change log for rtems (2011-07-29)
rtems-vc at rtems.org
rtems-vc at rtems.org
Fri Jul 29 13:10:13 UTC 2011
*jennifer*:
2011-07-29 Jennifer Averett <Jennifer.Averett at OARcorp.com>
* smp01/init.c, smp02/init.c, smp02/tasks.c, smp03/init.c,
smp03/tasks.c, smp04/Makefile.am, smp04/init.c, smp05/init.c,
smp06/init.c, smp07/init.c, smp08/init.c: Cleaned up tests and fixed
some print statement problems.
* smp04/tasks.c: Removed.
M 1.4 testsuites/smptests/ChangeLog
M 1.2 testsuites/smptests/smp01/init.c
M 1.2 testsuites/smptests/smp02/init.c
M 1.2 testsuites/smptests/smp02/tasks.c
M 1.2 testsuites/smptests/smp03/init.c
M 1.2 testsuites/smptests/smp03/tasks.c
M 1.2 testsuites/smptests/smp04/Makefile.am
M 1.2 testsuites/smptests/smp04/init.c
R 1.1 testsuites/smptests/smp04/tasks.c
M 1.2 testsuites/smptests/smp05/init.c
M 1.2 testsuites/smptests/smp06/init.c
M 1.2 testsuites/smptests/smp07/init.c
M 1.2 testsuites/smptests/smp08/init.c
diff -u rtems/testsuites/smptests/ChangeLog:1.3 rtems/testsuites/smptests/ChangeLog:1.4
--- rtems/testsuites/smptests/ChangeLog:1.3 Wed Jun 29 12:38:53 2011
+++ rtems/testsuites/smptests/ChangeLog Fri Jul 29 07:29:33 2011
@@ -1,3 +1,11 @@
+2011-07-29 Jennifer Averett <Jennifer.Averett at OARcorp.com>
+
+ * smp01/init.c, smp02/init.c, smp02/tasks.c, smp03/init.c,
+ smp03/tasks.c, smp04/Makefile.am, smp04/init.c, smp05/init.c,
+ smp06/init.c, smp07/init.c, smp08/init.c: Cleaned up tests and fixed
+ some print statement problems.
+ * smp04/tasks.c: Removed.
+
2011-06-29 Joel Sherrill <joel.sherrill at oarcorp.com>
* smp01/smp01.doc, smp02/smp02.doc, smp03/smp03.doc, smp04/smp04.doc,
diff -u rtems/testsuites/smptests/smp01/init.c:1.1 rtems/testsuites/smptests/smp01/init.c:1.2
--- rtems/testsuites/smptests/smp01/init.c:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp01/init.c Fri Jul 29 07:29:33 2011
@@ -63,7 +63,7 @@
directive_failed( status, "task create" );
cpu_num = bsp_smp_processor_id();
- (" CPU %d start task TA%c\n", cpu_num, ch);
+ locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
status = rtems_task_start( id, Test_task, i+1 );
directive_failed( status, "task start" );
@@ -78,8 +78,7 @@
allDone = false;
}
if (allDone) {
- Loop();
- locked_printf( "*** END OF TEST SMP01 ***" );
+ locked_printf( "*** END OF TEST SMP01 ***\n" );
rtems_test_exit( 0 );
}
}
diff -u rtems/testsuites/smptests/smp02/init.c:1.1 rtems/testsuites/smptests/smp02/init.c:1.2
--- rtems/testsuites/smptests/smp02/init.c:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp02/init.c Fri Jul 29 07:29:33 2011
@@ -47,7 +47,7 @@
status = rtems_semaphore_obtain( Semaphore, RTEMS_WAIT, 0);
directive_failed( status,"rtems_semaphore_obtain of SEM1\n");
- for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
+ for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){
/* Create and start tasks for each CPU */
ch = '0' + i;
@@ -64,7 +64,6 @@
cpu_num = bsp_smp_processor_id();
locked_printf(" CPU %d start task TA%c\n", cpu_num, ch);
status = rtems_task_start( id, Test_task, i+1 );
- locked_printf(str, "rtems_task_start TA%d", i+1);
directive_failed( status, str );
}
diff -u rtems/testsuites/smptests/smp02/tasks.c:1.1 rtems/testsuites/smptests/smp02/tasks.c:1.2
--- rtems/testsuites/smptests/smp02/tasks.c:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp02/tasks.c Fri Jul 29 07:29:33 2011
@@ -15,7 +15,7 @@
#include "system.h"
-void Loop() {
+void Loop(void) {
volatile int i;
for (i=0; i<300000; i++);
@@ -26,8 +26,6 @@
int cpu_num,
uint32_t task_index
){
- int i;
-
if (Log_index < LOG_SIZE) {
/* Log the information */
Log[ Log_index ].IsLocked = obtained;
@@ -57,7 +55,5 @@
LogSemaphore(false, cpu_num, task_index);
rtems_semaphore_release( Semaphore );
- }
-
- while(1);
+ } while(1);
}
diff -u rtems/testsuites/smptests/smp03/init.c:1.1 rtems/testsuites/smptests/smp03/init.c:1.2
--- rtems/testsuites/smptests/smp03/init.c:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp03/init.c Fri Jul 29 07:29:34 2011
@@ -29,7 +29,6 @@
)
{
int cpu_num;
- rtems_status_code sc;
cpu_num = bsp_smp_processor_id();
@@ -41,21 +40,21 @@
)
{
int i;
- char ch;
+ char ch = '0';
rtems_id id;
rtems_status_code status;
Loop();
locked_print_initialize();
- locked_printf( "\n\n*** SMP03 TEST ***" );
+ locked_printf( "\n\n*** SMP03 TEST ***\n" );
/* Show that the init task is running on this cpu */
PrintTaskInfo( "Init" );
/* for each remaining cpu create and start a task */
- for ( i=1; i < CONFIGURE_SMP_MAXIMUM_PROCESSORS; i++ ){
+ for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){
ch = '0' + i;
@@ -82,13 +81,15 @@
&id
);
TestFinished = false;
- status = rtems_task_start( id, Test_task, CONFIGURE_SMP_MAXIMUM_PROCESSORS );
+ status = rtems_task_start(id,Test_task,rtems_smp_get_number_of_processors());
/* Wait on the last task to run */
while(!TestFinished)
;
/* End the test */
- locked_printf( "*** END OF TEST SMP03 ***" );
+ Loop();
+ locked_printf( "*** END OF TEST SMP03 ***\n" );
+ Loop();
rtems_test_exit( 0 );
}
diff -u rtems/testsuites/smptests/smp03/tasks.c:1.1 rtems/testsuites/smptests/smp03/tasks.c:1.2
--- rtems/testsuites/smptests/smp03/tasks.c:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp03/tasks.c Fri Jul 29 07:29:34 2011
@@ -28,7 +28,7 @@
/* If this is the last task created set a flag for the
* test to end.
*/
- if ( task_index == CONFIGURE_SMP_MAXIMUM_PROCESSORS ) {
+ if ( task_index == rtems_smp_get_number_of_processors() ) {
TestFinished = true;
}
diff -u rtems/testsuites/smptests/smp04/Makefile.am:1.1 rtems/testsuites/smptests/smp04/Makefile.am:1.2
--- rtems/testsuites/smptests/smp04/Makefile.am:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp04/Makefile.am Fri Jul 29 07:29:34 2011
@@ -5,7 +5,7 @@
MANAGERS = all
rtems_tests_PROGRAMS = smp04
-smp04_SOURCES = init.c tasks.c system.h ../../support/src/locked_print.c
+smp04_SOURCES = init.c system.h ../../support/src/locked_print.c
dist_rtems_tests_DATA = smp04.scn
dist_rtems_tests_DATA += smp04.doc
diff -u rtems/testsuites/smptests/smp04/init.c:1.1 rtems/testsuites/smptests/smp04/init.c:1.2
--- rtems/testsuites/smptests/smp04/init.c:1.1 Tue Jun 28 16:08:47 2011
+++ rtems/testsuites/smptests/smp04/init.c Fri Jul 29 07:29:34 2011
@@ -25,15 +25,18 @@
for (i=0; i<500000; i++);
}
-void PrintTaskInfo(
- const char *task_name
+rtems_task Test_task(
+ rtems_task_argument task_index
)
{
int cpu_num;
cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d running task TA%" PRIu32 "\n", cpu_num, task_index );
+ Loop();
+ TaskRan[task_index] = true;
- locked_printf(" CPU %d running task %s\n", cpu_num, task_name );
+ while(1);
}
rtems_task Init(
@@ -45,17 +48,26 @@
rtems_id id;
rtems_status_code status;
bool allDone;
+ int cpu_num;
Loop();
locked_print_initialize();
locked_printf( "\n\n*** SMP04 TEST ***\n" );
- PrintTaskInfo( "Init" );
+ /* Display which cpu is running this init thread. */
+ cpu_num = bsp_smp_processor_id();
+ locked_printf(" CPU %d running task Init\n", cpu_num );
+ /* Set all Tasks to not ran except for the init task */
TaskRan[0] = true;
for ( i=1; i <= rtems_smp_get_number_of_processors() ; i++ )
TaskRan[i] = false;
+
+ /*
+ * For each processor create and start a task alternating
+ * between RTEMS_PREEMPT and RTEMS_NO_PREEMPT.
+ */
for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
/* Create and start tasks for each CPU */
@@ -75,20 +87,33 @@
RTEMS_DEFAULT_ATTRIBUTES,
&id
);
- }
- for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){
+ locked_printf(
+ "Start TA%c a %s task\n",
+ ch,
+ ((i%2) ? "RTEMS_PREEMPT" : "RTEMS_NO_PREEMPT" )
+ );
status = rtems_task_start( id, Test_task, i );
- /* Force a wait on the task to run in order to synchronize on
+ /*
+ * Force a wait on the task to run in order to synchronize on
* simulated systems.
*/
while (TaskRan[i] == false)
;
}
+ /*
+ * Create and start one more task. This task
+ * should preempt the longest running PREEMPTABLE
+ * task and run on that cpu.
+ */
ch = '0' + rtems_smp_get_number_of_processors() ;
-
+ locked_printf(
+ "Create a TA%c a %s task\n",
+ ch,
+ "RTEMS_PREEMPT"
+ );
status = rtems_task_create(
rtems_build_name( 'T', 'A', ch, ' ' ),
3,
@@ -97,13 +122,20 @@
RTEMS_DEFAULT_ATTRIBUTES,
&id
);
+ locked_printf(
+ "Start TA%c a %s task\n",
+ ch,
+ "RTEMS_PREEMPT"
+ );
status = rtems_task_start(
id,
Test_task,
rtems_smp_get_number_of_processors()
);
- /* Wait on the all tasks to run */
+ /*
+ * Wait on the all tasks to run
+ */
while (1) {
allDone = true;
for ( i=1; i<=rtems_smp_get_number_of_processors() ; i++ ) {
@@ -112,7 +144,7 @@
}
if (allDone) {
Loop();
- locked_printf( "*** END OF TEST SMP04 ***" );
+ locked_printf( "*** END OF TEST SMP04 ***\n" );
rtems_test_exit( 0 );
}
}
diff -u rtems/testsuites/smptests/smp05/init.c:1.1 rtems/testsuites/smptests/smp05/init.c:1.2
--- rtems/testsuites/smptests/smp05/init.c:1.1 Tue Jun 28 16:08:48 2011
+++ rtems/testsuites/smptests/smp05/init.c Fri Jul 29 07:29:34 2011
@@ -17,7 +17,7 @@
)
{
locked_printf( "Shut down from CPU %d\n", bsp_smp_processor_id() );
- locked_printf( "*** END OF TEST SMP05 ***" );
+ locked_printf( "*** END OF TEST SMP05 ***\n" );
rtems_test_exit(0);
}
diff -u rtems/testsuites/smptests/smp06/init.c:1.1 rtems/testsuites/smptests/smp06/init.c:1.2
--- rtems/testsuites/smptests/smp06/init.c:1.1 Tue Jun 28 16:08:48 2011
+++ rtems/testsuites/smptests/smp06/init.c Fri Jul 29 07:29:34 2011
@@ -31,7 +31,7 @@
Ran = true;
if ( do_exit ) {
- locked_printf( "*** END OF TEST SMP06 ***" );
+ locked_printf( "*** END OF TEST SMP06 ***\n" );
rtems_test_exit(0);
}
while(1)
@@ -42,8 +42,6 @@
rtems_task_argument argument
)
{
- int i;
- char ch;
int cpu_num;
rtems_id id;
rtems_status_code status;
@@ -115,7 +113,7 @@
#define CONFIGURE_MAXIMUM_TASKS 4
#define CONFIGURE_INIT_TASK_PRIORITY 2
-#define CONFIGURE_INIT_TASK_MODES RTEMS_PREEMPT
+#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_PREEMPT
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
diff -u rtems/testsuites/smptests/smp07/init.c:1.1 rtems/testsuites/smptests/smp07/init.c:1.2
--- rtems/testsuites/smptests/smp07/init.c:1.1 Tue Jun 28 16:08:48 2011
+++ rtems/testsuites/smptests/smp07/init.c Fri Jul 29 07:29:34 2011
@@ -44,7 +44,11 @@
TaskRan = true;
/* Print that the task is up and running. */
- locked_printf(" CPU %d running Task %s after semaphore release\n", cpu_num, name);
+ locked_printf(
+ " CPU %d running Task %s after semaphore release\n",
+ cpu_num,
+ name
+ );
(void) rtems_task_delete( RTEMS_SELF );
}
diff -u rtems/testsuites/smptests/smp08/init.c:1.1 rtems/testsuites/smptests/smp08/init.c:1.2
--- rtems/testsuites/smptests/smp08/init.c:1.1 Tue Jun 28 16:08:48 2011
+++ rtems/testsuites/smptests/smp08/init.c Fri Jul 29 07:29:34 2011
@@ -22,7 +22,6 @@
)
{
int cpu_num;
- rtems_status_code sc;
cpu_num = bsp_smp_processor_id();
@@ -45,7 +44,7 @@
rtems_status_code status;
rtems_time_of_day time;
int i;
- char ch;
+ char ch[4];
rtems_id id;
locked_print_initialize();
@@ -77,10 +76,10 @@
PrintTaskInfo( "Init", &time );
for ( i=1; i <= rtems_smp_get_number_of_processors() *3; i++ ) {
- ch = '0' + i;
+ sprintf(ch, "%02" PRId32, i );
status = rtems_task_create(
- rtems_build_name( 'T', 'A', ch, ' ' ),
+ rtems_build_name( 'T', 'A', ch[0], ch[1] ),
1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_DEFAULT_MODES,
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110729/9c29bae7/attachment.html>
More information about the vc
mailing list