blob: 1435188095c9405d2c9b7dc1610144dc9d77216c [file] [log] [blame]
wdenk327f7a02001-11-28 17:49:55 +00001/* Copyright Motorola, Inc. 1993, 1994
2 ALL RIGHTS RESERVED
3
4 You are hereby granted a copyright license to use, modify, and
5 distribute the SOFTWARE so long as this entire notice is retained
6 without alteration in any modified and/or redistributed versions,
7 and that such modified versions are clearly identified as such.
8 No licenses are granted by implication, estoppel or otherwise under
9 any patents or trademarks of Motorola, Inc.
10
11 The SOFTWARE is provided on an "AS IS" basis and without warranty.
12 To the maximum extent permitted by applicable law, MOTOROLA DISCLAIMS
13 ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED
14 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
15 PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
16 REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS
17 THEREOF) AND ANY ACCOMPANYING WRITTEN MATERIALS.
18
19 To the maximum extent permitted by applicable law, IN NO EVENT SHALL
20 MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
21 (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF
22 BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
23 INFORMATION, OR OTHER PECUNIARY LOSS) ARISING OF THE USE OR
24 INABILITY TO USE THE SOFTWARE. Motorola assumes no responsibility
25 for the maintenance and support of the SOFTWARE.
26
27*/
28
29
30#include "config.h"
31
32/*
33 1 2 3 4 5 6 7 8
3401234567890123456789012345678901234567890123456789012345678901234567890123456789
35*/
36/* List define statements here */
37
38/* These are for all the toolboxes and functions to use. These will help
39to standardize the error handling in the current project */
40
41 /* this is the "data type" for the error
42 messages in the system */
43#define STATUS unsigned int
44
45 /* this is a success status code */
46#define SUCCESS 1
47
48 /* likewise this is failure */
49#define FAILURE 0
50
51#define NUM_ERRORS 47
52
53/* This first section of "defines" are for error codes ONLY. The called
54 routine will return one of these error codes to the caller. If the final
55 returned code is "VALID", then everything is a-okay. However, if one
56 of the functions returns a non-valid status, that error code should be
57 propogated back to all the callers. At the end, the last caller will
58 call an error_processing function, and send in the status which was
59 returned. It's up to the error_processing function to determine which
60 error occured (as indicated by the status), and print an appropriate
61 message back to the user.
62*/
63/*----------------------------------------------------------------------*/
64/* these are specifically for the parser routines */
65
66#define UNKNOWN_COMMAND 0xfb00 /* "unrecognized command " */
67#define UNKNOWN_REGISTER 0xfb01 /* "unknown register "*/
68#define ILLEGAL_RD_STAGE 0xfb02 /* cannot specify reg. family in range*/
69#define ILLEGAL_REG_FAMILY 0xfb03 /* "cannot specify a range of special
70 or miscellaneous registers"*/
71#define RANGE_CROSS_FAMILY 0xfb04 /* "cannot specify a range across
72 register families" */
73#define UNIMPLEMENTED_STAGE 0xfb05 /* invalid rd or rmm parameter format */
74#define REG_NOT_WRITEABLE 0xfb06 /* "unknown operator in arguements"*/
75#define INVALID_FILENAME 0xfb07 /* "invalid download filename" */
76#define INVALID_BAUD_RATE 0xfb08 /* invalid baud rate from sb command */
77#define UNSUPPORTED_REGISTER 0xfb09 /* Special register is not supported */
78#define FOR_BOARD_ONLY 0xfb0a /* "Not available for Unix." */
79
80
81
82/*----------------------------------------------------------------------*/
83/* these are for the error checking toolbox */
84
85#define INVALID 0xfd00 /* NOT valid */
86#define VALID 0xfd01 /* valid */
87
88 /* This error is found in the fcn:
89 is_right_size_input() to indicate
90 that the input was not 8 characters
91 long. */
92#define INVALID_SIZE 0xfd02
93
94 /* This error is found in the fcn:
95 is_valid_address_range() to indicate
96 that the address given falls outside
97 of valid memory defined by MEM_START
98 to MEM_END.
99 */
100#define OUT_OF_BOUNDS_ADDRESS 0xfd03
101
102 /* This error is found in the fcn:
103 is_valid_hex_input() to indicate that
104 one of more of the characters entered
105 are not valid hex characters. Valid
106 hex characters are 0-9, A-F, a-f.
107 */
108#define INVALID_HEX_INPUT 0xfd04
109
110 /* This error is found in the fcn:
111 is_valid_register_number() to indicate
112 that a given register does not exist.
113 */
114#define REG_NOT_READABLE 0xfd05
115
116 /* This error is found in the fcn:
117 is_word_aligned_address() to indicate
118 that the given address is not word-
119 aligned. A word-aligned address ends
120 in 0x0,0x4,0x8,0xc.
121 */
122#define NOT_WORD_ALIGNED 0xfd07
123
124 /* This error is found in the fcn:
125 is_valid_address_range() to indicate
126 that the starting address is greater
127 than the ending address.
128 */
129#define REVERSED_ADDRESS 0xfd08
130
131 /* this error tells us that the address
132 specified as the destination is within
133 the source addresses */
134#define RANGE_OVERLAP 0xfd09
135
136
137#define ERROR 0xfd0a /* An error occured */
138#define INVALID_PARAM 0xfd0b /* "invalid input parameter " */
139
140
141#define INVALID_FLAG 0xfd0c /* invalid flag */
142
143/*----------------------------------------------------------------------*/
144/* these are for the getarg toolbox */
145
146#define INVALID_NUMBER_ARGS 0xFE00 /* invalid number of commd arguements */
147#define UNKNOWN_PARAMETER 0xFE01 /* "unknown type of parameter "*/
148
149
150
151
152
153/*----------------------------------------------------------------------*/
154/* these are for the tokenizer toolbox */
155
156#define ILLEGAL_CHARACTER 0xFF00 /* unrecognized char. in input stream*/
157#define TTL_NOT_SORTED 0xFF01 /* token translation list not sorted */
158#define TTL_NOT_DEFINED 0xFF02 /* token translation list not assigned*/
159#define INVALID_STRING 0xFF03 /* unable to extract string from input */
160#define BUFFER_EMPTY 0xFF04 /* "input buffer is empty" */
161#define INVALID_MODE 0xFF05 /* input buf is in an unrecognized mode*/
162#define TOK_INTERNAL_ERROR 0xFF06 /* "internal tokenizer error" */
163#define TOO_MANY_IBS 0xFF07 /* "too many open input buffers" */
164#define NO_OPEN_IBS 0xFF08 /* "no open input buffers" */
165
166
167
168/* these are for the read from screen toolbox */
169
170#define RESERVED_WORD 0xFC00 /* used a reserved word as an arguement*/
171
172
173/* these are for the breakpoint routines */
174
175#define FULL_BPDS 0xFA00 /* breakpoint data structure is full */
176
177
178
179/* THESE are for the downloader */
180
181#define NOT_IN_S_RECORD_FORMAT 0xf900 /* "not in S-Record Format" */
182#define UNREC_RECORD_TYPE 0xf901 /* "unrecognized record type" */
183#define CONVERSION_ERROR 0xf902 /* "ascii to int conversion error" */
184#define INVALID_MEMORY 0xf903 /* "bad s-record memory address " */
185
186
187/* these are for the compression and decompression stuff */
188
189#define COMP_UNK_CHARACTER 0xf800 /* "unknown compressed character " */
190
191#define COMP_UNKNOWN_STATE 0xf801 /* "unknown binary state" */
192
193#define NOT_IN_COMPRESSED_FORMAT 0xf802 /* not in compressed S-Record format */
194
195
196/* these are for the DUART handling things */
197
198 /* "unrecognized serial port configuration" */
199#define UNKNOWN_PORT_STATE 0xf700
200
201
202/* these are for the register toolbox */
203
204 /* "cannot find register in special
205 purpose register file " */
206#define SPR_NOT_FOUND 0xf600
207
208
209/* these are for the duart specific stuff */
210
211 /* "transparent mode needs access to
212 two serial ports" */
213#define TM_NEEDS_BOTH_PORTS 0xf500
214
215
216/*----------------------------------------------------------------------*/
217/* these are specifically for the flash routines */
218#define FLASH_ERROR 0xf100 /* general flash error */