1 | /* |
---|
2 | * COPYRIGHT (c) 2014. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #ifdef HAVE_CONFIG_H |
---|
11 | #include "config.h" |
---|
12 | #endif |
---|
13 | |
---|
14 | #define CONFIGURE_INIT |
---|
15 | #include "system.h" |
---|
16 | |
---|
17 | const char rtems_test_name[] = "SP INTERRUPT ERROR 1"; |
---|
18 | |
---|
19 | rtems_task Init( |
---|
20 | rtems_task_argument argument |
---|
21 | ) |
---|
22 | { |
---|
23 | rtems_status_code status; |
---|
24 | |
---|
25 | TEST_BEGIN(); |
---|
26 | #if ((CPU_SIMPLE_VECTORED_INTERRUPTS == FALSE) || \ |
---|
27 | defined(_C3x) || defined(_C4x)) |
---|
28 | puts( |
---|
29 | "TA1 - rtems_interrupt_catch - " |
---|
30 | "bad handler RTEMS_INVALID_ADDRESS -- SKIPPED" |
---|
31 | ); |
---|
32 | puts( |
---|
33 | "TA1 - rtems_interrupt_catch - " |
---|
34 | "old isr RTEMS_INVALID_ADDRESS - SKIPPED" ); |
---|
35 | #else |
---|
36 | rtems_isr_entry old_service_routine; |
---|
37 | status = rtems_interrupt_catch( |
---|
38 | Service_routine, |
---|
39 | CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER + 1, |
---|
40 | &old_service_routine |
---|
41 | ); |
---|
42 | fatal_directive_status( |
---|
43 | status, |
---|
44 | RTEMS_INVALID_NUMBER, |
---|
45 | "rtems_interrupt_catch with invalid vector" |
---|
46 | ); |
---|
47 | puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" ); |
---|
48 | |
---|
49 | status = rtems_interrupt_catch( NULL, 3, &old_service_routine ); |
---|
50 | fatal_directive_status( |
---|
51 | status, |
---|
52 | RTEMS_INVALID_ADDRESS, |
---|
53 | "rtems_interrupt_catch with invalid handler" |
---|
54 | ); |
---|
55 | puts( "TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS" ); |
---|
56 | |
---|
57 | status = rtems_interrupt_catch( Service_routine, 3, NULL ); |
---|
58 | fatal_directive_status( |
---|
59 | status, |
---|
60 | RTEMS_INVALID_ADDRESS, |
---|
61 | "rtems_interrupt_catch with invalid old isr pointer" |
---|
62 | ); |
---|
63 | puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS" ); |
---|
64 | #endif |
---|
65 | |
---|
66 | TEST_END(); |
---|
67 | } |
---|