errors.h 7.5 KB

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