wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 1 | /* 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 | /* |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 33 | 1 2 3 4 5 6 7 8 |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 34 | 01234567890123456789012345678901234567890123456789012345678901234567890123456789 |
| 35 | */ |
| 36 | /* List define statements here */ |
| 37 | |
| 38 | /* These are for all the toolboxes and functions to use. These will help |
| 39 | to 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 | |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 81 | /*----------------------------------------------------------------------*/ |
| 82 | /* these are for the error checking toolbox */ |
| 83 | |
| 84 | #define INVALID 0xfd00 /* NOT valid */ |
| 85 | #define VALID 0xfd01 /* valid */ |
| 86 | |
| 87 | /* This error is found in the fcn: |
| 88 | is_right_size_input() to indicate |
| 89 | that the input was not 8 characters |
| 90 | long. */ |
| 91 | #define INVALID_SIZE 0xfd02 |
| 92 | |
| 93 | /* This error is found in the fcn: |
| 94 | is_valid_address_range() to indicate |
| 95 | that the address given falls outside |
| 96 | of valid memory defined by MEM_START |
| 97 | to MEM_END. |
| 98 | */ |
| 99 | #define OUT_OF_BOUNDS_ADDRESS 0xfd03 |
| 100 | |
| 101 | /* This error is found in the fcn: |
| 102 | is_valid_hex_input() to indicate that |
| 103 | one of more of the characters entered |
| 104 | are not valid hex characters. Valid |
| 105 | hex characters are 0-9, A-F, a-f. |
| 106 | */ |
| 107 | #define INVALID_HEX_INPUT 0xfd04 |
| 108 | |
| 109 | /* This error is found in the fcn: |
| 110 | is_valid_register_number() to indicate |
| 111 | that a given register does not exist. |
| 112 | */ |
| 113 | #define REG_NOT_READABLE 0xfd05 |
| 114 | |
| 115 | /* This error is found in the fcn: |
| 116 | is_word_aligned_address() to indicate |
| 117 | that the given address is not word- |
| 118 | aligned. A word-aligned address ends |
| 119 | in 0x0,0x4,0x8,0xc. |
| 120 | */ |
| 121 | #define NOT_WORD_ALIGNED 0xfd07 |
| 122 | |
| 123 | /* This error is found in the fcn: |
| 124 | is_valid_address_range() to indicate |
| 125 | that the starting address is greater |
| 126 | than the ending address. |
| 127 | */ |
| 128 | #define REVERSED_ADDRESS 0xfd08 |
| 129 | |
| 130 | /* this error tells us that the address |
| 131 | specified as the destination is within |
| 132 | the source addresses */ |
| 133 | #define RANGE_OVERLAP 0xfd09 |
| 134 | |
| 135 | |
| 136 | #define ERROR 0xfd0a /* An error occured */ |
| 137 | #define INVALID_PARAM 0xfd0b /* "invalid input parameter " */ |
| 138 | |
| 139 | |
| 140 | #define INVALID_FLAG 0xfd0c /* invalid flag */ |
| 141 | |
| 142 | /*----------------------------------------------------------------------*/ |
| 143 | /* these are for the getarg toolbox */ |
| 144 | |
| 145 | #define INVALID_NUMBER_ARGS 0xFE00 /* invalid number of commd arguements */ |
| 146 | #define UNKNOWN_PARAMETER 0xFE01 /* "unknown type of parameter "*/ |
| 147 | |
| 148 | |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 149 | /*----------------------------------------------------------------------*/ |
| 150 | /* these are for the tokenizer toolbox */ |
| 151 | |
| 152 | #define ILLEGAL_CHARACTER 0xFF00 /* unrecognized char. in input stream*/ |
| 153 | #define TTL_NOT_SORTED 0xFF01 /* token translation list not sorted */ |
| 154 | #define TTL_NOT_DEFINED 0xFF02 /* token translation list not assigned*/ |
| 155 | #define INVALID_STRING 0xFF03 /* unable to extract string from input */ |
| 156 | #define BUFFER_EMPTY 0xFF04 /* "input buffer is empty" */ |
| 157 | #define INVALID_MODE 0xFF05 /* input buf is in an unrecognized mode*/ |
| 158 | #define TOK_INTERNAL_ERROR 0xFF06 /* "internal tokenizer error" */ |
| 159 | #define TOO_MANY_IBS 0xFF07 /* "too many open input buffers" */ |
| 160 | #define NO_OPEN_IBS 0xFF08 /* "no open input buffers" */ |
| 161 | |
| 162 | |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 163 | /* these are for the read from screen toolbox */ |
| 164 | |
| 165 | #define RESERVED_WORD 0xFC00 /* used a reserved word as an arguement*/ |
| 166 | |
| 167 | |
| 168 | /* these are for the breakpoint routines */ |
| 169 | |
| 170 | #define FULL_BPDS 0xFA00 /* breakpoint data structure is full */ |
| 171 | |
| 172 | |
wdenk | 327f7a0 | 2001-11-28 17:49:55 +0000 | [diff] [blame] | 173 | /* THESE are for the downloader */ |
| 174 | |
| 175 | #define NOT_IN_S_RECORD_FORMAT 0xf900 /* "not in S-Record Format" */ |
| 176 | #define UNREC_RECORD_TYPE 0xf901 /* "unrecognized record type" */ |
| 177 | #define CONVERSION_ERROR 0xf902 /* "ascii to int conversion error" */ |
| 178 | #define INVALID_MEMORY 0xf903 /* "bad s-record memory address " */ |
| 179 | |
| 180 | |
| 181 | /* these are for the compression and decompression stuff */ |
| 182 | |
| 183 | #define COMP_UNK_CHARACTER 0xf800 /* "unknown compressed character " */ |
| 184 | |
| 185 | #define COMP_UNKNOWN_STATE 0xf801 /* "unknown binary state" */ |
| 186 | |
| 187 | #define NOT_IN_COMPRESSED_FORMAT 0xf802 /* not in compressed S-Record format */ |
| 188 | |
| 189 | |
| 190 | /* these are for the DUART handling things */ |
| 191 | |
| 192 | /* "unrecognized serial port configuration" */ |
| 193 | #define UNKNOWN_PORT_STATE 0xf700 |
| 194 | |
| 195 | |
| 196 | /* these are for the register toolbox */ |
| 197 | |
| 198 | /* "cannot find register in special |
| 199 | purpose register file " */ |
| 200 | #define SPR_NOT_FOUND 0xf600 |
| 201 | |
| 202 | |
| 203 | /* these are for the duart specific stuff */ |
| 204 | |
| 205 | /* "transparent mode needs access to |
| 206 | two serial ports" */ |
| 207 | #define TM_NEEDS_BOTH_PORTS 0xf500 |
| 208 | |
| 209 | |
| 210 | /*----------------------------------------------------------------------*/ |
| 211 | /* these are specifically for the flash routines */ |
| 212 | #define FLASH_ERROR 0xf100 /* general flash error */ |