OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [cygmon/] [v2_0/] [misc/] [mn10300/] [mn10300-mon.c] - Blame information for rev 361

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
//==========================================================================
2
//
3
//      mn10300-mon.c
4
//
5
//      Support code to extend the generic monitor code to support
6
//      MN10300 processors.
7
//
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.
13
//
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.
17
//
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
21
// for more details.
22
//
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.
26
//
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.
33
//
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.
36
//
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####
43
//
44
// Author(s):    dmoseley
45
// Contributors: dmoseley
46
// Date:         2000-08-11
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
52
//
53
//               Empty Stubs:
54
//                 Interval timer - This should really belong to the application
55
//                 operating system.
56
//
57
//               Should not contain:
58
//                 low level uart getchar and putchar functions
59
//                 delay function to support uart
60
//
61
//####DESCRIPTIONEND####
62
//
63
//=========================================================================
64
 
65
#include "monitor.h"
66
 
67
struct regstruct regtab[] =
68
{
69
    {"d0",       D0,          1},
70
    {"d1",       D1,          1},
71
    {"d2",       D2,          1},
72
    {"d3",       D3,          1},
73
    {"a0",       A0,          1},
74
    {"a1",       A1,          1},
75
    {"a2",       A2,          1},
76
    {"a3",       A3,          1},
77
    {"sp",       SP,          1},
78
    {"pc",       PC,          1},
79
    {"mdr",      MDR,         1},
80
    {"psw",      PSW,         1},
81
    {"lir",      LIR,         1},
82
    {"lar",      LAR,         1},
83
#ifdef CYGPKG_HAL_MN10300_AM33
84
    {"r0",       R0,          1},
85
    {"r1",       R1,          1},
86
    {"r2",       R2,          1},
87
    {"r3",       R3,          1},
88
    {"r4",       R4,          1},
89
    {"r5",       R5,          1},
90
    {"r6",       R6,          1},
91
    {"r7",       R7,          1},
92
    {"ssp",      SSP,         1},
93
    {"msp",      MSP,         1},
94
    {"usp",      USP,         1},
95
    {"mcrh",     MCRH,        1},
96
    {"mcrl",     MCRL,        1},
97
    {"mcvf",     MCVF,        1},
98
    {"mdrq",     MDRQ,        1},
99
#if CYGHWR_HAL_MN10300_AM33_REVISION == 2
100
    {"fpcr",     FPCR,        1},
101
    {"fs0",      FS0,         1},
102
    {"fs1",      FS1,         1},
103
    {"fs2",      FS2,         1},
104
    {"fs3",      FS3,         1},
105
    {"fs4",      FS4,         1},
106
    {"fs5",      FS5,         1},
107
    {"fs6",      FS6,         1},
108
    {"fs7",      FS7,         1},
109
    {"fs8",      FS8,         1},
110
    {"fs9",      FS9,         1},
111
    {"fs10",     FS10,        1},
112
    {"fs11",     FS11,        1},
113
    {"fs12",     FS12,        1},
114
    {"fs13",     FS13,        1},
115
    {"fs14",     FS14,        1},
116
    {"fs15",     FS15,        1},
117
    {"fs16",     FS16,        1},
118
    {"fs17",     FS17,        1},
119
    {"fs18",     FS18,        1},
120
    {"fs19",     FS19,        1},
121
    {"fs20",     FS20,        1},
122
    {"fs21",     FS21,        1},
123
    {"fs22",     FS22,        1},
124
    {"fs23",     FS23,        1},
125
    {"fs24",     FS24,        1},
126
    {"fs25",     FS25,        1},
127
    {"fs26",     FS26,        1},
128
    {"fs27",     FS27,        1},
129
    {"fs28",     FS28,        1},
130
    {"fs29",     FS29,        1},
131
    {"fs30",     FS30,        1},
132
    {"fs31",     FS31,        1},
133
#endif
134
#endif  
135
    { 0,         0,           1}, /* Terminating element must be last */
136
} ;
137
 
138
void
139
initialize_mon(void)
140
{
141
} /* initialize_mon */
142
 
143
#if CYGHWR_HAL_MN10300_AM33_REVISION == 2
144
extern int fpu_regs_read;
145
#endif
146
 
147
#ifdef CYGPKG_HAL_MN10300_AM33
148
extern int msp_read;
149
#endif
150
 
151
void
152
initialize_mon_each_time(void)
153
{
154
  int i;
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++)
158
    {
159
      if ((regtab[i].registernumber >= FP_START) && (regtab[i].registernumber <= FP_END))
160
        regtab[i].registervalid = fpu_regs_read;
161
    }
162
#endif
163
 
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++)
167
    {
168
      if (regtab[i].registernumber == MSP)
169
          regtab[i].registervalid = msp_read;
170
    }
171
#endif
172
} /* initialize_mon_each_time */
173
 
174
 
175
#include <cyg/hal/hal_arch.h>
176
#include <bsp/common/bsp_if.h>
177
int
178
machine_syscall(HAL_SavedRegisters *regs)
179
{
180
    int res, err;
181
    target_register_t d0, d1, d2, d3;
182
 
183
    d0 = get_register(D0);
184
    d1 = get_register(D1);
185
    d2 = get_register(D2);
186
    d3 = get_register(D3);
187
 
188
    err = _bsp_do_syscall(d0, // Function
189
                          d1, d2, d3, 0, // arguments,
190
                          &res);
191
    if (err)
192
    {
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);
196
    }
197
 
198
    return err;
199
}
200
 
201
 
202
// Utility function for printing breakpoints
203
void bp_print(target_register_t bp_val)
204
{
205
    bsp_printf("0x%08lx\n", (unsigned long)bp_val);
206
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.