OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [cygmon/] [v2_0/] [misc/] [monitor.h] - Blame information for rev 277

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

Line No. Rev Author Line
1 27 unneback
//==========================================================================
2
//
3
//      monitor.h
4
//
5
//      Main definitions for the CygMON ROM monitor
6
//
7
//==========================================================================
8
//####ECOSGPLCOPYRIGHTBEGIN####
9
// -------------------------------------------
10
// This file is part of eCos, the Embedded Configurable Operating System.
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under
14
// the terms of the GNU General Public License as published by the Free
15
// Software Foundation; either version 2 or (at your option) any later version.
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20
// for more details.
21
//
22
// You should have received a copy of the GNU General Public License along
23
// with eCos; if not, write to the Free Software Foundation, Inc.,
24
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25
//
26
// As a special exception, if other files instantiate templates or use macros
27
// or inline functions from this file, or you compile this file and link it
28
// with other works to produce a work based on this file, this file does not
29
// by itself cause the resulting work to be covered by the GNU General Public
30
// License. However the source code for this file must still be made available
31
// in accordance with section (3) of the GNU General Public License.
32
//
33
// This exception does not invalidate any other reasons why a work based on
34
// this file might be covered by the GNU General Public License.
35
//
36
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37
// at http://sources.redhat.com/ecos/ecos-license/
38
// -------------------------------------------
39
//####ECOSGPLCOPYRIGHTEND####
40
//==========================================================================
41
//#####DESCRIPTIONBEGIN####
42
//
43
// Author(s):    
44
// Contributors: gthomas, dmoseley
45
// Date:         1999-10-20
46
// Purpose:      Main definitions for the CygMON ROM monitor
47
// Description:  
48
//               
49
//
50
//####DESCRIPTIONEND####
51
//
52
//=========================================================================
53
 
54
#ifndef MONITOR_H
55
#define MONITOR_H
56
 
57
#if !defined(__ASSEMBLER__)
58
#include <stdarg.h>
59
#endif
60
 
61
#include <board.h>
62
#ifdef HAVE_BSP
63
#include "cpu_info.h"
64
#endif
65
#include <monitor_cmd.h>
66
 
67
#ifdef __ECOS__
68
#include <cyg/hal/plf_stub.h>
69
#endif
70
 
71
#ifndef ASM
72
 
73
#ifdef HAVE_BSP
74
#define xprintf    bsp_dprintf
75
#define xsprintf   bsp_sprintf
76
#define xvprintf   bsp_dvprintf
77
#define xputchar   bsp_debug_putc
78
#define xgetchar   bsp_debug_getc
79
#define xungetchar bsp_debug_ungetc
80
#define __getTty() bsp_set_debug_comm(-1)
81
#define set_pc(x)  bsp_set_pc((x), mon_saved_regs)
82
 
83
#ifndef USE_ECOS_HAL_SINGLESTEP
84
#define __single_step()            bsp_singlestep_setup(mon_saved_regs)
85
#define __clear_single_step()      bsp_singlestep_cleanup(mon_saved_regs)
86
#endif /* USE_ECOS_HAL_SINGLESTEP */
87
 
88
#ifndef USE_ECOS_HAL_BREAKPOINTS
89
#define breakpoint() bsp_breakpoint()
90
#endif /* USE_ECOS_HAL_BREAKPOINTS */
91
 
92
#if defined(__ECOS__) && defined(CYGHWR_HAL_RESET_DEFINED)
93
   extern void __reset(void);
94
#else // defined(__ECOS__) && defined(CYGHWR_HAL_RESET_DEFINED)
95
#  define __reset    bsp_reset
96
#endif // defined(__ECOS__) && defined(CYGHWR_HAL_RESET_DEFINED)
97
 
98
#else
99
extern void xprintf(const char *fmt, ...);
100
extern void xsprintf(char *str, const char *fmt, ...);
101
extern void xvprintf(const char *fmt, va_list ap);
102
 
103
#ifdef HAS_USER_IO
104
#define xputchar   putUserChar
105
#define xgetchar   getUserChar
106
#else
107
extern void putDebugChar(int ch);
108
extern int  getDebugChar(void);
109
#define xputchar   putDebugChar
110
#define xgetchar   getDebugChar
111
#endif
112
#define xungetchar ungetDebugChar
113
#endif
114
 
115
 
116
#ifndef USE_ECOS_HAL_BREAKPOINTS
117
struct bp {
118
  mem_addr_t address;
119
  bp_inst_t  old_inst;
120
  char       in_memory;
121
  struct bp  *next;
122
};
123
#endif // USE_ECOS_HAL_BREAKPOINTS
124
 
125
struct regstruct
126
{
127
  char *registername;
128
  int  registernumber;
129
#ifdef HAVE_BSP
130
#if defined(CYGPKG_HAL_ARM) || !defined(__ECOS__)
131
  int  registertype;
132
#endif // defined(CYGPKG_HAL_ARM) || !defined(__ECOS__)
133
#endif
134
#ifdef REG_VALID_FIELD_IN_REGSTRUCT
135
  int registervalid;
136
#endif
137
};
138
 
139
 
140
 
141
#ifdef HAVE_BSP
142
#define REGTYPE_INT    1
143
#define REGTYPE_FLOAT  2
144
#define REGTYPE_DOUBLE 3
145
 
146
union target_reg
147
{
148
    unsigned long  i;   /* integer register (32/64 bit) */
149
#if HAVE_FLOAT_REGS
150
    float          f;   /* float register (32bit)       */
151
#endif
152
#if HAVE_DOUBLE_REGS
153
    double         d;   /* double register (64bit)      */
154
#endif
155
};
156
 
157
typedef union target_reg target_regval_t;
158
 
159
 
160
/* This is a template for what should be defined in  the board specific
161
   header file composed, board.h */
162
#if ! defined(MEM_ADDR_DEFINED)
163
#define MEM_ADDR_DEFINED 1
164
typedef struct mem_addr {
165
  unsigned long addr;
166
} mem_addr_t;
167
#endif
168
 
169
#if !defined(BP_INST_T_DEFINED)
170
#define BP_INST_T_DEFINED 1
171
typedef unsigned char bp_inst_t ;
172
#endif
173
 
174
#if ! defined(MAKE_STD_ADDR)
175
#define MAKE_STD_ADDR(SRC, DST) ((DST)->addr = (SRC))
176
#endif
177
 
178
 
179
#if ! defined(ADD_OFFSET)
180
#define ADD_OFFSET(SRC,DST,OFFSET) ((DST)->addr = (SRC)->addr + (OFFSET))
181
#endif
182
 
183
#if ! defined(ADD_ALIGN)
184
#define ADD_ALIGN(SRC,DST,ALIGN) \
185
              ((DST)->addr = (SRC)->addr - ((SRC)->addr % (ALIGN)))
186
#endif
187
 
188
#if ! defined(MEM_ADDR_EQ_P)
189
#define MEM_ADDR_EQ_P(A, B) ((A).addr == (B).addr)     
190
#endif
191
 
192
#if ! defined(MEM_ADDR_DIFF)
193
#define MEM_ADDR_DIFF(A, B) ((A).addr - (B).addr)
194
#endif
195
 
196
#if ! defined(MEM_ADDR_ASI)
197
#define MEM_ADDR_ASI(A) -1
198
#endif
199
 
200
#endif  /* HAVE_BSP */
201
 
202
#if defined(NO_MALLOC) && ! defined(MAX_NUM_BP)
203
#define MAX_NUM_BP 64
204
#endif
205
 
206
extern struct regstruct regtab[];
207
 
208
extern char **argvect;
209
 
210
#ifdef HAVE_BSP
211
#define VERSION "release 2.0"
212
#else
213
#define VERSION "release 1.2"
214
#endif
215
 
216
#define MAXLINELEN 80
217
#define PROMPT "cygmon> "
218
#if ! defined MAX_HIST_ENTS
219
#define MAX_HIST_ENTS 10
220
#endif
221
 
222
/*
223
 * From monitor.c
224
 */
225
extern mem_addr_t last_pc;
226
extern int        stub_is_active;
227
#ifdef HAVE_BSP
228
extern void *mon_saved_regs;
229
#else
230
extern int (*user_signal_handler)(int);
231
#endif
232
 
233
extern void clear_user_state (void);
234
extern int  transfer_to_stub (void);
235
extern void version (void);
236
#ifdef MONITOR_CONTROL_INTERRUPTS
237
/* Enable interrupts within the monitor. */
238
extern void monitor_enable_interrupts (void);
239
 
240
/* Disable interrupts within the monitor. */
241
extern void monitor_disable_interrupts (void);
242
 
243
/* Returns 1 if interrupts have been enabled within the monitor, 0
244
   otherwise. */
245
extern int monitor_interrupt_state (void);
246
#endif /* MONITOR_CONTROL_INTERRUPTS */
247
 
248
 
249
/*
250
 * From utils.c
251
 */
252
extern int switch_to_stub_flag;
253
extern int input_char (void);
254
extern target_register_t str2int (char *str, int base);
255
#if HAVE_DOUBLE_REGS
256
extern double str2double (char *str, int base);
257
#endif
258
extern target_register_t str2intlen (char *str, int base, int len);
259
extern int hex2bytes(char *string, char *dest, int maxsize);
260
extern char *int2str (target_register_t number, int base, int numdigs);
261
#ifndef NO_MALLOC
262
extern char *strdup(const char *str);
263
#endif
264
extern target_register_t get_pc(void);
265
extern char *get_register_str (regnames_t which, int detail, int valid);
266
extern void store_register (regnames_t which, char *string);
267
 
268
#ifndef USE_ECOS_HAL_BREAKPOINTS
269
/*
270
 * From breakpoints.c
271
 */
272
extern int add_mon_breakpoint (mem_addr_t location);
273
extern void install_breakpoints (void);
274
extern void clear_breakpoints (void);
275
extern int  show_breakpoints (void);
276
extern int clear_mon_breakpoint (mem_addr_t location);
277
#endif /* USE_ECOS_HAL_BREAKPOINTS */
278
 
279
 
280
/*
281
 * From do-dis.c
282
 */
283
extern mem_addr_t do_dis (mem_addr_t *addr);
284
extern void flush_dis (void);
285
 
286
 
287
/*
288
 * From architecture-mon.c
289
 */
290
#ifdef HAVE_BSP
291
extern void initialize_mon(void);
292
extern target_register_t get_register(regnames_t reg);
293
extern void put_register (regnames_t which, target_register_t value);
294
#endif
295
 
296
 
297
/* Lame. */
298
#ifndef ITIMER_REAL
299
#define ITIMER_REAL 0
300
#endif
301
 
302
#endif /* ASM */
303
#endif

powered by: WebSVN 2.1.0

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