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

5
Last change on this file since 604f080c was 604f080c, checked in by Sebastian Huber <sebastian.huber@…>, on Dec 8, 2017 at 12:13:14 PM

bsp/shsim: Move libcpu files to BSP

Update #3254.

  • 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#include <rtems/score/types.h>
32
33/*
34 * This is a exception vector table
35 *
36 * It has the same structure as the actual vector table (vectab)
37 */
38
39void _dummy_isp(uint32_t);
40
41proc_ptr _Hardware_isr_Table[256]={
42_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, /* PWRon Reset, Maual Reset,...*/
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_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp,
50/* trapa 0 -31 */
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,
81_dummy_isp, _dummy_isp, _dummy_isp, _dummy_isp, /* irq 152-155*/
82_dummy_isp
83};
84
85#define Str(a)#a
86
87/*
88 * Some versions of gcc and all version of egcs at least until egcs-1.1b
89 * are not able to handle #pragma interrupt correctly if more than 1 isr is
90 * contained in a file and when optimizing.
91 * We try to work around this problem by using the macro below.
92 */
93#define isp( name, number, func)\
94__asm__ (".global _"Str(name)"\n\t"\
95     "_"Str(name)":       \n\t"\
96     "    mov.l r0,@-r15   \n\t"\
97     "    mov.l r1,@-r15   \n\t"\
98     "    mov.l r2,@-r15   \n\t"\
99     "    mov.l r3,@-r15   \n\t"\
100     "    mov.l r4,@-r15   \n\t"\
101     "    mov.l r5,@-r15   \n\t"\
102     "    mov.l r6,@-r15   \n\t"\
103     "    mov.l r7,@-r15   \n\t"\
104     "    mov.l r14,@-r15  \n\t"\
105     "    sts.l pr,@-r15   \n\t"\
106     "    sts.l mach,@-r15 \n\t"\
107     "    sts.l macl,@-r15 \n\t"\
108     "    mov r15,r14      \n\t"\
109     "    mov.l "Str(name)"_v, r2 \n\t"\
110     "    mov.l "Str(name)"_k, r1\n\t"\
111     "    jsr @r1           \n\t"\
112     "    mov   r2,r4      \n\t"\
113     "    mov   r14,r15    \n\t"\
114     "    lds.l @r15+,macl \n\t"\
115     "    lds.l @r15+,mach \n\t"\
116     "    lds.l @r15+,pr   \n\t"\
117     "    mov.l @r15+,r14  \n\t"\
118     "    mov.l @r15+,r7   \n\t"\
119     "    mov.l @r15+,r6   \n\t"\
120     "    mov.l @r15+,r5   \n\t"\
121     "    mov.l @r15+,r4   \n\t"\
122     "    mov.l @r15+,r3   \n\t"\
123     "    mov.l @r15+,r2   \n\t"\
124     "    mov.l @r15+,r1   \n\t"\
125     "    mov.l @r15+,r0   \n\t"\
126     "    rte              \n\t"\
127     "    nop              \n\t"\
128     "    .align 2         \n\t"\
129     #name"_k: \n\t"\
130     ".long "Str(func)"\n\t"\
131     #name"_v: \n\t"\
132     ".long "Str(number));
133
134/************************************************
135 * Dummy interrupt service procedure for
136 * interrupts being not allowed --> Trap 34
137 ************************************************/
138__asm__ (" .section .text\n\
139.global __dummy_isp\n\
140__dummy_isp:\n\
141      mov.l r14,@-r15\n\
142      mov   r15, r14\n\
143      trapa #34\n\
144      mov.l @r15+,r14\n\
145      rte\n\
146      nop");
147
Note: See TracBrowser for help on using the repository browser.