RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
sparc
leon2
include
tm27.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-2-Clause */
2
8
9
/*
10
* COPYRIGHT (c) 2006.
11
* Aeroflex Gaisler AB.
12
*
13
* Redistribution and use in source and binary forms, with or without
14
* modification, are permitted provided that the following conditions
15
* are met:
16
* 1. Redistributions of source code must retain the above copyright
17
* notice, this list of conditions and the following disclaimer.
18
* 2. Redistributions in binary form must reproduce the above copyright
19
* notice, this list of conditions and the following disclaimer in the
20
* documentation and/or other materials provided with the distribution.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
26
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35
#ifndef _RTEMS_TMTEST27
36
#error "This is an RTEMS internal file you must not include directly."
37
#endif
38
39
#ifndef __tm27_h
40
#define __tm27_h
41
42
/*
43
* Define the interrupt mechanism for Time Test 27
44
*
45
* NOTE: Since the interrupt code for the SPARC supports both synchronous
46
* and asynchronous trap handlers, support for testing with both
47
* is included.
48
*/
49
50
#define SIS_USE_SYNCHRONOUS_TRAP 0
51
52
/*
53
* The synchronous trap is an arbitrarily chosen software trap.
54
*/
55
56
#if (SIS_USE_SYNCHRONOUS_TRAP == 1)
57
58
#define TEST_VECTOR SPARC_SYNCHRONOUS_TRAP( 0x90 )
59
60
#define MUST_WAIT_FOR_INTERRUPT 1
61
62
#define TM27_USE_VECTOR_HANDLER
63
64
#define Install_tm27_vector( handler ) \
65
set_vector( (handler), TEST_VECTOR, 1 );
66
67
#define Cause_tm27_intr() \
68
__asm__ volatile( "ta 0x10; nop " );
69
70
#define Clear_tm27_intr()
/* empty */
71
72
#define Lower_tm27_intr()
/* empty */
73
74
/*
75
* The asynchronous trap is an arbitrarily chosen ERC32 interrupt source.
76
*/
77
78
#else
/* use a regular asynchronous trap */
79
80
#define TEST_INTERRUPT_SOURCE LEON_INTERRUPT_EXTERNAL_1
81
#define TEST_INTERRUPT_SOURCE2 LEON_INTERRUPT_EXTERNAL_1+1
82
#define MUST_WAIT_FOR_INTERRUPT 1
83
84
static
inline
void
Install_tm27_vector(
rtems_interrupt_handler
handler )
85
{
86
(void)
rtems_interrupt_handler_install
(
87
TEST_INTERRUPT_SOURCE,
88
"tm27 low"
,
89
RTEMS_INTERRUPT_SHARED
,
90
handler,
91
NULL
92
);
93
(void)
rtems_interrupt_handler_install
(
94
TEST_INTERRUPT_SOURCE2,
95
"tm27 high"
,
96
RTEMS_INTERRUPT_SHARED
,
97
handler,
98
NULL
99
);
100
}
101
102
#define Cause_tm27_intr() \
103
do { \
104
LEON_Force_interrupt( TEST_INTERRUPT_SOURCE+(Interrupt_nest>>1)); \
105
nop(); \
106
nop(); \
107
nop(); \
108
} while (0)
109
110
#define Clear_tm27_intr() \
111
LEON_Clear_interrupt( TEST_INTERRUPT_SOURCE )
112
113
#define Lower_tm27_intr()
/* empty */
114
115
#endif
116
117
#endif
rtems_interrupt_handler_install
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler routine, void *arg)
Installs the interrupt handler routine and argument at the interrupt vector.
Definition
irq-handler-install.c:85
RTEMS_INTERRUPT_SHARED
#define RTEMS_INTERRUPT_SHARED
This interrupt handler install option allows that the interrupt handler may share the interrupt vecto...
Definition
intr.h:960
rtems_interrupt_handler
void(*) rtems_interrupt_handler(void *)
Interrupt handler routines shall have this type.
Definition
intr.h:1030
Generated by
1.18.0