Provides support for assertions and logging failure data.
◆ MMOSAL_ASSERT
| #define MMOSAL_ASSERT |
( |
|
expr | ) |
|
Value: do { \
if (!(expr)) { \
MMOSAL_LOG_FAILURE_INFO(0); \
mmosal_impl_assert(); \
while (1) \
{} \
} \
} while (0)
Assert that the given expression evaluates to true and abort execution if not.
- Parameters
-
| expr | Expression to evaluation. If it evaluates to false then the assertion handler will be triggered. |
Definition at line 927 of file mmosal.h.
◆ MMOSAL_ASSERT_LOG_DATA
| #define MMOSAL_ASSERT_LOG_DATA |
( |
|
expr, |
|
|
|
... |
|
) |
| |
Value: do { \
if (!(expr)) { \
MMOSAL_LOG_FAILURE_INFO(__VA_ARGS__); \
mmosal_impl_assert(); \
while (1) \
{} \
} \
} while (0)
Assert that the given expression evaluates to true and abort execution if not.
- Parameters
-
| expr | Expression to evaluation. If it evaluates to false then the assertion handler will be triggered. |
| ... | Up to 4 32-bit unsigned integers to log. |
Definition at line 946 of file mmosal.h.
◆ MMOSAL_DEV_ASSERT
| #define MMOSAL_DEV_ASSERT |
( |
|
x | ) |
((void)(x)) |
Assertions that are only enabled for debug builds.
Definition at line 971 of file mmosal.h.
◆ MMOSAL_DEV_ASSERT_LOG_DATA
| #define MMOSAL_DEV_ASSERT_LOG_DATA |
( |
|
x, |
|
|
|
... |
|
) |
| ((void)(x)) |
Assertions that are only enabled for debug builds (with support for up to 4 uint32_t's to be logged).
Definition at line 974 of file mmosal.h.
◆ MMOSAL_FILEID
File identifier: if not provided by compiler then define to zero.
Definition at line 856 of file mmosal.h.
◆ MMOSAL_LOG_FAILURE_INFO
| #define MMOSAL_LOG_FAILURE_INFO |
( |
|
... | ) |
|
Value: do { \
void *pc; \
.
lr = (uint32_t)MMPORT_GET_LR(), \
.line = __LINE__, \
.platform_info = { __VA_ARGS__ }, \
}; \
MMPORT_GET_PC(pc); \
info.pc = (uint32_t)pc; \
mmosal_log_failure_info(&info); \
} while (0)
#define MMOSAL_FILEID
File identifier: if not provided by compiler then define to zero.
Data structure used to store information about a failure that can be preserved across reset.
uint32_t lr
Content of the LR register at assertion.
Initialize a mmosal_failure_info struct based on current state and invoke mmosal_log_failure_info().
Definition at line 897 of file mmosal.h.
◆ MMOSAL_MAX_FAILURE_RECORDS
| #define MMOSAL_MAX_FAILURE_RECORDS 4 |
Maximum number of failure records to buffer (must be a power of 2).
Defaults to 4 if no platform-specific definition exists.
Definition at line 864 of file mmosal.h.
◆ mmosal_impl_assert()
| void mmosal_impl_assert |
( |
void |
| ) |
|
◆ mmosal_log_failure_info()
Log failure information in a way that it is preserved across reboots so that it can be available for postmortem analysis.
- Parameters
-
| info | Failure information to log. |
Definition at line 114 of file mmosal_shim_bootloader.c.