1 #ifndef CYGONCE_HAL_MN10300_STUB_H
2 #define CYGONCE_HAL_MN10300_STUB_H
3 //========================================================================
7 // MN10300-specific definitions for generic stub
9 //========================================================================
10 //####ECOSGPLCOPYRIGHTBEGIN####
11 // -------------------------------------------
12 // This file is part of eCos, the Embedded Configurable Operating System.
13 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15 // eCos is free software; you can redistribute it and/or modify it under
16 // the terms of the GNU General Public License as published by the Free
17 // Software Foundation; either version 2 or (at your option) any later version.
19 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 // You should have received a copy of the GNU General Public License along
25 // with eCos; if not, write to the Free Software Foundation, Inc.,
26 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 // As a special exception, if other files instantiate templates or use macros
29 // or inline functions from this file, or you compile this file and link it
30 // with other works to produce a work based on this file, this file does not
31 // by itself cause the resulting work to be covered by the GNU General Public
32 // License. However the source code for this file must still be made available
33 // in accordance with section (3) of the GNU General Public License.
35 // This exception does not invalidate any other reasons why a work based on
36 // this file might be covered by the GNU General Public License.
38 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 // at http://sources.redhat.com/ecos/ecos-license/
40 // -------------------------------------------
41 //####ECOSGPLCOPYRIGHTEND####
42 //========================================================================
43 //#####DESCRIPTIONBEGIN####
45 // Author(s): Red Hat, jskov
46 // Contributors: Red Hat, jskov, dmoseley
49 // Description: MN10300-specific definitions for generic stub
52 //####DESCRIPTIONEND####
54 //========================================================================
60 #if defined(CYGPKG_HAL_MN10300_AM33) && (CYGHWR_HAL_MN10300_AM33_REVISION == 2)
66 #define REGSIZE( _x_ ) (4)
68 typedef unsigned long target_register_t;
71 D0, D1, D2, D3, A0, A1, A2, A3,
72 SP, PC, MDR, PSW, LIR, LAR
73 #ifdef CYGPKG_HAL_MN10300_AM33
75 R0, R1, R2, R3, R4, R5, R6, R7,
76 SSP, MSP, USP, MCRH, MCRL, MCVF
77 #if CYGHWR_HAL_MN10300_AM33_REVISION == 2
78 // FPU registers for AM33/2.00
79 , FP_START, FPCR=FP_START,
80 XXXX1, XXXX2, // unused
81 FS0, FS1, FS2, FS3, FS4, FS5, FS6, FS7,
82 FS8, FS9, FS10, FS11, FS12, FS13, FS14, FS15,
83 FS16, FS17, FS18, FS19, FS20, FS21, FS22, FS23,
84 FS24, FS25, FS26, FS27, FS28, FS29, FS30, FS31, FP_END=FS31,
89 typedef enum regnames regnames_t;
91 /* Given a trap value TRAP, return the corresponding signal. */
92 extern int __computeSignal (unsigned int trap_number);
94 /* Return the SPARC trap number corresponding to the last-taken trap. */
95 extern int __get_trap_number (void);
97 /* Return the currently-saved value corresponding to register REG. */
98 extern target_register_t get_register (regnames_t reg);
100 /* Store VALUE in the register corresponding to WHICH. */
101 extern void put_register (regnames_t which, target_register_t value);
103 /* Set the currently-saved pc register value to PC. This also updates NPC
105 #if !defined(SET_PC_PROTOTYPE_EXISTS) && !defined(set_pc)
106 #define SET_PC_PROTOTYPE_EXISTS
107 extern void set_pc (target_register_t pc);
110 /* Set things up so that the next user resume will execute one instruction.
111 This may be done by setting breakpoints or setting a single step flag
112 in the saved user registers, for example. */
113 #ifndef __single_step
114 void __single_step (void);
117 /* Clear the single-step state. */
118 void __clear_single_step (void);
120 /* If the breakpoint we hit is in the breakpoint() instruction, return a
122 #ifndef __is_breakpoint_function
123 extern int __is_breakpoint_function (void);
126 /* Skip the current instruction. */
127 extern void __skipinst (void);
129 extern void __install_breakpoints (void);
131 extern void __clear_breakpoints (void);
133 extern void __install_breakpoint_list (void);
135 extern void __clear_breakpoint_list (void);
137 extern int __is_bsp_syscall(void);
139 extern int hal_syscall_handler(void);
145 #endif // ifndef CYGONCE_HAL_MN10300_STUB_H