1 | /* |
---|
2 | * tm27.h |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.com/license/LICENSE. |
---|
7 | * |
---|
8 | * $Id$ |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef _RTEMS_TMTEST27 |
---|
12 | #error "This is an RTEMS internal file you must not include directly." |
---|
13 | #endif |
---|
14 | |
---|
15 | #ifndef __tm27_h |
---|
16 | #define __tm27_h |
---|
17 | |
---|
18 | /* |
---|
19 | * Define the interrupt mechanism for Time Test 27 |
---|
20 | * |
---|
21 | * NOTE: Since the interrupt code for the SPARC supports both synchronous |
---|
22 | * and asynchronous trap handlers, support for testing with both |
---|
23 | * is included. |
---|
24 | */ |
---|
25 | |
---|
26 | #define SIS_USE_SYNCHRONOUS_TRAP 0 |
---|
27 | |
---|
28 | /* |
---|
29 | * The synchronous trap is an arbitrarily chosen software trap. |
---|
30 | */ |
---|
31 | |
---|
32 | #if (SIS_USE_SYNCHRONOUS_TRAP == 1) |
---|
33 | |
---|
34 | #define TEST_VECTOR SPARC_SYNCHRONOUS_TRAP( 0x90 ) |
---|
35 | |
---|
36 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
37 | |
---|
38 | #define Install_tm27_vector( handler ) \ |
---|
39 | set_vector( (handler), TEST_VECTOR, 1 ); |
---|
40 | |
---|
41 | #define Cause_tm27_intr() \ |
---|
42 | asm volatile( "ta 0x10; nop " ); |
---|
43 | |
---|
44 | #define Clear_tm27_intr() /* empty */ |
---|
45 | |
---|
46 | #define Lower_tm27_intr() /* empty */ |
---|
47 | |
---|
48 | /* |
---|
49 | * The asynchronous trap is an arbitrarily chosen ERC32 interrupt source. |
---|
50 | */ |
---|
51 | |
---|
52 | #else /* use a regular asynchronous trap */ |
---|
53 | |
---|
54 | #define TEST_INTERRUPT_SOURCE LEON_INTERRUPT_EXTERNAL_1 |
---|
55 | #define TEST_VECTOR LEON_TRAP_TYPE( TEST_INTERRUPT_SOURCE ) |
---|
56 | #define TEST_INTERRUPT_SOURCE2 LEON_INTERRUPT_EXTERNAL_1+1 |
---|
57 | #define TEST_VECTOR2 LEON_TRAP_TYPE( TEST_INTERRUPT_SOURCE2 ) |
---|
58 | #define MUST_WAIT_FOR_INTERRUPT 1 |
---|
59 | |
---|
60 | #define Install_tm27_vector( handler ) \ |
---|
61 | set_vector( (handler), TEST_VECTOR, 1 ); \ |
---|
62 | set_vector( (handler), TEST_VECTOR2, 1 ); |
---|
63 | |
---|
64 | #define Cause_tm27_intr() \ |
---|
65 | do { \ |
---|
66 | LEON_Force_interrupt( TEST_INTERRUPT_SOURCE+(Interrupt_nest>>1)); \ |
---|
67 | nop(); \ |
---|
68 | nop(); \ |
---|
69 | nop(); \ |
---|
70 | } while (0) |
---|
71 | |
---|
72 | #define Clear_tm27_intr() \ |
---|
73 | LEON_Clear_interrupt( TEST_INTERRUPT_SOURCE ) |
---|
74 | |
---|
75 | #define Lower_tm27_intr() /* empty */ |
---|
76 | |
---|
77 | #endif |
---|
78 | |
---|
79 | #endif |
---|