Changeset 9b413ea in rtems


Ignore:
Timestamp:
Jun 12, 1998, 8:55:21 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
7738906
Parents:
2a53f31
Message:

Patch from Eric Norum to avoid printing from context switch user extension.

The array is too long and needs to be shortened.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/tests/sptests/sp04/system.h

    r2a53f31 r9b413ea  
    6767TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ]; 
    6868 
     69/*
     70 * Keep track of task switches
     71 */
     72struct taskSwitchLog {
     73  int               taskIndex;
     74  rtems_time_of_day when;
     75};
     76extern struct taskSwitchLog taskSwitchLog[];
     77extern int taskSwitchLogIndex;
     78volatile extern int testsFinished;
     79
    6980/* end of include file */
  • c/src/tests/sptests/sp04/task1.c

    r2a53f31 r9b413ea  
    2121
    2222#include "system.h"
     23
     24static void
     25showTaskSwitches (void)
     26{
     27  int i;
     28  int switches = taskSwitchLogIndex;
     29
     30  for (i = 0 ; i < switches ; i++) {
     31      put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE );
     32      print_time( "- ", &taskSwitchLog[i].when, "\n" );
     33  }
     34}
    2335
    2436rtems_task Task_1(
     
    98110      directive_failed( status, "rtems_task_mode" );
    99111
    100       while ( FOREVER );
     112      while ( !testsFinished );
     113      showTaskSwitches ();
     114      puts( "*** END OF TEST 4 ***" );
     115      exit (0);
    101116    }
    102117  }
  • c/src/tests/sptests/sp04/tswitch.c

    r2a53f31 r9b413ea  
    2424#include "system.h"
    2525
     26struct taskSwitchLog taskSwitchLog[1000];
     27int taskSwitchLogIndex;
     28volatile int testsFinished;;
     29
    2630rtems_extension Task_switch(
    2731  rtems_tcb *unused,
     
    4448      directive_failed( status, "rtems_clock_get" );
    4549
    46       put_name( Task_name[ index ], FALSE );
    47       print_time( "- ", &time, "\n" );
    48 
    49       if ( time.second >= 16 ) {
    50         puts( "*** END OF TEST 4 ***" );
    51         exit( 0 );
     50      if (taskSwitchLogIndex < (sizeof taskSwitchLog / sizeof taskSwitchLog[0])) {
     51        taskSwitchLog[taskSwitchLogIndex].taskIndex = index;
     52        taskSwitchLog[taskSwitchLogIndex].when = time;
     53        taskSwitchLogIndex++;
    5254      }
     55      if ( time.second >= 16 )
     56        testsFinished = 1;
    5357      break;
    5458
  • testsuites/sptests/sp04/system.h

    r2a53f31 r9b413ea  
    6767TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ]; 
    6868 
     69/*
     70 * Keep track of task switches
     71 */
     72struct taskSwitchLog {
     73  int               taskIndex;
     74  rtems_time_of_day when;
     75};
     76extern struct taskSwitchLog taskSwitchLog[];
     77extern int taskSwitchLogIndex;
     78volatile extern int testsFinished;
     79
    6980/* end of include file */
  • testsuites/sptests/sp04/task1.c

    r2a53f31 r9b413ea  
    2121
    2222#include "system.h"
     23
     24static void
     25showTaskSwitches (void)
     26{
     27  int i;
     28  int switches = taskSwitchLogIndex;
     29
     30  for (i = 0 ; i < switches ; i++) {
     31      put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE );
     32      print_time( "- ", &taskSwitchLog[i].when, "\n" );
     33  }
     34}
    2335
    2436rtems_task Task_1(
     
    98110      directive_failed( status, "rtems_task_mode" );
    99111
    100       while ( FOREVER );
     112      while ( !testsFinished );
     113      showTaskSwitches ();
     114      puts( "*** END OF TEST 4 ***" );
     115      exit (0);
    101116    }
    102117  }
  • testsuites/sptests/sp04/tswitch.c

    r2a53f31 r9b413ea  
    2424#include "system.h"
    2525
     26struct taskSwitchLog taskSwitchLog[1000];
     27int taskSwitchLogIndex;
     28volatile int testsFinished;;
     29
    2630rtems_extension Task_switch(
    2731  rtems_tcb *unused,
     
    4448      directive_failed( status, "rtems_clock_get" );
    4549
    46       put_name( Task_name[ index ], FALSE );
    47       print_time( "- ", &time, "\n" );
    48 
    49       if ( time.second >= 16 ) {
    50         puts( "*** END OF TEST 4 ***" );
    51         exit( 0 );
     50      if (taskSwitchLogIndex < (sizeof taskSwitchLog / sizeof taskSwitchLog[0])) {
     51        taskSwitchLog[taskSwitchLogIndex].taskIndex = index;
     52        taskSwitchLog[taskSwitchLogIndex].when = time;
     53        taskSwitchLogIndex++;
    5254      }
     55      if ( time.second >= 16 )
     56        testsFinished = 1;
    5357      break;
    5458
Note: See TracChangeset for help on using the changeset viewer.