Macros/functions/etc for static analysis of code.
Definition in file nvos_static_analysis.h.
Go to the source code of this file.
Data Structures | |
| union | flag_converter |
| convert signedness of 32bit value More... | |
Macros | |
| #define | NVOS_EXIT(x) _exit(x) |
| #define | NVOS_MISRA(type, num) |
| These macros are used for whitelisting coverity violations. More... | |
| #define | NVOS_CERT(num) |
| #define | NVOS_COV_STRING(x) |
| #define | NVOS_COV_WHITELIST(type, checker, comment_str) |
| #define | NVOS_COV_WHITELIST_BLOCK_BEGIN(type, num, checker, comment_str) |
| #define | NVOS_COV_WHITELIST_BLOCK_END(checker) |
| #define | NVOS_COV_PEND_WHITELIST(checker, comment_str) |
| #define | ERR_INT30_C_ADDU16 0x378 |
| Exit codes for function that call NVOS_EXIT(). More... | |
| #define | ERR_INT30_C_ADDU32 0x377 |
| #define | ERR_INT30_C_ADDU64 0x376 |
| #define | ERR_INT30_C_SUBU32 0x375 |
| #define | ERR_INT30_C_SUBU64 0x374 |
| #define | ERR_INT30_C_MULTU32 0x373 |
| #define | ERR_INT30_C_MULTU64 0x372 |
| #define | ERR_INT32_C_ADDS32 0x371 |
| #define | ERR_INT32_C_ADDS64 0x370 |
| #define | ERR_INT32_C_SUBS32 0x369 |
| #define | ERR_INT32_C_SUBS64 0x368 |
| #define | ERR_INT32_C_MULTS32 0x367 |
| #define | ERR_INT32_C_MULTS64 0x366 |
| #define | ERR_INT32_C_DIVS32 0x365 |
| #define | ERR_INT32_C_DIVS64 0x364 |
| #define | ERR_INT31_C_CAST_U64TOU8 0x361 |
| #define | ERR_INT31_C_CAST_U32TOS32 0x360 |
| #define | ERR_INT31_C_CAST_U32TOU16 0x359 |
| #define | ERR_INT31_C_CAST_U32TOU8 0x358 |
| #define | ERR_INT31_C_CAST_U64TOU32 0x357 |
| #define | ERR_INT31_C_CAST_U64TOS32 0x356 |
| #define | ERR_INT31_C_CAST_S32TOU32 0x355 |
| #define | ERR_INT31_C_CAST_S64TOU32 0x354 |
| #define | ERR_INT31_C_CAST_S32TOU64 0x353 |
| #define | ERR_INT31_C_CAST_S32TOU8 0x352 |
| #define | ERR_INT31_C_CAST_S64TOU64 0x351 |
| #define | ERR_INT31_C_CAST_S64TOS32 0x350 |
| #define | ERR_INT31_C_CAST_U64TOS64 0x34F |
| #define | ERR_INT30_C_ADDU64UPTR 0x34E |
| #define | ERR_INT30_C_ADDU32UPTR 0x34D |
| #define | ERR_INT30_C_ADDU32VPTR ERR_INT30_C_ADDU32UPTR |
| #define | ERR_INT30_C_MULTSIZET 0x34C |
| #define | VA_ADDR_MASK 0xFFFFFFFFFFFFUL |
| Define macro for virtual address bit mask. More... | |
| #define | OFFSET_MASK 0xFFFFUL |
| #define | NvBoolTrue ((NvBoolVar)0xBABAFACEU) |
| Define macro to replace boolean True. More... | |
| #define | NvBoolFalse ((NvBoolVar)0x45450531U) |
| Define macro to replace boolean False. More... | |
| #define | NV_UINTPTR_MAX ((uintptr_t)0U - 1U) |
| Define macro to replace uintptr_t max. More... | |
Typedefs | |
| typedef uint32_t | NvBoolVar |
Functions | |
| static bool | AddU16 (uint16_t op1, uint16_t op2, uint16_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap. More... | |
| static bool | AddU32 (uint32_t op1, uint32_t op2, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap. More... | |
| static bool | AddS32 (int32_t op1, int32_t op2, int32_t *result) |
| CERT INT30-C Precondition test to ensure that integer add operation do not wrap. More... | |
| static bool | AddU64 (uint64_t op1, uint64_t op2, uint64_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap. More... | |
| static bool | AddS64 (int64_t op1, int64_t op2, int64_t *result) |
| CERT INT30-C Precondition test to ensure that integer add operation do not wrap. More... | |
| static bool | MultU32 (uint32_t op1, uint32_t op2, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap. More... | |
| static bool | MultU16 (uint16_t op1, uint16_t op2, uint16_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap. More... | |
| static bool | CastU64toU32 (uint64_t op1, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure casting unsigned long to unsigned integer do not wrap. More... | |
| static void | incrementUInt32 (uint32_t *x) |
| Increment uint32_t by one Precondition test to ensure value is within RANGE_MAX. More... | |
| static void | incrementUInt64 (uint64_t *x) |
| Increment uint64_t by one Precondition test to ensure value is within RANGE_MAX. More... | |
| static bool | CastU64toS32 (uint64_t op1, int32_t *result) |
| CERT INT30-C: Precondition test to ensure casting unsigned long to unsigned integer do not wrap. More... | |
| static bool | CastU32toS32 (uint32_t op1, int32_t *result) |
| CERT INT30-C: Precondition test to ensure casting unsigned integer to signed integer do not wrap. More... | |
| static bool | CastS32toU32 (int32_t op1, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure casting signed integer to unsigned integer do not wrap. More... | |
| static bool | CastS32toU16 (int32_t op1, uint16_t *result) |
| CERT INT30-C: Precondition test to ensure casting signed integer to unsigned integer do not wrap. More... | |
| static bool | MultU64 (uint64_t op1, uint64_t op2, uint64_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap. More... | |
| static bool | MultS32 (int32_t op1, int32_t op2, int32_t *result) |
| Precondition test to ensure that signed integer multiplication operation do not wrap. More... | |
| static bool | MultS64 (int64_t op1, int64_t op2, int64_t *result) |
| CERT INT30-C Precondition test to ensure that signed integer multiplication operation do not wrap. More... | |
| static bool | SubU32 (uint32_t op1, uint32_t op2, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap. More... | |
| static bool | SubU16 (uint16_t op1, uint16_t op2, uint16_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap. More... | |
| static bool | SubS32 (int32_t op1, int32_t op2, int32_t *result) |
| CERT INT32-C: Precondition test to ensure that signed integer subtraction operation does not overflow. More... | |
| static bool | SubU64 (uint64_t op1, uint64_t op2, uint64_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap. More... | |
| static bool | SubS64 (int64_t op1, int64_t op2, int64_t *result) |
| CERT INT30-C Precondition test to ensure that signed integer subtraction operation do not wrap. More... | |
| static bool | SubSizet (size_t op1, size_t op2, size_t *result) |
| CERT INT30-C: Precondition test to ensure that size_t subtraction operation do not wrap. More... | |
| static void | AddU16WithExit (uint16_t op1, uint16_t op2, uint16_t *result) |
| Exit API is not supported in LK and BL. More... | |
| static void | AddU32WithExit (uint32_t op1, uint32_t op2, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap. More... | |
| static void | AddU64WithExit (uint64_t op1, uint64_t op2, uint64_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap. More... | |
| static void | AddU32UPTRWithExit (uintptr_t op1, uint32_t op2, uintptr_t *result) |
| CERT INT30-C: Precondition test to ensure that uintptr_t and unsigned integer add operation do not wrap. More... | |
| static void | AddU32OffsetToVoidPtrWithExit (const void *op1, uint32_t op2, const void **result) |
| CERT INT30-C: Precondition test to ensure that void * and unsigned integer add operation does not wrap. More... | |
| static void | AddUPTRSizetWithExit (uintptr_t op1, size_t op2, uintptr_t *result) |
| CERT INT30-C: Precondition test to ensure that uintptr_t and size_t add operation do not wrap. More... | |
| static void | AddSizetWithExit (size_t op1, size_t op2, size_t *result) |
| CERT INT30-C: Precondition test to ensure that size_t add operation do not wrap. More... | |
| static void | MultSizetWithExit (size_t op1, size_t op2, size_t *result) |
| CERT INT30-C: Precondition test to ensure that size_t multiplication operation do not wrap. More... | |
| static void | AddU64UPTRWithExit (uintptr_t op1, uint64_t op2, uintptr_t *result) |
| CERT INT30-C: Precondition test to ensure that uintptr_t unsigned integer add operation do not wrap Function calls NVOS_EXIT() on overflow. More... | |
| static void | MultU32WithExit (uint32_t op1, uint32_t op2, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap. More... | |
| static void | MultU64WithExit (uint64_t op1, uint64_t op2, uint64_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap. More... | |
| static void | SubU32WithExit (uint32_t op1, uint32_t op2, uint32_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap. More... | |
| static void | SubU64WithExit (uint64_t op1, uint64_t op2, uint64_t *result) |
| CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap. More... | |
| static void | SubSizetWithExit (size_t op1, size_t op2, size_t *result) |
| CERT INT30-C: Precondition test to ensure that size_t subtraction operation do not wrap. More... | |
| static void | AddS32WithExit (int32_t op1, int32_t op2, int32_t *result) |
| CERT INT32-C: Precondition test to ensure that signed integer add operation do not overflow. More... | |
| static void | AddS64WithExit (int64_t op1, int64_t op2, int64_t *result) |
| static void | SubS32WithExit (int32_t op1, int32_t op2, int32_t *result) |
| CERT INT32-C: Precondition test to ensure that signed integer subtraction operation does not overflow. More... | |
| static void | SubS64WithExit (int64_t op1, int64_t op2, int64_t *result) |
| static void | DivS32WithExit (int32_t op1, int32_t op2, int32_t *result) |
| CERT INT32-C: Precondition test to ensure that signed integer division operation does not overflow or divide by zero. More... | |
| static void | DivS64WithExit (int64_t op1, int64_t op2, int64_t *result) |
| static uint32_t | CastS32toU32WithExit (int32_t op) |
| Casting functions to fix CERT INT31-C: Ensure integer conversions do not result in lost or misinterpreted data. More... | |
| static int32_t | CastU32toS32WithExit (uint32_t op) |
| static uint16_t | CastU32toU16WithExit (uint32_t op) |
| static uint8_t | CastU32toU8WithExit (uint32_t op) |
| static char | CastU32toCharWithExit (uint32_t op) |
| static uint8_t | CastU64toU8WithExit (uint64_t op) |
| static uint32_t | CastU64toU32WithExit (uint64_t op) |
| static int32_t | CastU64toS32WithExit (uint64_t op) |
| static uint32_t | CastS64toU32WithExit (int64_t op) |
| static uint64_t | CastS32toU64WithExit (int32_t op) |
| static uint8_t | CastS32toU8WithExit (int32_t op) |
| static uint64_t | CastS64toU64WithExit (int64_t op) |
| static int32_t | CastS64toS32WithExit (int64_t op) |
| static int64_t | CastU64toS64WithExit (uint64_t op) |
| static bool | AddU32UPTR (uintptr_t op1, uint32_t op2, uintptr_t *result) |
| CERT INT30-C: Ensure that uintptr_t and unsigned integer add do not result in lost or misinterpreted data. More... | |
| static bool | AddU32OffsetToVoidPtr (const void *op1, uint32_t op2, const void **result) |
| CERT INT30-C: Ensure that adding a 32-bit integer offset to a void pointer does not result in integer overflow. More... | |
| static bool | NvConvertUint64toUint32 (uint64_t op, uint32_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertUint64toInt64 (uint64_t op, int64_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static void | NvConvertUint32toInt64 (uint32_t op, int64_t *result) |
| MISRA RULE 10.8 Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertUint32toUint16 (uint32_t op, uint16_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertUint32toInt32 (uint32_t op, int32_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertUint32toUint8 (uint32_t op, uint8_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertLint64toULint64 (int64_t op, uint64_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertLint64toUint32 (int64_t op, uint32_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertLint64toInt32 (int64_t op, int32_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static bool | NvConvertInt32toUint32 (int32_t op, uint32_t *result) |
| CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data. More... | |
| static int32_t | NvConvertFlagUInt32toInt32 (uint32_t flag_uint32) |
| CERT INT30-C: Readl and writel APIs to avoid CERT-C warnings. More... | |
| static uint32_t | NvConvertFlagInt32toUInt32 (int32_t flag_int32) |
| CERT INT31-C: More... | |
| static bool | ShiftLeftU32 (uint32_t operand, uint32_t shift, uint32_t *result) |
| CERT INT34-C: More... | |
| static bool | ShiftRightU32 (uint32_t operand, uint32_t shift, uint32_t *result) |
| CERT INT34-C: More... | |
| #define ERR_INT30_C_ADDU16 0x378 |
Exit codes for function that call NVOS_EXIT().
Only LSBits are visible to parent process
Definition at line 210 of file nvos_static_analysis.h.
| #define ERR_INT30_C_ADDU32 0x377 |
Definition at line 211 of file nvos_static_analysis.h.
| #define ERR_INT30_C_ADDU32UPTR 0x34D |
Definition at line 239 of file nvos_static_analysis.h.
| #define ERR_INT30_C_ADDU32VPTR ERR_INT30_C_ADDU32UPTR |
Definition at line 240 of file nvos_static_analysis.h.
| #define ERR_INT30_C_ADDU64 0x376 |
Definition at line 212 of file nvos_static_analysis.h.
| #define ERR_INT30_C_ADDU64UPTR 0x34E |
Definition at line 238 of file nvos_static_analysis.h.
| #define ERR_INT30_C_MULTSIZET 0x34C |
Definition at line 241 of file nvos_static_analysis.h.
| #define ERR_INT30_C_MULTU32 0x373 |
Definition at line 215 of file nvos_static_analysis.h.
| #define ERR_INT30_C_MULTU64 0x372 |
Definition at line 216 of file nvos_static_analysis.h.
| #define ERR_INT30_C_SUBU32 0x375 |
Definition at line 213 of file nvos_static_analysis.h.
| #define ERR_INT30_C_SUBU64 0x374 |
Definition at line 214 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_S32TOU32 0x355 |
Definition at line 231 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_S32TOU64 0x353 |
Definition at line 233 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_S32TOU8 0x352 |
Definition at line 234 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_S64TOS32 0x350 |
Definition at line 236 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_S64TOU32 0x354 |
Definition at line 232 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_S64TOU64 0x351 |
Definition at line 235 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U32TOS32 0x360 |
Definition at line 226 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U32TOU16 0x359 |
Definition at line 227 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U32TOU8 0x358 |
Definition at line 228 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U64TOS32 0x356 |
Definition at line 230 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U64TOS64 0x34F |
Definition at line 237 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U64TOU32 0x357 |
Definition at line 229 of file nvos_static_analysis.h.
| #define ERR_INT31_C_CAST_U64TOU8 0x361 |
Definition at line 225 of file nvos_static_analysis.h.
| #define ERR_INT32_C_ADDS32 0x371 |
Definition at line 217 of file nvos_static_analysis.h.
| #define ERR_INT32_C_ADDS64 0x370 |
Definition at line 218 of file nvos_static_analysis.h.
| #define ERR_INT32_C_DIVS32 0x365 |
Definition at line 223 of file nvos_static_analysis.h.
| #define ERR_INT32_C_DIVS64 0x364 |
Definition at line 224 of file nvos_static_analysis.h.
| #define ERR_INT32_C_MULTS32 0x367 |
Definition at line 221 of file nvos_static_analysis.h.
| #define ERR_INT32_C_MULTS64 0x366 |
Definition at line 222 of file nvos_static_analysis.h.
| #define ERR_INT32_C_SUBS32 0x369 |
Definition at line 219 of file nvos_static_analysis.h.
| #define ERR_INT32_C_SUBS64 0x368 |
Definition at line 220 of file nvos_static_analysis.h.
| #define NV_UINTPTR_MAX ((uintptr_t)0U - 1U) |
Define macro to replace uintptr_t max.
Definition at line 267 of file nvos_static_analysis.h.
| #define NvBoolFalse ((NvBoolVar)0x45450531U) |
Define macro to replace boolean False.
Definition at line 261 of file nvos_static_analysis.h.
| #define NvBoolTrue ((NvBoolVar)0xBABAFACEU) |
Define macro to replace boolean True.
Definition at line 254 of file nvos_static_analysis.h.
| #define NVOS_CERT | ( | num | ) |
Definition at line 197 of file nvos_static_analysis.h.
| #define NVOS_COV_PEND_WHITELIST | ( | checker, | |
| comment_str | |||
| ) |
Definition at line 202 of file nvos_static_analysis.h.
| #define NVOS_COV_STRING | ( | x | ) |
Definition at line 198 of file nvos_static_analysis.h.
| #define NVOS_COV_WHITELIST | ( | type, | |
| checker, | |||
| comment_str | |||
| ) |
Definition at line 199 of file nvos_static_analysis.h.
| #define NVOS_COV_WHITELIST_BLOCK_BEGIN | ( | type, | |
| num, | |||
| checker, | |||
| comment_str | |||
| ) |
Definition at line 200 of file nvos_static_analysis.h.
| #define NVOS_COV_WHITELIST_BLOCK_END | ( | checker | ) |
Definition at line 201 of file nvos_static_analysis.h.
| #define NVOS_EXIT | ( | x | ) | _exit(x) |
Definition at line 39 of file nvos_static_analysis.h.
| #define NVOS_MISRA | ( | type, | |
| num | |||
| ) |
These macros are used for whitelisting coverity violations.
The macros are only enabled when a coverity scan is being run. no-op macros for normal compilation - whitelisting is disabled when a coverity scan is NOT being run
Definition at line 196 of file nvos_static_analysis.h.
| #define OFFSET_MASK 0xFFFFUL |
Definition at line 247 of file nvos_static_analysis.h.
| #define VA_ADDR_MASK 0xFFFFFFFFFFFFUL |
Define macro for virtual address bit mask.
Definition at line 246 of file nvos_static_analysis.h.
| typedef uint32_t NvBoolVar |
Definition at line 249 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C Precondition test to ensure that integer add operation do not wrap.
Definition at line 331 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT32-C: Precondition test to ensure that signed integer add operation do not overflow.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 974 of file nvos_static_analysis.h.
References ERR_INT32_C_ADDS32, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C Precondition test to ensure that integer add operation do not wrap.
Definition at line 362 of file nvos_static_analysis.h.
|
inlinestatic |
Definition at line 985 of file nvos_static_analysis.h.
References ERR_INT32_C_ADDS64, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that size_t add operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 834 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU32UPTR, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
Definition at line 282 of file nvos_static_analysis.h.
|
inlinestatic |
Exit API is not supported in LK and BL.
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap. Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 731 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU16, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
Definition at line 316 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Ensure that adding a 32-bit integer offset to a void pointer does not result in integer overflow.
Definition at line 1208 of file nvos_static_analysis.h.
References NV_UINTPTR_MAX, NVOS_COV_WHITELIST, and NVOS_MISRA.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that void * and unsigned integer add operation does not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 797 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU32VPTR, NV_UINTPTR_MAX, NVOS_COV_WHITELIST, NVOS_EXIT, and NVOS_MISRA.
|
inlinestatic |
CERT INT30-C: Ensure that uintptr_t and unsigned integer add do not result in lost or misinterpreted data.
Definition at line 1193 of file nvos_static_analysis.h.
References NV_UINTPTR_MAX.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that uintptr_t and unsigned integer add operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 780 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU32UPTR, NV_UINTPTR_MAX, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 747 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU32, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
Definition at line 348 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that uintptr_t unsigned integer add operation do not wrap Function calls NVOS_EXIT() on overflow.
Only use when overflow cannot happen by design.
Definition at line 870 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU64UPTR, NV_UINTPTR_MAX, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 763 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU64, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that uintptr_t and size_t add operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 817 of file nvos_static_analysis.h.
References ERR_INT30_C_ADDU32UPTR, NV_UINTPTR_MAX, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure casting signed integer to unsigned integer do not wrap.
Definition at line 517 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure casting signed integer to unsigned integer do not wrap.
Definition at line 501 of file nvos_static_analysis.h.
|
inlinestatic |
Casting functions to fix CERT INT31-C: Ensure integer conversions do not result in lost or misinterpreted data.
Definition at line 1058 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_S32TOU32, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1139 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_S32TOU64, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1148 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_S32TOU8, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1166 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_S64TOS32, max, min, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1130 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_S64TOU32, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1157 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_S64TOU64, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1094 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U32TOU8, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure casting unsigned integer to signed integer do not wrap.
Definition at line 485 of file nvos_static_analysis.h.
|
inlinestatic |
Definition at line 1067 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U32TOS32, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1076 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U32TOU16, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1085 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U32TOU8, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure casting unsigned long to unsigned integer do not wrap.
Definition at line 469 of file nvos_static_analysis.h.
|
inlinestatic |
Definition at line 1121 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U64TOS32, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1178 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U64TOS64, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure casting unsigned long to unsigned integer do not wrap.
Definition at line 427 of file nvos_static_analysis.h.
|
inlinestatic |
Definition at line 1112 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U64TOU32, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1103 of file nvos_static_analysis.h.
References ERR_INT31_C_CAST_U64TOU8, and NVOS_EXIT.
|
inlinestatic |
CERT INT32-C: Precondition test to ensure that signed integer division operation does not overflow or divide by zero.
Function calls NVOS_EXIT() on overflow or divide by zero. Only use when overflow/divide by zero cannot happen by design.
Definition at line 1034 of file nvos_static_analysis.h.
References ERR_INT32_C_DIVS32, and NVOS_EXIT.
|
inlinestatic |
Definition at line 1044 of file nvos_static_analysis.h.
References ERR_INT32_C_DIVS64, and NVOS_EXIT.
|
inlinestatic |
Increment uint32_t by one Precondition test to ensure value is within RANGE_MAX.
Definition at line 443 of file nvos_static_analysis.h.
|
inlinestatic |
Increment uint64_t by one Precondition test to ensure value is within RANGE_MAX.
Definition at line 456 of file nvos_static_analysis.h.
|
inlinestatic |
Precondition test to ensure that signed integer multiplication operation do not wrap.
| [in] | op1 | Input operand to be Multiplied |
| [in] | op2 | Value multiplied to input operand |
| [out] | result | Reference of variable to store product of two input operands |
Definition at line 562 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C Precondition test to ensure that signed integer multiplication operation do not wrap.
Definition at line 585 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that size_t multiplication operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 851 of file nvos_static_analysis.h.
References ERR_INT30_C_MULTSIZET, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
Definition at line 402 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
Definition at line 380 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 886 of file nvos_static_analysis.h.
References ERR_INT30_C_MULTU32, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
Definition at line 533 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 905 of file nvos_static_analysis.h.
References ERR_INT30_C_MULTU64, and NVOS_EXIT.
|
inlinestatic |
CERT INT31-C:
Convert Flags from Signed to Unsigned integer
Note:- NvConvertInt32toUint32() cannot be used for this purpose
Definition at line 1449 of file nvos_static_analysis.h.
References flag_converter::flag_int32, and flag_converter::flag_uint32.
|
inlinestatic |
CERT INT30-C: Readl and writel APIs to avoid CERT-C warnings.
CERT INT31-C:
Convert Flags from Unsigned to Signed integer
Note:- NvConvertUint32toInt32() cannot be used for this purpose
Definition at line 1433 of file nvos_static_analysis.h.
References flag_converter::flag_int32, and flag_converter::flag_uint32.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1361 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1343 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1327 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1311 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1279 of file nvos_static_analysis.h.
|
inlinestatic |
MISRA RULE 10.8 Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1253 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1263 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1295 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1238 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
Definition at line 1222 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT34-C:
Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand.
Definition at line 1466 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT34-C:
Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand.
Definition at line 1489 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT32-C: Precondition test to ensure that signed integer subtraction operation does not overflow.
Definition at line 653 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT32-C: Precondition test to ensure that signed integer subtraction operation does not overflow.
Function calls NVOS_EXIT() on overflow. Only use when overflow cannot happen by design.
Definition at line 1004 of file nvos_static_analysis.h.
References ERR_INT32_C_SUBS32, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C Precondition test to ensure that signed integer subtraction operation do not wrap.
Definition at line 688 of file nvos_static_analysis.h.
|
inlinestatic |
Definition at line 1015 of file nvos_static_analysis.h.
References ERR_INT32_C_SUBS64, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that size_t subtraction operation do not wrap.
Definition at line 708 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that size_t subtraction operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when underflow cannot happen by design.
Definition at line 958 of file nvos_static_analysis.h.
References ERR_INT30_C_SUBU64, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
Definition at line 636 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
Definition at line 620 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when underflow cannot happen by design.
Definition at line 924 of file nvos_static_analysis.h.
References ERR_INT30_C_SUBU32, and NVOS_EXIT.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
Definition at line 672 of file nvos_static_analysis.h.
|
inlinestatic |
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
Function calls NVOS_EXIT() on overflow. Only use when underflow cannot happen by design.
Definition at line 941 of file nvos_static_analysis.h.
References ERR_INT30_C_SUBU64, and NVOS_EXIT.