1 |
27 |
unneback |
#ifndef CYGONCE_HAL_SH_STUB_H
|
2 |
|
|
#define CYGONCE_HAL_SH_STUB_H
|
3 |
|
|
|
4 |
|
|
//==========================================================================
|
5 |
|
|
//
|
6 |
|
|
// sh_stub.h
|
7 |
|
|
//
|
8 |
|
|
// SH stub defines
|
9 |
|
|
//
|
10 |
|
|
//==========================================================================
|
11 |
|
|
//####ECOSGPLCOPYRIGHTBEGIN####
|
12 |
|
|
// -------------------------------------------
|
13 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
14 |
|
|
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
|
15 |
|
|
//
|
16 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
17 |
|
|
// the terms of the GNU General Public License as published by the Free
|
18 |
|
|
// Software Foundation; either version 2 or (at your option) any later version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
|
21 |
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License along
|
26 |
|
|
// with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use macros
|
30 |
|
|
// or inline functions from this file, or you compile this file and link it
|
31 |
|
|
// with other works to produce a work based on this file, this file does not
|
32 |
|
|
// by itself cause the resulting work to be covered by the GNU General Public
|
33 |
|
|
// License. However the source code for this file must still be made available
|
34 |
|
|
// in accordance with section (3) of the GNU General Public License.
|
35 |
|
|
//
|
36 |
|
|
// This exception does not invalidate any other reasons why a work based on
|
37 |
|
|
// this file might be covered by the GNU General Public License.
|
38 |
|
|
//
|
39 |
|
|
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
|
40 |
|
|
// at http://sources.redhat.com/ecos/ecos-license/
|
41 |
|
|
// -------------------------------------------
|
42 |
|
|
//####ECOSGPLCOPYRIGHTEND####
|
43 |
|
|
//==========================================================================
|
44 |
|
|
//#####DESCRIPTIONBEGIN####
|
45 |
|
|
//
|
46 |
|
|
// Author(s): jskov
|
47 |
|
|
// Contributors: jskov,
|
48 |
|
|
// Date: 1999-05-18
|
49 |
|
|
// Purpose: Define SH stub stuff
|
50 |
|
|
//
|
51 |
|
|
//####DESCRIPTIONEND####
|
52 |
|
|
//
|
53 |
|
|
//==========================================================================
|
54 |
|
|
|
55 |
|
|
#include <cyg/hal/hal_intr.h> // CYGNUM_HAL_EXCEPTION_TRAP
|
56 |
|
|
|
57 |
|
|
#ifdef __cplusplus
|
58 |
|
|
extern "C" {
|
59 |
|
|
#endif
|
60 |
|
|
|
61 |
|
|
#define NUMREGS 59
|
62 |
|
|
|
63 |
|
|
#define REGSIZE( _x_ ) (4)
|
64 |
|
|
|
65 |
|
|
typedef unsigned long target_register_t;
|
66 |
|
|
|
67 |
|
|
enum regnames {
|
68 |
|
|
R0, R1, R2, R3, R4, R5, R6, R7,
|
69 |
|
|
R8, R9, R10, R11, R12, R13, R14, R15,
|
70 |
|
|
PC, PR, GBR, VBR, MACH, MACL, SR,
|
71 |
|
|
FPUL, FPSCR,
|
72 |
|
|
FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7,
|
73 |
|
|
FP8, FP9, FP10, FP11, FP12, FP13, FP14, FP15,
|
74 |
|
|
SSR, SPC, ROB0, ROB1
|
75 |
|
|
};
|
76 |
|
|
|
77 |
|
|
// For convenience
|
78 |
|
|
#define SP R15
|
79 |
|
|
#define FP R14
|
80 |
|
|
|
81 |
|
|
typedef enum regnames regnames_t;
|
82 |
|
|
|
83 |
|
|
/* Given a trap value TRAP, return the corresponding signal. */
|
84 |
|
|
extern int __computeSignal (unsigned int trap_number);
|
85 |
|
|
|
86 |
|
|
/* Return the SPARC trap number corresponding to the last-taken trap. */
|
87 |
|
|
extern int __get_trap_number (void);
|
88 |
|
|
|
89 |
|
|
/* Return the currently-saved value corresponding to register REG. */
|
90 |
|
|
extern target_register_t get_register (regnames_t reg);
|
91 |
|
|
|
92 |
|
|
/* Store VALUE in the register corresponding to WHICH. */
|
93 |
|
|
extern void put_register (regnames_t which, target_register_t value);
|
94 |
|
|
|
95 |
|
|
/* Set the currently-saved pc register value to PC. This also updates NPC
|
96 |
|
|
as needed. */
|
97 |
|
|
extern void set_pc (target_register_t pc);
|
98 |
|
|
|
99 |
|
|
/* Set things up so that the next user resume will execute one instruction.
|
100 |
|
|
This may be done by setting breakpoints or setting a single step flag
|
101 |
|
|
in the saved user registers, for example. */
|
102 |
|
|
void __single_step (void);
|
103 |
|
|
|
104 |
|
|
/* Clear the single-step state. */
|
105 |
|
|
void __clear_single_step (void);
|
106 |
|
|
|
107 |
|
|
/* If the breakpoint we hit is in the breakpoint() instruction, return a
|
108 |
|
|
non-zero value. */
|
109 |
|
|
extern int __is_breakpoint_function (void);
|
110 |
|
|
|
111 |
|
|
/* Skip the current instruction. */
|
112 |
|
|
extern void __skipinst (void);
|
113 |
|
|
|
114 |
|
|
extern void __install_breakpoints (void);
|
115 |
|
|
|
116 |
|
|
extern void __clear_breakpoints (void);
|
117 |
|
|
|
118 |
|
|
// We have to rewind the PC in case of a breakpoint.
|
119 |
|
|
#define HAL_STUB_PLATFORM_STUBS_FIXUP() \
|
120 |
|
|
CYG_MACRO_START \
|
121 |
|
|
if (CYGNUM_HAL_EXCEPTION_TRAP == __get_trap_number()) \
|
122 |
|
|
put_register(PC, get_register(PC) - 2); \
|
123 |
|
|
CYG_MACRO_END
|
124 |
|
|
|
125 |
|
|
#ifdef __cplusplus
|
126 |
|
|
} /* extern "C" */
|
127 |
|
|
#endif
|
128 |
|
|
|
129 |
|
|
#endif // ifndef CYGONCE_HAL_PPC_STUB_H
|