WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
Error code
Error code 的协作图:

宏定义

#define LOS_ERRNO_OS_ID   (0x00U << 16)
 
#define LOS_ERRTYPE_NORMAL   (0x00U << 24)
 
#define LOS_ERRTYPE_WARN   (0x01U << 24)
 
#define LOS_ERRTYPE_ERROR   (0x02U << 24)
 
#define LOS_ERRTYPE_FATAL   (0x03U << 24)
 
#define LOS_ERRNO_OS_FATAL(MID, ERRNO)    (LOS_ERRTYPE_FATAL | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))
 
#define LOS_ERRNO_OS_ERROR(MID, ERRNO)    (LOS_ERRTYPE_ERROR | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))
 
#define LOS_ERRNO_OS_WARN(MID, ERRNO)    (LOS_ERRTYPE_WARN | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))
 
#define LOS_ERRNO_OS_NORMAL(MID, ERRNO)    (LOS_ERRTYPE_NORMAL | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))
 

枚举

enum  LOS_MOUDLE_ID {
  LOS_MOD_SYS = 0x0 , LOS_MOD_MEM = 0x1 , LOS_MOD_TSK = 0x2 , LOS_MOD_SWTMR = 0x3 ,
  LOS_MOD_TICK = 0x4 , LOS_MOD_MSG = 0x5 , LOS_MOD_QUE = 0x6 , LOS_MOD_SEM = 0x7 ,
  LOS_MOD_MBOX = 0x8 , LOS_MOD_HWI = 0x9 , LOS_MOD_HWWDG = 0xa , LOS_MOD_CACHE = 0xb ,
  LOS_MOD_HWTMR = 0xc , LOS_MOD_MMU = 0xd , LOS_MOD_LOG = 0xe , LOS_MOD_ERR = 0xf ,
  LOS_MOD_EXC = 0x10 , LOS_MOD_CSTK = 0x11 , LOS_MOD_MPU = 0x12 , LOS_MOD_NMHWI = 0x13 ,
  LOS_MOD_TRACE = 0x14 , LOS_MOD_KNLSTAT = 0x15 , LOS_MOD_EVTTIME = 0x16 , LOS_MOD_THRDCPUP = 0x17 ,
  LOS_MOD_IPC = 0x18 , LOS_MOD_STKMON = 0x19 , LOS_MOD_TIMER = 0x1a , LOS_MOD_RESLEAKMON = 0x1b ,
  LOS_MOD_EVENT = 0x1c , LOS_MOD_MUX = 0x1d , LOS_MOD_CPUP = 0x1e , LOS_MOD_FPB = 0x1f ,
  LOS_MOD_PERF = 0x20 , LOS_MOD_LPM = 0x21 , LOS_MOD_RWSEM = 0x22 , LOS_MOD_DYN_SHM = 0x23 ,
  LOS_MOD_RPQUEUE = 0x25 , LOS_MOD_SHELL = 0x31 , LOS_MOD_DRIVER = 0x41 , LOS_MOD_BUTT
}
 

详细描述

宏定义说明

◆ LOS_ERRNO_OS_ERROR

#define LOS_ERRNO_OS_ERROR (   MID,
  ERRNO 
)     (LOS_ERRTYPE_ERROR | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))

Define critical OS errors. It is a 32-bit unsigned integer error code.

  • 24-31 bits indicate the error level, here is LOS_ERRTYPE_ERROR.
  • 16-23 bits indicate the os error code flag, here is LOS_ERRNO_OS_ID.
  • 8-15 bits indicate the module which the error code belongs to. It is specified by MID.
  • 0-7 bits indicate the error code number. It is specified by ERRNO.

◆ LOS_ERRNO_OS_FATAL

#define LOS_ERRNO_OS_FATAL (   MID,
  ERRNO 
)     (LOS_ERRTYPE_FATAL | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))

Define fatal OS errors. It is a 32-bit unsigned integer error code.

  • 24-31 bits indicate the error level, here is LOS_ERRTYPE_FATAL.
  • 16-23 bits indicate the os error code flag, here is LOS_ERRNO_OS_ID.
  • 8-15 bits indicate the module which the error code belongs to. It is specified by MID.
  • 0-7 bits indicate the error code number. It is specified by ERRNO.

◆ LOS_ERRNO_OS_ID

#define LOS_ERRNO_OS_ID   (0x00U << 16)

OS error code flag. It is a 24-bit unsigned integer. Its value is 0x000000U.

◆ LOS_ERRNO_OS_NORMAL

#define LOS_ERRNO_OS_NORMAL (   MID,
  ERRNO 
)     (LOS_ERRTYPE_NORMAL | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))

Define informative OS errors. It is a 32-bit unsigned integer error code.

  • 24-31 bits indicate the error level, here is LOS_ERRTYPE_NORMAL.
  • 16-23 bits indicate the os error code flag, here is LOS_ERRNO_OS_ID.
  • 8-15 bits indicate the module which the error code belongs to. It is specified by MID.
  • 0-7 bits indicate the error code number. It is specified by ERRNO.

◆ LOS_ERRNO_OS_WARN

#define LOS_ERRNO_OS_WARN (   MID,
  ERRNO 
)     (LOS_ERRTYPE_WARN | LOS_ERRNO_OS_ID | ((UINT32)(MID) << 8) | ((UINT32)(ERRNO)))

Define warning OS errors. It is a 32-bit unsigned integer error code.

  • 24-31 bits indicate the error level, here is LOS_ERRTYPE_WARN.
  • 16-23 bits indicate the os error code flag, here is LOS_ERRNO_OS_ID.
  • 8-15 bits indicate the module which the error code belongs to. It is specified by MID.
  • 0-7 bits indicate the error code number. It is specified by ERRNO.

◆ LOS_ERRTYPE_ERROR

#define LOS_ERRTYPE_ERROR   (0x02U << 24)

Define the error level as critical. It is a 32-bit unsigned integer. Its value is 0x02000000U.

◆ LOS_ERRTYPE_FATAL

#define LOS_ERRTYPE_FATAL   (0x03U << 24)

Define the error level as fatal. It is a 32-bit unsigned integer. Its value is 0x03000000U.

◆ LOS_ERRTYPE_NORMAL

#define LOS_ERRTYPE_NORMAL   (0x00U << 24)

Define the error level as informative. It is a 32-bit unsigned integer. Its value is 0x00000000U.

◆ LOS_ERRTYPE_WARN

#define LOS_ERRTYPE_WARN   (0x01U << 24)

Define the error level as warning. It is a 32-bit unsigned integer. Its value is 0x01000000U.

枚举类型说明

◆ LOS_MOUDLE_ID

Define the ID of each module in kernel. The ID is used in error code.

枚举值
LOS_MOD_SYS 

System ID. Its value is 0x0.

LOS_MOD_MEM 

Dynamic memory module ID. Its value is 0x1.

LOS_MOD_TSK 

Task module ID. Its value is 0x2.

LOS_MOD_SWTMR 

Software timer module ID. Its value is 0x3.

LOS_MOD_TICK 

Tick module ID. Its value is 0x4.

LOS_MOD_MSG 

Message module ID. Its value is 0x5.

LOS_MOD_QUE 

Queue module ID. Its value is 0x6.

LOS_MOD_SEM 

Semaphore module ID. Its value is 0x7.

LOS_MOD_MBOX 

Static memory module ID. Its value is 0x8.

LOS_MOD_HWI 

Hardware interrupt module ID. Its value is 0x9.

LOS_MOD_HWWDG 

Hardware watchdog module ID. Its value is 0xa.

LOS_MOD_CACHE 

Cache module ID. Its value is 0xb.

LOS_MOD_HWTMR 

Hardware timer module ID. Its value is 0xc.

LOS_MOD_MMU 

MMU module ID. Its value is 0xd.

LOS_MOD_LOG 

Log module ID. Its value is 0xe.

LOS_MOD_ERR 

Error handling module ID. Its value is 0xf.

LOS_MOD_EXC 

Exception handling module ID. Its value is 0x10.

LOS_MOD_CSTK 

This module ID is reserved. Its value is 0x11.

LOS_MOD_MPU 

MPU module ID. Its value is 0x12.

LOS_MOD_NMHWI 

NMI module ID. It is reserved. Its value is 0x13.

LOS_MOD_TRACE 

Trace module ID. Its value is 0x14.

LOS_MOD_KNLSTAT 

This module ID is reserved. Its value is 0x15.

LOS_MOD_EVTTIME 

This module ID is reserved. Its value is 0x16.

LOS_MOD_THRDCPUP 

This module ID is reserved. Its value is 0x17.

LOS_MOD_IPC 

This module ID is reserved. Its value is 0x18.

LOS_MOD_STKMON 

This module ID is reserved. Its value is 0x19.

LOS_MOD_TIMER 

This module ID is reserved. Its value is 0x1a.

LOS_MOD_RESLEAKMON 

This module ID is reserved. Its value is 0x1b.

LOS_MOD_EVENT 

event module ID. Its value is 0x1c.

LOS_MOD_MUX 

mutex module ID. Its value is 0x1d.

LOS_MOD_CPUP 

CPU usage module ID. Its value is 0x1e.

LOS_MOD_FPB 

FPB module ID. Its value is 0x1f.

LOS_MOD_PERF 

Perf module ID. Its value is 0x20.

LOS_MOD_LPM 

LPM module ID. Its value is 0x21.

LOS_MOD_RWSEM 

RW Semaphore module ID. Its value is 0x22.

LOS_MOD_DYN_SHM 

dynamic shared memory module ID. Its value is 0x23.

LOS_MOD_RPQUEUE 

Remote Processor Queue module ID. Its value is 0x25.

LOS_MOD_SHELL 

shell module ID. Its value is 0x31.

LOS_MOD_DRIVER 

driver module ID. Its value is 0x41.

LOS_MOD_BUTT 

It is end flag of this enumeration.