1 /* Definitions and macros for support of AMD's remote debugger, MiniMON.
2 Copyright 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., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 * Some basic types. FIXME, this should be done by declaring bitfield
23 * sizes in the structs. We can't portably depend on a "long int" being
26 typedef long int INT32
; /* 32 bit integer */
27 typedef unsigned long int UINT32
; /* 32 bit integer (unsigned) */
28 typedef unsigned long int ADDR32
; /* 32 bit address */
29 typedef unsigned long int INST32
; /* 32 bit instruction */
30 typedef long int BOOLEAN
; /* Boolean value (32 bit) */
31 typedef unsigned char BYTE
; /* byte (8 bit) */
32 typedef short int INT16
; /* 16 bit integer */
33 typedef unsigned short int UINT16
; /* 16 bit integer (unsigned) */
35 /****************************************************************************/
36 /************************* Message Information ******************************/
37 /****************************************************************************/
44 #define EMUSAGE 1 /* Bad args / flags */
45 #define EMFAIL 2 /* Unrecoverable error */
46 #define EMBADADDR 3 /* Illegal address */
47 #define EMBADREG 4 /* Illegal register */
48 #define EMSYNTAX 5 /* Illegal command syntax */
49 #define EMACCESS 6 /* Could not access memory */
50 #define EMALLOC 7 /* Could not allocate memory */
51 #define EMTARGET 8 /* Unknown target type */
52 #define EMHINIT 9 /* Could not initialize host */
53 #define EMCOMM 10 /* Could not open communication channel */
56 #define EMBADMSG 11 /* Unknown message type */
57 #define EMMSG2BIG 12 /* Message to large for buffer */
58 #define EMNOSEND 13 /* Could not send message */
59 #define EMNORECV 14 /* Could not receive message */
61 #define EMRESET 15 /* Could not RESET target */
62 #define EMCONFIG 16 /* Could not get target CONFIG */
63 #define EMSTATUS 17 /* Could not get target STATUS */
64 #define EMREAD 18 /* Could not READ target memory */
65 #define EMWRITE 19 /* Could not WRITE target memory */
66 #define EMBKPTSET 20 /* Could not set breakpoint */
67 #define EMBKPTRM 21 /* Could not remove breakpoint */
68 #define EMBKPTSTAT 22 /* Could not get breakpoint status */
69 #define EMBKPTNONE 23 /* All breakpoints in use */
70 #define EMBKPTUSED 24 /* Breakpoints already in use */
71 #define EMCOPY 25 /* Could not COPY target memory */
72 #define EMFILL 26 /* Could not FILL target memory */
73 #define EMINIT 27 /* Could not initialize target memory */
74 #define EMGO 28 /* Could not start execution */
75 #define EMSTEP 29 /* Could not single step */
76 #define EMBREAK 30 /* Could not BREAK */
77 #define EMHIF 31 /* Could not perform HIF service */
78 #define EMCHANNEL0 32 /* Could not read CHANNEL0 */
79 #define EMCHANNEL1 33 /* Could not write CHANNEL1 */
81 /* COFF file loader errors */
82 #define EMOPEN 34 /* Could not open COFF file */
83 #define EMHDR 35 /* Could not read COFF header */
84 #define EMMAGIC 36 /* Bad magic number */
85 #define EMAOUT 37 /* Could not read COFF a.out header */
86 #define EMSCNHDR 38 /* Could not read COFF section header */
87 #define EMSCN 39 /* Could not read COFF section */
88 #define EMCLOSE 40 /* Could not close COFF file */
91 #define EMLOGOPEN 41 /* Could not open log file */
92 #define EMLOGREAD 42 /* Could not read log file */
93 #define EMLOGWRITE 43 /* Could not write to log file */
94 #define EMLOGCLOSE 44 /* Could not close log file */
96 /* Command file errors */
97 #define EMCMDOPEN 45 /* Could not open command file */
98 #define EMCMDREAD 46 /* Could not read command file */
99 #define EMCMDWRITE 47 /* Could not write to command file */
100 #define EMCMDCLOSE 48 /* Could not close comand file */
102 #define EMTIMEOUT 49 /* Host timed out waiting for a message */
103 #define EMCOMMTYPE 50 /* A '-t' flag must be specified */
104 #define EMCOMMERR 51 /* Communication error */
105 #define EMBAUD 52 /* Invalid baud rate specified */
109 #define LOCAL_REG 0 /* Local processor register */
110 #define GLOBAL_REG 1 /* Global processor register */
111 #define SPECIAL_REG 2 /* Special processor register */
112 #define TLB_REG 3 /* Translation Lookaside Buffer */
113 #define COPROC_REG 4 /* Coprocessor register */
114 #define I_MEM 5 /* Instruction Memory */
115 #define D_MEM 6 /* Data Memory */
116 #define I_ROM 7 /* Instruction ROM */
117 #define D_ROM 8 /* Data ROM */
118 #define I_O 9 /* Input/Output */
119 #define I_CACHE 10 /* Instruction Cache */
120 #define D_CACHE 11 /* Data Cache */
122 /* To supress warnings for zero length array definitions */
126 ** Host to target definitions
144 #define HIF_CALL_RTN 64
146 #define CHANNEL1_ACK 66
150 ** Target to host definitions
158 #define BKPT_SET_ACK 37
159 #define BKPT_RM_ACK 38
160 #define BKPT_STAT_ACK 39
169 #define CHANNEL0_ACK 97
173 /* A "generic" message */
176 INT32 code
; /* generic */
182 /* A "generic" message (with an INT32 array) */
183 struct generic_int32_msg_t
185 INT32 code
; /* generic */
192 ** Host to target messages
202 struct config_req_msg_t
209 struct status_req_msg_t
216 struct read_req_msg_t
226 struct write_req_msg_t
248 struct bkpt_set_msg_t
268 struct bkpt_stat_msg_t
297 BYTE fill_data
[DUMMY
];
310 INT32 mem_stack_size
;
311 INT32 reg_stack_size
;
339 struct hif_call_rtn_msg_t
343 INT32 service_number
;
350 struct channel0_msg_t
358 struct channel1_ack_msg_t
366 ** Target to host messages
370 struct reset_ack_msg_t
413 struct read_ack_msg_t
423 struct read_r_ack_msg_t
434 struct write_ack_msg_t
444 struct bkpt_set_ack_msg_t
455 struct bkpt_rm_ack_msg_t
464 struct bkpt_stat_ack_msg_t
475 struct copy_ack_msg_t
487 struct fill_ack_msg_t
498 struct init_ack_msg_t
526 struct hif_call_msg_t
530 INT32 service_number
;
537 struct channel0_ack_msg_t
544 struct channel1_msg_t
554 ** Union all of the message types together
559 struct generic_msg_t generic_msg
;
560 struct generic_int32_msg_t generic_int32_msg
;
562 struct reset_msg_t reset_msg
;
563 struct config_req_msg_t config_req_msg
;
564 struct status_req_msg_t status_req_msg
;
565 struct read_req_msg_t read_req_msg
;
566 struct write_req_msg_t write_req_msg
;
567 struct write_r_msg_t write_r_msg
;
568 struct bkpt_set_msg_t bkpt_set_msg
;
569 struct bkpt_rm_msg_t bkpt_rm_msg
;
570 struct bkpt_stat_msg_t bkpt_stat_msg
;
571 struct copy_msg_t copy_msg
;
572 struct fill_msg_t fill_msg
;
573 struct init_msg_t init_msg
;
574 struct go_msg_t go_msg
;
575 struct step_msg_t step_msg
;
576 struct break_msg_t break_msg
;
578 struct hif_call_rtn_msg_t hif_call_rtn_msg
;
579 struct channel0_msg_t channel0_msg
;
580 struct channel1_ack_msg_t channel1_ack_msg
;
582 struct reset_ack_msg_t reset_ack_msg
;
583 struct config_msg_t config_msg
;
584 struct status_msg_t status_msg
;
585 struct read_ack_msg_t read_ack_msg
;
586 struct read_r_ack_msg_t read_r_ack_msg
;
587 struct write_ack_msg_t write_ack_msg
;
588 struct bkpt_set_ack_msg_t bkpt_set_ack_msg
;
589 struct bkpt_rm_ack_msg_t bkpt_rm_ack_msg
;
590 struct bkpt_stat_ack_msg_t bkpt_stat_ack_msg
;
591 struct copy_ack_msg_t copy_ack_msg
;
592 struct fill_ack_msg_t fill_ack_msg
;
593 struct init_ack_msg_t init_ack_msg
;
594 struct halt_msg_t halt_msg
;
596 struct error_msg_t error_msg
;
598 struct hif_call_msg_t hif_call_msg
;
599 struct channel0_ack_msg_t channel0_ack_msg
;
600 struct channel1_msg_t channel1_msg
;