1 /* Definitions and macros for support of AMD's remote debugger, MiniMON.
2 Copyright (C) 1990, 1991 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21 * Some basic types. FIXME, this should be done by declaring bitfield
22 * sizes in the structs. We can't portably depend on a "long int" being
25 typedef long int INT32
; /* 32 bit integer */
26 typedef unsigned long int UINT32
; /* 32 bit integer (unsigned) */
27 typedef unsigned long int ADDR32
; /* 32 bit address */
28 typedef unsigned long int INST32
; /* 32 bit instruction */
29 typedef long int BOOLEAN
; /* Boolean value (32 bit) */
30 typedef unsigned char BYTE
; /* byte (8 bit) */
31 typedef short int INT16
; /* 16 bit integer */
32 typedef unsigned short int UINT16
; /* 16 bit integer (unsigned) */
34 /****************************************************************************/
35 /************************* Message Information ******************************/
36 /****************************************************************************/
43 #define EMUSAGE 1 /* Bad args / flags */
44 #define EMFAIL 2 /* Unrecoverable error */
45 #define EMBADADDR 3 /* Illegal address */
46 #define EMBADREG 4 /* Illegal register */
47 #define EMSYNTAX 5 /* Illegal command syntax */
48 #define EMACCESS 6 /* Could not access memory */
49 #define EMALLOC 7 /* Could not allocate memory */
50 #define EMTARGET 8 /* Unknown target type */
51 #define EMHINIT 9 /* Could not initialize host */
52 #define EMCOMM 10 /* Could not open communication channel */
55 #define EMBADMSG 11 /* Unknown message type */
56 #define EMMSG2BIG 12 /* Message to large for buffer */
57 #define EMNOSEND 13 /* Could not send message */
58 #define EMNORECV 14 /* Could not receive message */
60 #define EMRESET 15 /* Could not RESET target */
61 #define EMCONFIG 16 /* Could not get target CONFIG */
62 #define EMSTATUS 17 /* Could not get target STATUS */
63 #define EMREAD 18 /* Could not READ target memory */
64 #define EMWRITE 19 /* Could not WRITE target memory */
65 #define EMBKPTSET 20 /* Could not set breakpoint */
66 #define EMBKPTRM 21 /* Could not remove breakpoint */
67 #define EMBKPTSTAT 22 /* Could not get breakpoint status */
68 #define EMBKPTNONE 23 /* All breakpoints in use */
69 #define EMBKPTUSED 24 /* Breakpoints already in use */
70 #define EMCOPY 25 /* Could not COPY target memory */
71 #define EMFILL 26 /* Could not FILL target memory */
72 #define EMINIT 27 /* Could not initialize target memory */
73 #define EMGO 28 /* Could not start execution */
74 #define EMSTEP 29 /* Could not single step */
75 #define EMBREAK 30 /* Could not BREAK */
76 #define EMHIF 31 /* Could not perform HIF service */
77 #define EMCHANNEL0 32 /* Could not read CHANNEL0 */
78 #define EMCHANNEL1 33 /* Could not write CHANNEL1 */
80 /* COFF file loader errors */
81 #define EMOPEN 34 /* Could not open COFF file */
82 #define EMHDR 35 /* Could not read COFF header */
83 #define EMMAGIC 36 /* Bad magic number */
84 #define EMAOUT 37 /* Could not read COFF a.out header */
85 #define EMSCNHDR 38 /* Could not read COFF section header */
86 #define EMSCN 39 /* Could not read COFF section */
87 #define EMCLOSE 40 /* Could not close COFF file */
90 #define EMLOGOPEN 41 /* Could not open log file */
91 #define EMLOGREAD 42 /* Could not read log file */
92 #define EMLOGWRITE 43 /* Could not write to log file */
93 #define EMLOGCLOSE 44 /* Could not close log file */
95 /* Command file errors */
96 #define EMCMDOPEN 45 /* Could not open command file */
97 #define EMCMDREAD 46 /* Could not read command file */
98 #define EMCMDWRITE 47 /* Could not write to command file */
99 #define EMCMDCLOSE 48 /* Could not close comand file */
101 #define EMTIMEOUT 49 /* Host timed out waiting for a message */
102 #define EMCOMMTYPE 50 /* A '-t' flag must be specified */
103 #define EMCOMMERR 51 /* Communication error */
104 #define EMBAUD 52 /* Invalid baud rate specified */
108 #define LOCAL_REG 0 /* Local processor register */
109 #define GLOBAL_REG 1 /* Global processor register */
110 #define SPECIAL_REG 2 /* Special processor register */
111 #define TLB_REG 3 /* Translation Lookaside Buffer */
112 #define COPROC_REG 4 /* Coprocessor register */
113 #define I_MEM 5 /* Instruction Memory */
114 #define D_MEM 6 /* Data Memory */
115 #define I_ROM 7 /* Instruction ROM */
116 #define D_ROM 8 /* Data ROM */
117 #define I_O 9 /* Input/Output */
118 #define I_CACHE 10 /* Instruction Cache */
119 #define D_CACHE 11 /* Data Cache */
121 /* To supress warnings for zero length array definitions */
125 ** Host to target definitions
143 #define HIF_CALL_RTN 64
145 #define CHANNEL1_ACK 66
149 ** Target to host definitions
157 #define BKPT_SET_ACK 37
158 #define BKPT_RM_ACK 38
159 #define BKPT_STAT_ACK 39
168 #define CHANNEL0_ACK 97
172 /* A "generic" message */
173 struct generic_msg_t
{
174 INT32 code
; /* generic */
180 /* A "generic" message (with an INT32 array) */
181 struct generic_int32_msg_t
{
182 INT32 code
; /* generic */
189 ** Host to target messages
198 struct config_req_msg_t
{
204 struct status_req_msg_t
{
210 struct read_req_msg_t
{
219 struct write_req_msg_t
{
229 struct write_r_msg_t
{
239 struct bkpt_set_msg_t
{
249 struct bkpt_rm_msg_t
{
257 struct bkpt_stat_msg_t
{
283 BYTE fill_data
[DUMMY
];
295 INT32 mem_stack_size
;
296 INT32 reg_stack_size
;
321 struct hif_call_rtn_msg_t
{
324 INT32 service_number
;
331 struct channel0_msg_t
{
338 struct channel1_ack_msg_t
{
345 ** Target to host messages
349 struct reset_ack_msg_t
{
355 struct config_msg_t
{
373 struct status_msg_t
{
389 struct read_ack_msg_t
{
398 struct read_r_ack_msg_t
{
408 struct write_ack_msg_t
{
417 struct bkpt_set_ack_msg_t
{
427 struct bkpt_rm_ack_msg_t
{
435 struct bkpt_stat_ack_msg_t
{
445 struct copy_ack_msg_t
{
456 struct fill_ack_msg_t
{
466 struct init_ack_msg_t
{
491 struct hif_call_msg_t
{
494 INT32 service_number
;
501 struct channel0_ack_msg_t
{
507 struct channel1_msg_t
{
516 ** Union all of the message types together
520 struct generic_msg_t generic_msg
;
521 struct generic_int32_msg_t generic_int32_msg
;
523 struct reset_msg_t reset_msg
;
524 struct config_req_msg_t config_req_msg
;
525 struct status_req_msg_t status_req_msg
;
526 struct read_req_msg_t read_req_msg
;
527 struct write_req_msg_t write_req_msg
;
528 struct write_r_msg_t write_r_msg
;
529 struct bkpt_set_msg_t bkpt_set_msg
;
530 struct bkpt_rm_msg_t bkpt_rm_msg
;
531 struct bkpt_stat_msg_t bkpt_stat_msg
;
532 struct copy_msg_t copy_msg
;
533 struct fill_msg_t fill_msg
;
534 struct init_msg_t init_msg
;
535 struct go_msg_t go_msg
;
536 struct step_msg_t step_msg
;
537 struct break_msg_t break_msg
;
539 struct hif_call_rtn_msg_t hif_call_rtn_msg
;
540 struct channel0_msg_t channel0_msg
;
541 struct channel1_ack_msg_t channel1_ack_msg
;
543 struct reset_ack_msg_t reset_ack_msg
;
544 struct config_msg_t config_msg
;
545 struct status_msg_t status_msg
;
546 struct read_ack_msg_t read_ack_msg
;
547 struct read_r_ack_msg_t read_r_ack_msg
;
548 struct write_ack_msg_t write_ack_msg
;
549 struct bkpt_set_ack_msg_t bkpt_set_ack_msg
;
550 struct bkpt_rm_ack_msg_t bkpt_rm_ack_msg
;
551 struct bkpt_stat_ack_msg_t bkpt_stat_ack_msg
;
552 struct copy_ack_msg_t copy_ack_msg
;
553 struct fill_ack_msg_t fill_ack_msg
;
554 struct init_ack_msg_t init_ack_msg
;
555 struct halt_msg_t halt_msg
;
557 struct error_msg_t error_msg
;
559 struct hif_call_msg_t hif_call_msg
;
560 struct channel0_ack_msg_t channel0_ack_msg
;
561 struct channel1_msg_t channel1_msg
;