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/tm20/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 '')
-rw-r--r-- | c/src/tests/tmtests/tm20/task1.c | 473 |
1 files changed, 0 insertions, 473 deletions
diff --git a/c/src/tests/tmtests/tm20/task1.c b/c/src/tests/tmtests/tm20/task1.c deleted file mode 100644 index 764be21a06..0000000000 --- a/c/src/tests/tmtests/tm20/task1.c +++ /dev/null @@ -1,473 +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 -#include "system.h" -#include <assert.h> - -rtems_device_major_number _STUB_major = 1; - -rtems_id Region_id; -rtems_name Region_name; -rtems_unsigned8 Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; - -#define PARTITION_SIZE 2048 -#define PARTITION_ELEMENT_SIZE 128 -#define PARTITION_BUFFER_POINTERS \ - ((PARTITION_SIZE / PARTITION_ELEMENT_SIZE) + 2) - -rtems_id Partition_id; -rtems_name Partition_name; -rtems_unsigned8 Partition_area[ PARTITION_SIZE ] CPU_STRUCTURE_ALIGNMENT; - -void *Buffer_address_1; -void *Buffer_address_2; -void *Buffer_address_3; -void *Buffer_address_4; - -rtems_unsigned32 buffer_count; - -void *Buffer_addresses[ PARTITION_BUFFER_POINTERS ]; - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 20 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', '1' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TASK1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TASK1" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', '2' ), - 129, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TASK2" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TASK2" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_mode previous_mode; - rtems_task_priority previous_priority; - rtems_status_code status; - - Partition_name = rtems_build_name( 'P', 'A', 'R', 'T' ); - - Timer_initialize(); - rtems_partition_create( - Partition_name, - Partition_area, - PARTITION_SIZE, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Partition_id - ); - end_time = Read_timer(); - - put_time( - "rtems_partition_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_CREATE - ); - - Region_name = rtems_build_name( 'R', 'E', 'G', 'N' ); - - Timer_initialize(); - rtems_region_create( - Region_name, - Region_area, - 2048, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id - ); - end_time = Read_timer(); - - put_time( - "rtems_region_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_CREATE - ); - - Timer_initialize(); - (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_get_buffer: available", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_GET_BUFFER - ); - - buffer_count = 0; - while ( FOREVER ) { - - status = rtems_partition_get_buffer( - Partition_id, - &Buffer_addresses[ buffer_count ] - ); - - if ( status == RTEMS_UNSATISFIED ) break; - - buffer_count++; - - assert( buffer_count < PARTITION_BUFFER_POINTERS ); - } - - Timer_initialize(); - (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_2 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_get_buffer: not available", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_GET_BUFFER - ); - - Timer_initialize(); - (void) rtems_partition_return_buffer( Partition_id, Buffer_address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_return_buffer", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_RETURN_BUFFER - ); - - for ( index = 0 ; index < buffer_count ; index++ ) { - - status = rtems_partition_return_buffer( - Partition_id, - Buffer_addresses[ index ] - ); - directive_failed( status, "rtems_partition_return_buffer" ); - - } - - Timer_initialize(); - (void) rtems_partition_delete( Partition_id ); - end_time = Read_timer(); - - put_time( - "rtems_partition_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_DELETE - ); - - status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); - directive_failed( status, "region_get_segment" ); - - Timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_3 - ); - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment: available", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_GET_SEGMENT - ); - - Timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 1998, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &Buffer_address_4 - ); - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment: not available -- NO_WAIT", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_GET_SEGMENT - ); - - status = rtems_region_return_segment( Region_id, Buffer_address_3 ); - directive_failed( status, "rtems_region_return_segment" ); - - Timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_2 ); - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment: no waiting tasks", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_RETURN_SEGMENT - ); - - status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - - Timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 1998, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); - - /* execute Task_2 */ - - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment: task readied -- preempts caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_RETURN_SEGMENT - ); - - status = rtems_region_return_segment( Region_id, Buffer_address_2 ); - directive_failed( status, "rtems_region_return_segment" ); - - status = rtems_task_mode( - RTEMS_NO_PREEMPT, - RTEMS_PREEMPT_MASK, - &previous_mode - ); - directive_failed( status, "rtems_task_mode" ); - - status = rtems_task_set_priority( RTEMS_SELF, 254, &previous_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_1 - ); - directive_failed( status, "rtems_region_return_segment" ); - - status = rtems_region_get_segment( - Region_id, - 1998, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); - - /* execute Task_2 */ - - status = rtems_region_return_segment( Region_id, Buffer_address_2 ); - directive_failed( status, "rtems_region_return_segment" ); - - Timer_initialize(); - (void) rtems_region_delete( Region_id ); - end_time = Read_timer(); - - put_time( - "rtems_region_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_DELETE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_initialize( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_initialize", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_INITIALIZE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_open( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_open", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_OPEN - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_close( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_close", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_CLOSE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_read( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_read", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_READ - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_write( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_write", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_WRITE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_control( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_control", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_CONTROL - ); - - puts( "*** END OF TEST 20 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment: not available -- caller blocks", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_GET_SEGMENT - ); - - Timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); - - /* preempt back to Task_1 */ - - Timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment: task readied -- returns to caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_RETURN_SEGMENT - ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} |