hi_errno.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /******************************************************************************
  2. Copyright (C), 2016, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_errno.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/07/15
  8. Last Modified :
  9. Description : define the format of error code
  10. Function List :
  11. ******************************************************************************/
  12. #ifndef __HI_ERRNO_H__
  13. #define __HI_ERRNO_H__
  14. #include "hi_debug.h"
  15. #ifdef __cplusplus
  16. #if __cplusplus
  17. extern "C"{
  18. #endif
  19. #endif /* End of #ifdef __cplusplus */
  20. /* 1010 0000b
  21. * VTOP use APPID from 0~31
  22. * so, hisilicon use APPID based on 32
  23. */
  24. #define HI_ERR_APPID (0x80000000L + 0x20000000L)
  25. typedef enum hiERR_LEVEL_E
  26. {
  27. EN_ERR_LEVEL_DEBUG = 0, /* debug-level */
  28. EN_ERR_LEVEL_INFO, /* informational */
  29. EN_ERR_LEVEL_NOTICE, /* normal but significant condition */
  30. EN_ERR_LEVEL_WARNING, /* warning conditions */
  31. EN_ERR_LEVEL_ERROR, /* error conditions */
  32. EN_ERR_LEVEL_CRIT, /* critical conditions */
  33. EN_ERR_LEVEL_ALERT, /* action must be taken immediately */
  34. EN_ERR_LEVEL_FATAL, /* just for compatibility with previous version */
  35. EN_ERR_LEVEL_BUTT
  36. }ERR_LEVEL_E;
  37. /******************************************************************************
  38. |----------------------------------------------------------------|
  39. | 1 | APP_ID | MOD_ID | ERR_LEVEL | ERR_ID |
  40. |----------------------------------------------------------------|
  41. |<--><--7bits----><----8bits---><--3bits---><------13bits------->|
  42. ******************************************************************************/
  43. #define HI_DEF_ERR( module, level, errid) \
  44. ((HI_S32)( (HI_ERR_APPID) | ((module) << 16 ) | ((level)<<13) | (errid) ))
  45. /* NOTE! the following defined all common error code,
  46. ** all module must reserved 0~63 for their common error code
  47. */
  48. typedef enum hiEN_ERR_CODE_E
  49. {
  50. EN_ERR_INVALID_DEVID = 1, /* invlalid device ID */
  51. EN_ERR_INVALID_CHNID = 2, /* invlalid channel ID */
  52. EN_ERR_ILLEGAL_PARAM = 3, /* at lease one parameter is illagal
  53. * eg, an illegal enumeration value */
  54. EN_ERR_EXIST = 4, /* resource exists */
  55. EN_ERR_UNEXIST = 5, /* resource unexists */
  56. EN_ERR_NULL_PTR = 6, /* using a NULL point */
  57. EN_ERR_NOT_CONFIG = 7, /* try to enable or initialize system, device
  58. ** or channel, before configing attribute */
  59. EN_ERR_NOT_SUPPORT = 8, /* operation or type is not supported by NOW */
  60. EN_ERR_NOT_PERM = 9, /* operation is not permitted
  61. ** eg, try to change static attribute */
  62. EN_ERR_INVALID_PIPEID = 10, /* invlalid pipe ID */
  63. EN_ERR_INVALID_STITCHGRPID = 11, /* invlalid stitch group ID */
  64. EN_ERR_NOMEM = 12,/* failure caused by malloc memory */
  65. EN_ERR_NOBUF = 13,/* failure caused by malloc buffer */
  66. EN_ERR_BUF_EMPTY = 14,/* no data in buffer */
  67. EN_ERR_BUF_FULL = 15,/* no buffer for new data */
  68. EN_ERR_SYS_NOTREADY = 16,/* System is not ready,maybe not initialed or
  69. ** loaded. Returning the error code when opening
  70. ** a device file failed. */
  71. EN_ERR_BADADDR = 17,/* bad address,
  72. ** eg. used for copy_from_user & copy_to_user */
  73. EN_ERR_BUSY = 18,/* resource is busy,
  74. ** eg. destroy a venc chn without unregister it */
  75. EN_ERR_SIZE_NOT_ENOUGH = 19, /* buffer size is smaller than the actual size required */
  76. EN_ERR_BUTT = 63,/* maxium code, private error code of all modules
  77. ** must be greater than it */
  78. }EN_ERR_CODE_E;
  79. #ifdef __cplusplus
  80. #if __cplusplus
  81. }
  82. #endif
  83. #endif /* __cplusplus */
  84. #endif /* __HI_ERRNO_H__ */