source: rtems/testsuites/sptests/sp14/task2.c @ 99de42c

5
Last change on this file since 99de42c was e6df806, checked in by Chris Johns <chrisj@…>, on 11/08/17 at 02:27:25

tests: Use ld to map (wrap) printf, puts and putchar to tester functions.

  • Remove the macro defines and the need for tmacro.h by remapping the symbols using ld's wrap option.
  • Remove FLUSH_OUTPUT, it was empty.
  • Move rtems_test_exit to libmisc/testsupport as a function.

Update #3199.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*  Task_2
2 *
3 *  This routine serves as a test task.  It verifies that one task can
4 *  send signals to another task ( invoking the other task's RTEMS_ASR ).
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include "system.h"
24
25rtems_task Task_2(
26  rtems_task_argument argument
27)
28{
29  rtems_status_code status;
30
31  status = rtems_task_wake_after(rtems_clock_get_ticks_per_second());
32  directive_failed( status, "rtems_task_wake_after" );
33
34  puts( "TA2 - rtems_signal_send - RTEMS_SIGNAL_17 to TA1" );
35  status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_17 );
36  directive_failed( status, "rtems_signal_send" );
37
38  puts( "TA2 - rtems_task_wake_after - yield processor" );
39  status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
40  directive_failed( status, "rtems_task_wake_after" );
41
42  puts("TA2 - rtems_signal_send - RTEMS_SIGNAL_18 and RTEMS_SIGNAL_19 to TA1");
43  status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_18 | RTEMS_SIGNAL_19 );
44  directive_failed( status, "rtems_signal_send" );
45
46  puts( "TA2 - rtems_task_wake_after - yield processor" );
47  status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
48  directive_failed( status, "rtems_task_wake_after" );
49
50  status = rtems_task_wake_after(2 * rtems_clock_get_ticks_per_second());
51  directive_failed( status, "rtems_task_wake_after" );
52
53  TEST_END();
54  rtems_test_exit( 0 );
55}
Note: See TracBrowser for help on using the repository browser.