diff options
Diffstat (limited to 'testsuites/tmtests/tm26')
-rw-r--r-- | testsuites/tmtests/tm26/fptest.h | 165 | ||||
-rw-r--r-- | testsuites/tmtests/tm26/system.h | 41 | ||||
-rw-r--r-- | testsuites/tmtests/tm26/task1.c | 550 | ||||
-rw-r--r-- | testsuites/tmtests/tm26/tm26.doc | 13 |
4 files changed, 0 insertions, 769 deletions
diff --git a/testsuites/tmtests/tm26/fptest.h b/testsuites/tmtests/tm26/fptest.h deleted file mode 100644 index 39b8438ef9..0000000000 --- a/testsuites/tmtests/tm26/fptest.h +++ /dev/null @@ -1,165 +0,0 @@ -/* fptest.h - * - * This include file contains the CPU dependent implementation - * of the following routines needed to test RTEMS floating - * point support: - * FP_load( &context ) - * FP_check( &context ) - * - * FP_load - loads the specified floating point context - * FP_check - checks the specified floating point context - * - * NOTE: These routines are VERY CPU dependent and are thus - * located in in the CPU dependent include file - * fptest.h. These routines form the core of the - * floating point context switch test. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - - -#ifndef __FPTEST_h -#define __FPTEST_h - -#include <stdio.h> - -#ifndef CPU_HARDWARE_FP -#error "This CPU does not have CPU_HARDWARE_FP defined" -#endif - -#if ( CPU_HARDWARE_FP == FALSE ) - -#define FP_DECLARE -#define FP_LOAD( _factor ) -#define FP_CHECK( _factor ) 0 - -#else - -#define FP_DECLARE \ - double fp01 = 1.0; \ - double fp02 = 2.0; \ - double fp03 = 3.0; \ - double fp04 = 4.0; \ - double fp05 = 5.0; \ - double fp06 = 6.0; \ - double fp07 = 7.0; \ - double fp08 = 8.0; \ - double fp09 = 9.0; \ - double fp10 = 10.0; \ - double fp11 = 11.0; \ - double fp12 = 12.0; \ - double fp13 = 13.0; \ - double fp14 = 14.0; \ - double fp15 = 15.0; \ - double fp16 = 16.0; \ - double fp17 = 17.0; \ - double fp18 = 18.0; \ - double fp19 = 19.0; \ - double fp20 = 20.0; \ - double fp21 = 21.0; \ - double fp22 = 22.0; \ - double fp23 = 23.0; \ - double fp24 = 24.0; \ - double fp25 = 25.0; \ - double fp26 = 26.0; \ - double fp27 = 27.0; \ - double fp28 = 28.0; \ - double fp29 = 29.0; \ - double fp30 = 30.0; \ - double fp31 = 31.0; \ - double fp32 = 32.0 - -#define FP_LOAD( _factor ) \ - do { \ - fp01 += _factor; \ - fp02 += _factor; \ - fp03 += _factor; \ - fp04 += _factor; \ - fp05 += _factor; \ - fp06 += _factor; \ - fp07 += _factor; \ - fp08 += _factor; \ - fp09 += _factor; \ - fp10 += _factor; \ - fp11 += _factor; \ - fp12 += _factor; \ - fp13 += _factor; \ - fp14 += _factor; \ - fp15 += _factor; \ - fp16 += _factor; \ - fp17 += _factor; \ - fp18 += _factor; \ - fp19 += _factor; \ - fp20 += _factor; \ - fp21 += _factor; \ - fp22 += _factor; \ - fp23 += _factor; \ - fp24 += _factor; \ - fp25 += _factor; \ - fp26 += _factor; \ - fp27 += _factor; \ - fp28 += _factor; \ - fp29 += _factor; \ - fp30 += _factor; \ - fp31 += _factor; \ - fp32 += _factor; \ - } while (0) - -#define EPSILON (0.0005) -#define FPABS(d) (((d) < 0.0) ? -(d) : (d)) -#define FPNEQ(a,b) (FPABS((a)-(b)) > EPSILON) - -#define FP_CHECK_ONE( _v, _base, _factor ) \ - if ( FPNEQ( (_v), ((_base) + (_factor)) ) ) { \ - printf("%d: " #_v " wrong -- (%g not %g)\n", \ - task_index, (_v), (_base + _factor)); \ - } - - -#define FP_CHECK( _factor ) \ - do { \ - FP_CHECK_ONE( fp01, 1.0, (_factor) ); \ - FP_CHECK_ONE( fp02, 2.0, (_factor) ); \ - FP_CHECK_ONE( fp03, 3.0, (_factor) ); \ - FP_CHECK_ONE( fp04, 4.0, (_factor) ); \ - FP_CHECK_ONE( fp05, 5.0, (_factor) ); \ - FP_CHECK_ONE( fp06, 6.0, (_factor) ); \ - FP_CHECK_ONE( fp07, 7.0, (_factor) ); \ - FP_CHECK_ONE( fp08, 8.0, (_factor) ); \ - FP_CHECK_ONE( fp09, 9.0, (_factor) ); \ - FP_CHECK_ONE( fp10, 10.0, (_factor) ); \ - FP_CHECK_ONE( fp11, 11.0, (_factor) ); \ - FP_CHECK_ONE( fp12, 12.0, (_factor) ); \ - FP_CHECK_ONE( fp13, 13.0, (_factor) ); \ - FP_CHECK_ONE( fp14, 14.0, (_factor) ); \ - FP_CHECK_ONE( fp15, 15.0, (_factor) ); \ - FP_CHECK_ONE( fp16, 16.0, (_factor) ); \ - FP_CHECK_ONE( fp17, 17.0, (_factor) ); \ - FP_CHECK_ONE( fp18, 18.0, (_factor) ); \ - FP_CHECK_ONE( fp19, 19.0, (_factor) ); \ - FP_CHECK_ONE( fp20, 20.0, (_factor) ); \ - FP_CHECK_ONE( fp21, 21.0, (_factor) ); \ - FP_CHECK_ONE( fp22, 22.0, (_factor) ); \ - FP_CHECK_ONE( fp23, 23.0, (_factor) ); \ - FP_CHECK_ONE( fp24, 24.0, (_factor) ); \ - FP_CHECK_ONE( fp25, 25.0, (_factor) ); \ - FP_CHECK_ONE( fp26, 26.0, (_factor) ); \ - FP_CHECK_ONE( fp27, 27.0, (_factor) ); \ - FP_CHECK_ONE( fp28, 28.0, (_factor) ); \ - FP_CHECK_ONE( fp29, 29.0, (_factor) ); \ - FP_CHECK_ONE( fp30, 30.0, (_factor) ); \ - FP_CHECK_ONE( fp31, 31.0, (_factor) ); \ - FP_CHECK_ONE( fp32, 32.0, (_factor) ); \ - } while (0) - -#endif - -#endif diff --git a/testsuites/tmtests/tm26/system.h b/testsuites/tmtests/tm26/system.h deleted file mode 100644 index 74eb108e3e..0000000000 --- a/testsuites/tmtests/tm26/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - - -#include <coverhd.h> -#include <tmacros.h> - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include <timesys.h> - -/* configuration information */ - -#define CONFIGURE_TMTEST - -#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_TEST_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#include <confdefs.h> - -/* end of include file */ diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c deleted file mode 100644 index c55c9098ed..0000000000 --- a/testsuites/tmtests/tm26/task1.c +++ /dev/null @@ -1,550 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $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 */ - -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 ); - end_time = Read_timer(); - - put_time( - "_ISR_Disable", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - rtems_interrupt_flash( level ); - end_time = Read_timer(); - - put_time( - "_ISR_Flash", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - rtems_interrupt_enable( level ); - end_time = Read_timer(); - - put_time( - "_ISR_Enable", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - _Thread_Disable_dispatch(); - end_time = Read_timer(); - - put_time( - "_Thread_Disable_dispatch", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - _Thread_Enable_dispatch(); - end_time = Read_timer(); - - put_time( - "_Thread_Enable_dispatch", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); - end_time = Read_timer(); - - put_time( - "_Thread_Set_state", - end_time, - 1, - 0, - 0 - ); - - _Context_Switch_necessary = TRUE; - - Timer_initialize(); - _Thread_Dispatch(); /* dispatches Middle_task */ -} - -rtems_task Middle_task( - rtems_task_argument argument -) -{ - end_time = Read_timer(); - - put_time( - "_Thread_Disptach (NO FP)", - end_time, - 1, - 0, - 0 - ); - - _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; - - end_time = Read_timer(); - - put_time( - "context switch: no floating point contexts", - end_time, - 1, - 0, - 0 - ); - - executing = _Thread_Executing; - - Low_tcb = executing; - - Timer_initialize(); - _Context_Switch( &executing->Registers, &executing->Registers ); - - end_time = Read_timer(); - - put_time( - "context switch: self", - end_time, - 1, - 0, - 0 - ); - - _Context_Switch(&executing->Registers, &Middle_tcb->Registers); - - end_time = Read_timer(); - - put_time( - "context switch: to another task", - end_time, - 1, - 0, - 0 - ); - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); - _Context_Restore_fp( &_Thread_Executing->fp_context ); - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); -} - -rtems_task Floating_point_task_1( - rtems_task_argument argument -) -{ - Thread_Control *executing; - FP_DECLARE; - - end_time = Read_timer(); - - put_time( - "fp context switch: restore 1st FP task", - end_time, - 1, - 0, - 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(); - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_2 */ - - end_time = Read_timer(); - - put_time( - "fp context switch: save idle, restore initialized", - end_time, - 1, - 0, - 0 - ); - - 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(); - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); - _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; - - end_time = Read_timer(); - - put_time( - "fp context switch: save idle, restore idle", - end_time, - 1, - 0, - 0 - ); - - 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(); - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_1 */ - - end_time = Read_timer(); - - put_time( - "fp context switch: save initialized, restore initialized", - end_time, - 1, - 0, - 0 - ); - - complete_test(); -} - -void complete_test( void ) -{ - rtems_unsigned32 index; - rtems_id task_id; - - Timer_initialize(); - _Thread_Resume( Middle_tcb ); - end_time = Read_timer(); - - put_time( - "_Thread_Resume", - end_time, - 1, - 0, - 0 - ); - - _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); - - Timer_initialize(); - _Thread_Unblock( Middle_tcb ); - end_time = Read_timer(); - - put_time( - "_Thread_Unblock", - end_time, - 1, - 0, - 0 - ); - - _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); - - Timer_initialize(); - _Thread_Ready( Middle_tcb ); - end_time = Read_timer(); - - put_time( - "_Thread_Ready", - end_time, - 1, - 0, - 0 - ); - - 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 ); - end_time = Read_timer(); - - put_time( - "_Thread_Get", - end_time, - OPERATION_COUNT, - 0, - 0 - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Semaphore_Get( Semaphore_id, &location ); - end_time = Read_timer(); - - put_time( - "_Semaphore_Get", - end_time, - OPERATION_COUNT, - 0, - 0 - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( 0x3, &location ); - end_time = Read_timer(); - - put_time( - "_Thread_Get: invalid id", - end_time, - OPERATION_COUNT, - 0, - 0 - ); - - puts( "*** END OF TEST 26 ***" ); - exit( 0 ); -} - diff --git a/testsuites/tmtests/tm26/tm26.doc b/testsuites/tmtests/tm26/tm26.doc deleted file mode 100644 index 0de40191c6..0000000000 --- a/testsuites/tmtests/tm26/tm26.doc +++ /dev/null @@ -1,13 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. -# On-Line Applications Research Corporation (OAR). -# All rights assigned to U.S. Government, 1994. -# -# This material may be reproduced by or for the U.S. Government pursuant -# to the copyright license under the clause at DFARS 252.227-7013. This -# notice must appear in all copies of this file and its derivatives. -# - - |