1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
---|
2 | |
---|
3 | /* Task_2 |
---|
4 | * |
---|
5 | * This task initializes the signal catcher, sends the first signal |
---|
6 | * if running on the first node, and loops while waiting for signals. |
---|
7 | * |
---|
8 | * NOTE: The signal catcher is not reentrant and hence RTEMS_NO_ASR must |
---|
9 | * be a part of its execution mode. |
---|
10 | * |
---|
11 | * Input parameters: |
---|
12 | * argument - task argument |
---|
13 | * |
---|
14 | * Output parameters: NONE |
---|
15 | * |
---|
16 | * COPYRIGHT (c) 1989-1999. |
---|
17 | * On-Line Applications Research Corporation (OAR). |
---|
18 | * |
---|
19 | * Redistribution and use in source and binary forms, with or without |
---|
20 | * modification, are permitted provided that the following conditions |
---|
21 | * are met: |
---|
22 | * 1. Redistributions of source code must retain the above copyright |
---|
23 | * notice, this list of conditions and the following disclaimer. |
---|
24 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
25 | * notice, this list of conditions and the following disclaimer in the |
---|
26 | * documentation and/or other materials provided with the distribution. |
---|
27 | * |
---|
28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
29 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
31 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
---|
32 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
33 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
34 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
35 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
36 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
37 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
38 | * POSSIBILITY OF SUCH DAMAGE. |
---|
39 | */ |
---|
40 | |
---|
41 | #ifdef HAVE_CONFIG_H |
---|
42 | #include "config.h" |
---|
43 | #endif |
---|
44 | |
---|
45 | #include "system.h" |
---|
46 | |
---|
47 | rtems_task Task_2( |
---|
48 | rtems_task_argument argument |
---|
49 | ) |
---|
50 | { |
---|
51 | rtems_status_code status; |
---|
52 | |
---|
53 | Task_2_preempted = FALSE; |
---|
54 | |
---|
55 | puts( "TA2 - Suspending self" ); |
---|
56 | status = rtems_task_suspend( RTEMS_SELF ); |
---|
57 | directive_failed( status, "rtems_task_suspend of TA2" ); |
---|
58 | |
---|
59 | puts( "TA2 - signal_return preempted correctly" ); |
---|
60 | |
---|
61 | Task_2_preempted = TRUE; |
---|
62 | |
---|
63 | status = rtems_task_suspend( RTEMS_SELF ); |
---|
64 | directive_failed( status, "rtems_task_suspend of TA2" ); |
---|
65 | } |
---|