From ac7d5ef06a6d6e8d84abbd1f0b82162725f98326 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 11 May 1995 17:39:37 +0000 Subject: Initial revision --- testsuites/mptests/mp04/task1.c | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 testsuites/mptests/mp04/task1.c (limited to 'testsuites/mptests/mp04/task1.c') diff --git a/testsuites/mptests/mp04/task1.c b/testsuites/mptests/mp04/task1.c new file mode 100644 index 0000000000..7e7e0ca849 --- /dev/null +++ b/testsuites/mptests/mp04/task1.c @@ -0,0 +1,83 @@ +/* Test_task + * + * This task tests the rtems_task_set_priority directive on a remote task. + * + * Input parameters: + * argument - task argument + * + * Output parameters: NONE + * + * 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 "system.h" + +extern rtems_multiprocessing_table Multiprocessing_configuration; + +rtems_task Test_task( + rtems_task_argument argument +) +{ + rtems_id tid; + rtems_status_code status; + rtems_unsigned32 remote_node; + rtems_id remote_tid; + rtems_task_priority previous_priority; + rtems_task_priority previous_priority_1; + + status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); + directive_failed( status, "rtems_task_ident" ); + + puts( "Getting TID of remote task" ); + remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1; + puts_nocr( "Remote task's name is : " ); + put_name( Task_name[ remote_node ], TRUE ); + + do { + status = rtems_task_ident( + Task_name[ remote_node ], + RTEMS_SEARCH_ALL_NODES, + &remote_tid + ); + } while ( status != RTEMS_SUCCESSFUL ); + + directive_failed( status, "rtems_task_ident" ); + + status = rtems_task_set_priority( + remote_tid, + Multiprocessing_configuration.node, + &previous_priority + ); + directive_failed( status, "rtems_task_set_priority" ); + + if ( previous_priority != remote_node ) { + printf( + "Remote priority (0x%x) does not match remote node (0x%x)!!!\n", + previous_priority, + remote_node + ); + exit( 0xf0000 ); + } + + do { + status = rtems_task_set_priority( + RTEMS_SELF, + RTEMS_CURRENT_PRIORITY, + &previous_priority_1 + ); + directive_failed( status, "rtems_task_set_priority" ); + } while ( previous_priority_1 != remote_node ); + + puts( "Local task priority has been set" ); + + puts( "*** END OF TEST 4 ***" ); + exit( 0 ); +} -- cgit v1.2.3