diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2003-11-11 00:59:06 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2003-11-11 00:59:06 +0000 |
commit | e164eef409c072a5c1c7f3e905129df4a06478ab (patch) | |
tree | 493633b5b1c27c6954d7b779c943d6ad22966cee /c/src/tests/tmtests/tm26/task1.c | |
parent | 2003-11-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de> (diff) | |
download | rtems-e164eef409c072a5c1c7f3e905129df4a06478ab.tar.bz2 |
2003-11-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* include/.cvsignore: Remove.
* include/Makefile.am: Remove.
* include/timesys.h: Remove.
* .cvsignore: Remove.
* ChangeLog: Remove.
* Makefile.am: Remove.
* README: Remove.
* configure.ac: Remove.
* tmtests.am: Remove.
* tm01/.cvsignore: Remove.
* tm01/Makefile.am: Remove.
* tm01/system.h: Remove.
* tm01/task1.c: Remove.
* tm01/tm01.doc: Remove.
* tm02/.cvsignore: Remove.
* tm02/Makefile.am: Remove.
* tm02/system.h: Remove.
* tm02/task1.c: Remove.
* tm02/tm02.doc: Remove.
* tm03/.cvsignore: Remove.
* tm03/Makefile.am: Remove.
* tm03/system.h: Remove.
* tm03/task1.c: Remove.
* tm03/tm03.doc: Remove.
* tm04/.cvsignore: Remove.
* tm04/Makefile.am: Remove.
* tm04/system.h: Remove.
* tm04/task1.c: Remove.
* tm04/tm04.doc: Remove.
* tm05/.cvsignore: Remove.
* tm05/Makefile.am: Remove.
* tm05/system.h: Remove.
* tm05/task1.c: Remove.
* tm05/tm05.doc: Remove.
* tm06/.cvsignore: Remove.
* tm06/Makefile.am: Remove.
* tm06/system.h: Remove.
* tm06/task1.c: Remove.
* tm06/tm06.doc: Remove.
* tm07/.cvsignore: Remove.
* tm07/Makefile.am: Remove.
* tm07/system.h: Remove.
* tm07/task1.c: Remove.
* tm07/tm07.doc: Remove.
* tm08/.cvsignore: Remove.
* tm08/Makefile.am: Remove.
* tm08/system.h: Remove.
* tm08/task1.c: Remove.
* tm08/tm08.doc: Remove.
* tm09/.cvsignore: Remove.
* tm09/Makefile.am: Remove.
* tm09/system.h: Remove.
* tm09/task1.c: Remove.
* tm09/tm09.doc: Remove.
* tm10/.cvsignore: Remove.
* tm10/Makefile.am: Remove.
* tm10/system.h: Remove.
* tm10/task1.c: Remove.
* tm10/tm10.doc: Remove.
* tm11/.cvsignore: Remove.
* tm11/Makefile.am: Remove.
* tm11/system.h: Remove.
* tm11/task1.c: Remove.
* tm11/tm11.doc: Remove.
* tm12/.cvsignore: Remove.
* tm12/Makefile.am: Remove.
* tm12/system.h: Remove.
* tm12/task1.c: Remove.
* tm12/tm12.doc: Remove.
* tm13/.cvsignore: Remove.
* tm13/Makefile.am: Remove.
* tm13/system.h: Remove.
* tm13/task1.c: Remove.
* tm13/tm13.doc: Remove.
* tm14/.cvsignore: Remove.
* tm14/Makefile.am: Remove.
* tm14/system.h: Remove.
* tm14/task1.c: Remove.
* tm14/tm14.doc: Remove.
* tm15/.cvsignore: Remove.
* tm15/Makefile.am: Remove.
* tm15/system.h: Remove.
* tm15/task1.c: Remove.
* tm15/tm15.doc: Remove.
* tm16/.cvsignore: Remove.
* tm16/Makefile.am: Remove.
* tm16/system.h: Remove.
* tm16/task1.c: Remove.
* tm16/tm16.doc: Remove.
* tm17/.cvsignore: Remove.
* tm17/Makefile.am: Remove.
* tm17/system.h: Remove.
* tm17/task1.c: Remove.
* tm17/tm17.doc: Remove.
* tm18/.cvsignore: Remove.
* tm18/Makefile.am: Remove.
* tm18/system.h: Remove.
* tm18/task1.c: Remove.
* tm18/tm18.doc: Remove.
* tm19/.cvsignore: Remove.
* tm19/Makefile.am: Remove.
* tm19/system.h: Remove.
* tm19/task1.c: Remove.
* tm19/tm19.doc: Remove.
* tm20/.cvsignore: Remove.
* tm20/Makefile.am: Remove.
* tm20/system.h: Remove.
* tm20/task1.c: Remove.
* tm20/tm20.doc: Remove.
* tm21/.cvsignore: Remove.
* tm21/Makefile.am: Remove.
* tm21/system.h: Remove.
* tm21/task1.c: Remove.
* tm21/tm21.doc: Remove.
* tm22/.cvsignore: Remove.
* tm22/Makefile.am: Remove.
* tm22/system.h: Remove.
* tm22/task1.c: Remove.
* tm22/tm22.doc: Remove.
* tm23/.cvsignore: Remove.
* tm23/Makefile.am: Remove.
* tm23/system.h: Remove.
* tm23/task1.c: Remove.
* tm23/tm23.doc: Remove.
* tm24/.cvsignore: Remove.
* tm24/Makefile.am: Remove.
* tm24/system.h: Remove.
* tm24/task1.c: Remove.
* tm24/tm24.doc: Remove.
* tm25/.cvsignore: Remove.
* tm25/Makefile.am: Remove.
* tm25/system.h: Remove.
* tm25/task1.c: Remove.
* tm25/tm25.doc: Remove.
* tm26/.cvsignore: Remove.
* tm26/Makefile.am: Remove.
* tm26/fptest.h: Remove.
* tm26/system.h: Remove.
* tm26/task1.c: Remove.
* tm26/tm26.doc: Remove.
* tm27/.cvsignore: Remove.
* tm27/Makefile.am: Remove.
* tm27/system.h: Remove.
* tm27/task1.c: Remove.
* tm27/tm27.doc: Remove.
* tm28/.cvsignore: Remove.
* tm28/Makefile.am: Remove.
* tm28/system.h: Remove.
* tm28/task1.c: Remove.
* tm28/tm28.doc: Remove.
* tm29/.cvsignore: Remove.
* tm29/Makefile.am: Remove.
* tm29/system.h: Remove.
* tm29/task1.c: Remove.
* tm29/tm29.doc: Remove.
* tmck/.cvsignore: Remove.
* tmck/Makefile.am: Remove.
* tmck/system.h: Remove.
* tmck/task1.c: Remove.
* tmck/tmck.doc: Remove.
* tmoverhd/.cvsignore: Remove.
* tmoverhd/Makefile.am: Remove.
* tmoverhd/dumrtems.h: Remove.
* tmoverhd/empty.c: Remove.
* tmoverhd/system.h: Remove.
* tmoverhd/testtask.c: Remove.
* tmoverhd/tmoverhd.doc: Remove.
Diffstat (limited to 'c/src/tests/tmtests/tm26/task1.c')
-rw-r--r-- | c/src/tests/tmtests/tm26/task1.c | 594 |
1 files changed, 0 insertions, 594 deletions
diff --git a/c/src/tests/tmtests/tm26/task1.c b/c/src/tests/tmtests/tm26/task1.c deleted file mode 100644 index 6db80632f8..0000000000 --- a/c/src/tests/tmtests/tm26/task1.c +++ /dev/null @@ -1,594 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - * - * $Id$ - */ - -#define TEST_INIT -#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ -#include <rtems.h> -#include "system.h" -#include "fptest.h" -#include <coverhd.h> -#include <tmacros.h> -#include <timesys.h> - - -/* TEST DATA */ -rtems_id Semaphore_id; - -Objects_Locations location; /* uses internal RTEMS type */ - -Thread_Control *Middle_tcb; /* uses internal RTEMS type */ - -Thread_Control *Low_tcb; /* uses internal RTEMS type */ - -/* - * Variables to hold execution times until they are printed - * at the end of the test. - */ - -rtems_unsigned32 isr_disable_time; -rtems_unsigned32 isr_flash_time; -rtems_unsigned32 isr_enable_time; -rtems_unsigned32 thread_disable_dispatch_time; -rtems_unsigned32 thread_enable_dispatch_time; -rtems_unsigned32 thread_set_state_time; -rtems_unsigned32 thread_dispatch_no_fp_time; -rtems_unsigned32 context_switch_no_fp_time; -rtems_unsigned32 context_switch_self_time; -rtems_unsigned32 context_switch_another_task_time; -rtems_unsigned32 context_switch_restore_1st_fp_time; -rtems_unsigned32 context_switch_save_idle_restore_initted_time; -rtems_unsigned32 context_switch_save_restore_idle_time; -rtems_unsigned32 context_switch_save_restore_initted_time; -rtems_unsigned32 thread_resume_time; -rtems_unsigned32 thread_unblock_time; -rtems_unsigned32 thread_ready_time; -rtems_unsigned32 thread_get_time; -rtems_unsigned32 semaphore_get_time; -rtems_unsigned32 thread_get_invalid_time; - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Middle_task( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -rtems_task Floating_point_task_1( - rtems_task_argument argument -); - -rtems_task Floating_point_task_2( - rtems_task_argument argument -); - -void complete_test( void ); - -rtems_task null_task( - rtems_task_argument argument -) -{ -} - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_id task_id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 26 ***" ); - - status = rtems_task_create( - rtems_build_name( 'F', 'P', '1', ' ' ), - 201, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &task_id - ); - directive_failed( status, "rtems_task_create of FP1" ); - - status = rtems_task_start( task_id, Floating_point_task_1, 0 ); - directive_failed( status, "rtems_task_start of FP1" ); - - status = rtems_task_create( - rtems_build_name( 'F', 'P', '2', ' ' ), - 202, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &task_id - ); - directive_failed( status, "rtems_task_create of FP2" ); - - status = rtems_task_start( task_id, Floating_point_task_2, 0 ); - directive_failed( status, "rtems_task_start of FP2" ); - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - 200, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of LOW" ); - - status = rtems_task_start( task_id, Low_task, 0 ); - directive_failed( status, "rtems_task_start of LOW" ); - - status = rtems_task_create( - rtems_build_name( 'M', 'I', 'D', ' ' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of MIDDLE" ); - - status = rtems_task_start( task_id, Middle_task, 0 ); - directive_failed( status, "rtems_task_start of MIDDLE" ); - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of HIGH" ); - - status = rtems_task_start( task_id, High_task, 0 ); - directive_failed( status, "rtems_task_start of HIGH" ); - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'E', 'M', '1' ), - OPERATION_COUNT, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id - ); - directive_failed( status, "rtems_semaphore_create" ); - - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'N', 'U', 'L', 'L' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( task_id, null_task, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_interrupt_level level; - - Timer_initialize(); - rtems_interrupt_disable( level ); - isr_disable_time = Read_timer(); - - Timer_initialize(); - rtems_interrupt_flash( level ); - isr_flash_time = Read_timer(); - - Timer_initialize(); - rtems_interrupt_enable( level ); - isr_enable_time = Read_timer(); - - Timer_initialize(); - _Thread_Disable_dispatch(); - thread_disable_dispatch_time = Read_timer(); - - Timer_initialize(); - _Thread_Enable_dispatch(); - thread_enable_dispatch_time = Read_timer(); - - Timer_initialize(); - _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); - thread_set_state_time = Read_timer(); - - _Context_Switch_necessary = TRUE; - - Timer_initialize(); - _Thread_Dispatch(); /* dispatches Middle_task */ -} - -rtems_task Middle_task( - rtems_task_argument argument -) -{ - thread_dispatch_no_fp_time = Read_timer(); - - _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); - - Middle_tcb = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[200].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); - _Context_Switch( &Middle_tcb->Registers, &_Thread_Executing->Registers ); - - Timer_initialize(); - _Context_Switch(&Middle_tcb->Registers, &Low_tcb->Registers); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - Thread_Control *executing; - - context_switch_no_fp_time = Read_timer(); - - executing = _Thread_Executing; - - Low_tcb = executing; - - Timer_initialize(); - _Context_Switch( &executing->Registers, &executing->Registers ); - - context_switch_self_time = Read_timer(); - - _Context_Switch(&executing->Registers, &Middle_tcb->Registers); - - context_switch_another_task_time = Read_timer(); - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); -} - -rtems_task Floating_point_task_1( - rtems_task_argument argument -) -{ - Thread_Control *executing; - FP_DECLARE; - - context_switch_restore_1st_fp_time = Read_timer(); - - executing = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[202].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_2 */ - - context_switch_save_idle_restore_initted_time = Read_timer(); - - FP_LOAD( 1.0 ); - - executing = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[202].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_2 */ -} - -rtems_task Floating_point_task_2( - rtems_task_argument argument -) -{ - Thread_Control *executing; - FP_DECLARE; - - context_switch_save_restore_idle_time = Read_timer(); - - executing = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; - - FP_LOAD( 1.0 ); - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_1 */ - - context_switch_save_restore_initted_time = Read_timer(); - - complete_test(); -} - -void complete_test( void ) -{ - rtems_unsigned32 index; - rtems_id task_id; - - Timer_initialize(); - _Thread_Resume( Middle_tcb, TRUE ); - thread_resume_time = Read_timer(); - - _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); - - Timer_initialize(); - _Thread_Unblock( Middle_tcb ); - thread_unblock_time = Read_timer(); - - _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); - - Timer_initialize(); - _Thread_Ready( Middle_tcb ); - thread_ready_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - task_id = Middle_tcb->Object.id; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( task_id, &location ); - thread_get_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Semaphore_Get( Semaphore_id, &location ); - semaphore_get_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( 0x3, &location ); - thread_get_invalid_time = Read_timer(); - - /* - * Now dump all the times - */ - - put_time( - "_ISR_Disable", - isr_disable_time, - 1, - 0, - 0 - ); - - put_time( - "_ISR_Flash", - isr_flash_time, - 1, - 0, - 0 - ); - - put_time( - "_ISR_Enable", - isr_enable_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Disable_dispatch", - thread_disable_dispatch_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Enable_dispatch", - thread_enable_dispatch_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Set_state", - thread_set_state_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Disptach (NO FP)", - thread_dispatch_no_fp_time, - 1, - 0, - 0 - ); - - put_time( - "context switch: no floating point contexts", - context_switch_no_fp_time, - 1, - 0, - 0 - ); - - put_time( - "context switch: self", - context_switch_self_time, - 1, - 0, - 0 - ); - - put_time( - "context switch: to another task", - context_switch_another_task_time, - 1, - 0, - 0 - ); - -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - put_time( - "fp context switch: restore 1st FP task", - context_switch_restore_1st_fp_time, - 1, - 0, - 0 - ); - - put_time( - "fp context switch: save idle, restore initialized", - context_switch_save_idle_restore_initted_time, - 1, - 0, - 0 - ); - - put_time( - "fp context switch: save idle, restore idle", - context_switch_save_restore_idle_time, - 1, - 0, - 0 - ); - - put_time( - "fp context switch: save initialized, restore initialized", - context_switch_save_restore_initted_time, - 1, - 0, - 0 - ); -#else - puts( "fp context switch: restore 1st FP task - NA" ); - puts( "fp context switch: save idle, restore initialized - NA" ); - puts( "fp context switch: save idle, restore idle - NA" ); - puts( "fp context switch: save initialized, restore initialized - NA" ); -#endif - - put_time( - "_Thread_Resume", - thread_resume_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Unblock", - thread_unblock_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Ready", - thread_ready_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Get", - thread_get_time, - OPERATION_COUNT, - 0, - 0 - ); - - put_time( - "_Semaphore_Get", - semaphore_get_time, - OPERATION_COUNT, - 0, - 0 - ); - - put_time( - "_Thread_Get: invalid id", - thread_get_invalid_time, - OPERATION_COUNT, - 0, - 0 - ); - - puts( "*** END OF TEST 26 ***" ); - rtems_test_exit( 0 ); -} - |