1 #ifndef __BSP_GDB_DATA_H__
2 #define __BSP_GDB_DATA_H__
3 //==========================================================================
7 // Shared data specific to gdb 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####
46 // Contributors: gthomas
48 // Purpose: Shared data specific to gdb stub.
52 //####DESCRIPTIONEND####
54 //=========================================================================
58 typedef int (*gdb_memproc_t)(void *__addr, /* start addr of memory to read/write */
59 int __asid, /* address space id */
60 int __size, /* size of individual read/write ops */
61 int __n, /* number of read/write operations */
62 void *__buf); /* result(read)/src(write) buffer */
65 typedef void (*gdb_regproc_t)(int __regno, /* Register number */
66 void *__regs, /* pointer to saved regs */
67 void *__val); /* pointer to register value */
72 * An application may override the standard BSP memory
73 * read and/or write routines with these hooks.
75 gdb_memproc_t __mem_read_hook;
76 gdb_memproc_t __mem_write_hook;
79 * An application may override the standard BSP register
80 * access routines with these hooks.
82 gdb_regproc_t __reg_get_hook;
83 gdb_regproc_t __reg_set_hook;
86 * An application may extend the gdb remote protocol by
87 * installing hooks to handle unknown general query and
88 * set packets ("q" pkts and 'Q' pkts) with these two hooks.
90 void (*__pkt_query_hook)(unsigned char *__pkt);
91 void (*__pkt_set_hook)(unsigned char *__pkt);
94 * An application may also extend the gdb remote protocol
95 * by installing a hook to handle all unknown packets.
97 void (*__pkt_hook)(unsigned char *__pkt);
100 * The above hooks for receiving packets will probably need
101 * a mechanism to respond. This vector is provided to allow
102 * an application to append data to the outgoing packet which
103 * will be sent after the above hooks are called.
105 * This vector uses a printf-like format string followed by
106 * some number of arguments.
108 void (*__pkt_append)(char *fmt, ...);
111 * An application can read/write from/to gdb console
112 * through these vectors.
114 * NB: console read is not supported and will block forever.
116 int (*__console_read)(char *__buf, int len);
117 int (*__console_write)(char *__buf, int len);
122 extern gdb_data_t *__get_gdb_data(void);
124 #endif /* __ASSEMBLER__ */
126 #endif // __BSP_GDB_DATA_H__