1 //==========================================================================
5 // Support code to extend the generic monitor code to support
8 //==========================================================================
9 //####ECOSGPLCOPYRIGHTBEGIN####
10 // -------------------------------------------
11 // This file is part of eCos, the Embedded Configurable Operating System.
12 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14 // eCos is free software; you can redistribute it and/or modify it under
15 // the terms of the GNU General Public License as published by the Free
16 // Software Foundation; either version 2 or (at your option) any later version.
18 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
19 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 // You should have received a copy of the GNU General Public License along
24 // with eCos; if not, write to the Free Software Foundation, Inc.,
25 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 // As a special exception, if other files instantiate templates or use macros
28 // or inline functions from this file, or you compile this file and link it
29 // with other works to produce a work based on this file, this file does not
30 // by itself cause the resulting work to be covered by the GNU General Public
31 // License. However the source code for this file must still be made available
32 // in accordance with section (3) of the GNU General Public License.
34 // This exception does not invalidate any other reasons why a work based on
35 // this file might be covered by the GNU General Public License.
37 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
38 // at http://sources.redhat.com/ecos/ecos-license/
39 // -------------------------------------------
40 //####ECOSGPLCOPYRIGHTEND####
41 //==========================================================================
42 //#####DESCRIPTIONBEGIN####
44 // Author(s): dmoseley
45 // Contributors: dmoseley
47 // Purpose: Support code to extend the generic monitor code to support
48 // MN10300 processors.
49 // Description: Further board specific support is in other files.
50 // This file contains:
51 // register names lookup table
54 // Interval timer - This should really belong to the application
57 // Should not contain:
58 // low level uart getchar and putchar functions
59 // delay function to support uart
61 //####DESCRIPTIONEND####
63 //=========================================================================
67 struct regstruct regtab[] =
83 #ifdef CYGPKG_HAL_MN10300_AM33
99 #if CYGHWR_HAL_MN10300_AM33_REVISION == 2
135 { 0, 0, 1}, /* Terminating element must be last */
141 } /* initialize_mon */
143 #if CYGHWR_HAL_MN10300_AM33_REVISION == 2
144 extern int fpu_regs_read;
147 #ifdef CYGPKG_HAL_MN10300_AM33
152 initialize_mon_each_time(void)
155 #if CYGHWR_HAL_MN10300_AM33_REVISION == 2
156 // Make sure the regtab[] indicates the valid status of the FPU registers
157 for (i = 0; regtab[i].registername != NULL; i++)
159 if ((regtab[i].registernumber >= FP_START) && (regtab[i].registernumber <= FP_END))
160 regtab[i].registervalid = fpu_regs_read;
164 #ifdef CYGPKG_HAL_MN10300_AM33
165 // Make sure the regtab[] indicates the valid status of the MSP
166 for (i = 0; regtab[i].registername != NULL; i++)
168 if (regtab[i].registernumber == MSP)
169 regtab[i].registervalid = msp_read;
172 } /* initialize_mon_each_time */
175 #include <cyg/hal/hal_arch.h>
176 #include <bsp/common/bsp_if.h>
178 machine_syscall(HAL_SavedRegisters *regs)
181 target_register_t d0, d1, d2, d3;
183 d0 = get_register(D0);
184 d1 = get_register(D1);
185 d2 = get_register(D2);
186 d3 = get_register(D3);
188 err = _bsp_do_syscall(d0, // Function
189 d1, d2, d3, 0, // arguments,
193 // This was a syscall. It has now been handled, so update the registers appropriately
194 put_register(D0, res);
195 bsp_skip_instruction(regs);
202 // Utility function for printing breakpoints
203 void bp_print(target_register_t bp_val)
205 bsp_printf("0x%08lx\n", (unsigned long)bp_val);