source: rtems/c/src/lib/libbsp/sh/shsim/startup/ispshgdb.c @ 0706581

5
Last change on this file since 0706581 was 0706581, checked in by Joel Sherrill <joel@…>, on 03/07/18 at 20:31:31

misc sh: Remove includes of rtems/score/types.h

  • Property mode set to 100644
File size: 5.1 KB
Line 
1/*
2 * This file contains the isp frames for the user interrupts.
3 * From these procedures __ISR_Handler is called with the vector number
4 * as argument.
5 *
6 * __ISR_Handler is kept in a separate file (cpu_asm.c), because a bug in
7 * some releases of gcc doesn't properly handle #pragma interrupt, if a
8 * file contains both isrs and normal functions.
9 *
10 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
11 *           Bernd Becker (becker@faw.uni-ulm.de)
12 *
13 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
14 *
15 *  This program is distributed in the hope that it will be useful,
16 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
18 *
19 *
20 *  COPYRIGHT (c) 1998.
21 *  On-Line Applications Research Corporation (OAR).
22 *
23 *  The license and distribution terms for this file may be
24 *  found in the file LICENSE in this distribution or at
25 *  http://www.rtems.org/license/LICENSE.
26 *
27 *  Modified to reflect dummy isp entries for GDB SH simulator by Joel.
28 */
29
30#include <rtems/system.h>
31
32/*
33 * This is a exception vector table
34 *
35 * It has the same structure as the actual vector table (vectab)
36 */
37
38void _dummy_isp(uint32_t);
39
40proc_ptr _Hardware_isr_Table[256]={
41_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, /* PWRon Reset, Maual Reset,...*/
42_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
43_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
44_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
45_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
46_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
47_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
48_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
49/* trapa 0 -31 */
50_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
51_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
52_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
53_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
54_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
55_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
56_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
57_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
58_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
59_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
60_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
61_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
62_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
63_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
64_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
65_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
66_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
67_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
68_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
69_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
70_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
71_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
72_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
73_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
74_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
75_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
76_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
77_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
78_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
79_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
80_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, /* irq 152-155*/
81_dummy_isp
82};
83
84#define Str(a)#a
85
86/*
87 * Some versions of gcc and all version of egcs at least until egcs-1.1b
88 * are not able to handle #pragma interrupt correctly if more than 1 isr is
89 * contained in a file and when optimizing.
90 * We try to work around this problem by using the macro below.
91 */
92#define isp( name, number, func)\
93__asm__ (".global _"Str(name)"\n\t"\
94     "_"Str(name)":       \n\t"\
95     "    mov.l r0,@-r15   \n\t"\
96     "    mov.l r1,@-r15   \n\t"\
97     "    mov.l r2,@-r15   \n\t"\
98     "    mov.l r3,@-r15   \n\t"\
99     "    mov.l r4,@-r15   \n\t"\
100     "    mov.l r5,@-r15   \n\t"\
101     "    mov.l r6,@-r15   \n\t"\
102     "    mov.l r7,@-r15   \n\t"\
103     "    mov.l r14,@-r15  \n\t"\
104     "    sts.l pr,@-r15   \n\t"\
105     "    sts.l mach,@-r15 \n\t"\
106     "    sts.l macl,@-r15 \n\t"\
107     "    mov r15,r14      \n\t"\
108     "    mov.l "Str(name)"_v, r2 \n\t"\
109     "    mov.l "Str(name)"_k, r1\n\t"\
110     "    jsr @r1           \n\t"\
111     "    mov   r2,r4      \n\t"\
112     "    mov   r14,r15    \n\t"\
113     "    lds.l @r15+,macl \n\t"\
114     "    lds.l @r15+,mach \n\t"\
115     "    lds.l @r15+,pr   \n\t"\
116     "    mov.l @r15+,r14  \n\t"\
117     "    mov.l @r15+,r7   \n\t"\
118     "    mov.l @r15+,r6   \n\t"\
119     "    mov.l @r15+,r5   \n\t"\
120     "    mov.l @r15+,r4   \n\t"\
121     "    mov.l @r15+,r3   \n\t"\
122     "    mov.l @r15+,r2   \n\t"\
123     "    mov.l @r15+,r1   \n\t"\
124     "    mov.l @r15+,r0   \n\t"\
125     "    rte              \n\t"\
126     "    nop              \n\t"\
127     "    .align 2         \n\t"\
128     #name"_k: \n\t"\
129     ".long "Str(func)"\n\t"\
130     #name"_v: \n\t"\
131     ".long "Str(number));
132
133/************************************************
134 * Dummy interrupt service procedure for
135 * interrupts being not allowed --> Trap 34
136 ************************************************/
137__asm__ (" .section .text\n\
138.global __dummy_isp\n\
139__dummy_isp:\n\
140      mov.l r14,@-r15\n\
141      mov   r15, r14\n\
142      trapa #34\n\
143      mov.l @r15+,r14\n\
144      rte\n\
145      nop");
146
Note: See TracBrowser for help on using the repository browser.