/* Task_1
|
/* Task_1
|
*
|
*
|
* This routine serves as a test task. It tests the partition manager.
|
* This routine serves as a test task. It tests the partition manager.
|
*
|
*
|
* Input parameters:
|
* Input parameters:
|
* argument - task argument
|
* argument - task argument
|
*
|
*
|
* Output parameters: NONE
|
* Output parameters: NONE
|
*
|
*
|
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-1999.
|
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
*
|
*
|
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
* http://www.OARcorp.com/rtems/license.html.
|
* http://www.OARcorp.com/rtems/license.html.
|
*
|
*
|
* $Id: task1.c,v 1.2 2001-09-27 12:02:33 chris Exp $
|
* $Id: task1.c,v 1.2 2001-09-27 12:02:33 chris Exp $
|
*/
|
*/
|
|
|
#include "system.h"
|
#include "system.h"
|
|
|
rtems_task Task_1(
|
rtems_task Task_1(
|
rtems_task_argument argument
|
rtems_task_argument argument
|
)
|
)
|
{
|
{
|
rtems_id ptid_1;
|
rtems_id ptid_1;
|
rtems_id ptid_2;
|
rtems_id ptid_2;
|
void *buffer_address_1;
|
void *buffer_address_1;
|
void *buffer_address_2;
|
void *buffer_address_2;
|
void *buffer_address_3;
|
void *buffer_address_3;
|
void *buffer_address_4;
|
void *buffer_address_4;
|
rtems_status_code status;
|
rtems_status_code status;
|
|
|
puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " );
|
puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " );
|
status = rtems_partition_ident(
|
status = rtems_partition_ident(
|
Partition_name[ 1 ],
|
Partition_name[ 1 ],
|
RTEMS_SEARCH_ALL_NODES,
|
RTEMS_SEARCH_ALL_NODES,
|
&ptid_1
|
&ptid_1
|
);
|
);
|
directive_failed( status, "rtems_partition_ident of PT1" );
|
directive_failed( status, "rtems_partition_ident of PT1" );
|
printf( "%08x\n", ptid_1 );
|
printf( "%08x\n", ptid_1 );
|
|
|
puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " );
|
puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " );
|
status = rtems_partition_ident(
|
status = rtems_partition_ident(
|
Partition_name[ 2 ],
|
Partition_name[ 2 ],
|
RTEMS_SEARCH_ALL_NODES,
|
RTEMS_SEARCH_ALL_NODES,
|
&ptid_2
|
&ptid_2
|
);
|
);
|
directive_failed( status, "rtems_partition_ident of PT2" );
|
directive_failed( status, "rtems_partition_ident of PT2" );
|
printf( "%08x\n", ptid_2 );
|
printf( "%08x\n", ptid_2 );
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - "
|
"TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - "
|
);
|
);
|
status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 );
|
status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
Put_address_from_area_1( buffer_address_1 );
|
Put_address_from_area_1( buffer_address_1 );
|
new_line;
|
new_line;
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - "
|
"TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - "
|
);
|
);
|
status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 );
|
status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
Put_address_from_area_1( buffer_address_2 );
|
Put_address_from_area_1( buffer_address_2 );
|
new_line;
|
new_line;
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - "
|
"TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - "
|
);
|
);
|
status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 );
|
status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
Put_address_from_area_2( buffer_address_3 );
|
Put_address_from_area_2( buffer_address_3 );
|
new_line;
|
new_line;
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - "
|
"TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - "
|
);
|
);
|
status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 );
|
status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
directive_failed( status, "rtems_partition_get_buffer" );
|
Put_address_from_area_2( buffer_address_4 );
|
Put_address_from_area_2( buffer_address_4 );
|
new_line;
|
new_line;
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - "
|
"TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - "
|
);
|
);
|
Put_address_from_area_1( buffer_address_1 );
|
Put_address_from_area_1( buffer_address_1 );
|
new_line;
|
new_line;
|
status = rtems_partition_return_buffer( ptid_1, buffer_address_1 );
|
status = rtems_partition_return_buffer( ptid_1, buffer_address_1 );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - "
|
"TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - "
|
);
|
);
|
Put_address_from_area_1( buffer_address_2 );
|
Put_address_from_area_1( buffer_address_2 );
|
new_line;
|
new_line;
|
status = rtems_partition_return_buffer( ptid_1, buffer_address_2 );
|
status = rtems_partition_return_buffer( ptid_1, buffer_address_2 );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - "
|
"TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - "
|
);
|
);
|
Put_address_from_area_2( buffer_address_3 );
|
Put_address_from_area_2( buffer_address_3 );
|
new_line;
|
new_line;
|
status = rtems_partition_return_buffer( ptid_2, buffer_address_3 );
|
status = rtems_partition_return_buffer( ptid_2, buffer_address_3 );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
|
|
puts_nocr(
|
puts_nocr(
|
"TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - "
|
"TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - "
|
);
|
);
|
Put_address_from_area_2( buffer_address_4 );
|
Put_address_from_area_2( buffer_address_4 );
|
new_line;
|
new_line;
|
status = rtems_partition_return_buffer( ptid_2, buffer_address_4 );
|
status = rtems_partition_return_buffer( ptid_2, buffer_address_4 );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
directive_failed( status, "rtems_partition_return_buffer" );
|
|
|
puts( "TA1 - rtems_partition_delete - delete partition 1"
|
puts( "TA1 - rtems_partition_delete - delete partition 1"
|
);
|
);
|
status = rtems_partition_delete( ptid_1 );
|
status = rtems_partition_delete( ptid_1 );
|
directive_failed( status, "rtems_partition_delete" );
|
directive_failed( status, "rtems_partition_delete" );
|
|
|
puts( "TA1 - rtems_partition_delete - delete partition 2"
|
puts( "TA1 - rtems_partition_delete - delete partition 2"
|
);
|
);
|
status = rtems_partition_delete( ptid_2 );
|
status = rtems_partition_delete( ptid_2 );
|
directive_failed( status, "rtems_partition_delete" );
|
directive_failed( status, "rtems_partition_delete" );
|
|
|
puts( "*** END OF TEST 15 ***" );
|
puts( "*** END OF TEST 15 ***" );
|
exit( 0 );
|
exit( 0 );
|
}
|
}
|
|
|