4.104.114.84.95
Rev | Line | |
---|
[ac7d5ef0] | 1 | /* Task_switch |
---|
| 2 | * |
---|
| 3 | * This routine is the tswitch user extension. It determines which |
---|
| 4 | * task is being switched to and displays a message indicating the |
---|
| 5 | * time and date that it gained control. |
---|
| 6 | * |
---|
| 7 | * Input parameters: |
---|
| 8 | * unused - pointer to currently running TCB |
---|
| 9 | * heir - pointer to heir TCB |
---|
| 10 | * |
---|
| 11 | * Output parameters: NONE |
---|
| 12 | * |
---|
[60b791ad] | 13 | * COPYRIGHT (c) 1989-1998. |
---|
[ac7d5ef0] | 14 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 15 | * Copyright assigned to U.S. Government, 1994. |
---|
[ac7d5ef0] | 16 | * |
---|
[98e4ebf5] | 17 | * The license and distribution terms for this file may be |
---|
| 18 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 19 | * http://www.OARcorp.com/rtems/license.html. |
---|
[ac7d5ef0] | 20 | * |
---|
[3235ad9] | 21 | * $Id$ |
---|
[ac7d5ef0] | 22 | */ |
---|
| 23 | |
---|
| 24 | #include "system.h" |
---|
| 25 | |
---|
| 26 | rtems_extension Task_switch( |
---|
| 27 | rtems_tcb *unused, |
---|
| 28 | rtems_tcb *heir |
---|
| 29 | ) |
---|
| 30 | { |
---|
| 31 | rtems_unsigned32 index; |
---|
| 32 | rtems_time_of_day time; |
---|
| 33 | rtems_status_code status; |
---|
| 34 | |
---|
| 35 | index = task_number( heir->Object.id ); |
---|
| 36 | |
---|
| 37 | switch( index ) { |
---|
| 38 | case 1: |
---|
| 39 | case 2: |
---|
| 40 | case 3: |
---|
| 41 | Run_count[ index ] += 1; |
---|
| 42 | |
---|
| 43 | status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); |
---|
| 44 | directive_failed( status, "rtems_clock_get" ); |
---|
| 45 | |
---|
| 46 | put_name( Task_name[ index ], FALSE ); |
---|
[88d594a] | 47 | print_time( "- ", &time, "\n" ); |
---|
[ac7d5ef0] | 48 | |
---|
| 49 | if ( time.second >= 16 ) { |
---|
| 50 | puts( "*** END OF TEST 4 ***" ); |
---|
| 51 | exit( 0 ); |
---|
| 52 | } |
---|
| 53 | break; |
---|
| 54 | |
---|
| 55 | case 0: |
---|
| 56 | default: |
---|
| 57 | break; |
---|
| 58 | } |
---|
| 59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.