Hi all,
I have a general question about the code executed if MQX_CHECK_VALIDITY is set.
This is an example of _lwsem_post from MQX 4.2.2 :
_mqx_uint _lwsem_post
(
LWSEM_STRUCT_PTR sem_ptr
)
{ /* Body */
/* ...... */
#if MQX_CHECK_VALIDITY
if (sem_ptr->VALID != LWSEM_VALID)
{
_KLOGX2(KLOG_lwsem_post, MQX_INVALID_LWSEM);
return (MQX_INVALID_LWSEM);
} /* Endif */
#endif /* MQX_CHECK_VALIDITY */
/* ...... */
My question is:
Regards,
Alessandro.
Solved! Go to Solution.
Hi Alessandro,
Actually, this code is executed with interrupt disable, it is wrapped in the macro. Please check the macro _KLOGX2 defines.
#define _KLOGX2(fn,p1) _KLOG(_klog_log(KLOG_FUNCTION_EXIT, \
(_mqx_max_type)(fn), (_mqx_max_type)(p1), (_mqx_max_type)0, (_mqx_max_type)0, (_mqx_max_type)0);)
void _klog_log
(
_mqx_uint type,
_mqx_max_type p1,
_mqx_max_type p2,
_mqx_max_type p3,
_mqx_max_type p4,
_mqx_max_type p5
)
{ /* Body */
...
_INT_DISABLE(); | |
_lwlog_write(LOG_KERNEL_LOG_NUMBER, (_mqx_max_type)type, p1, p2, p3, p4, p5, | |
calling_pc); | |
_INT_ENABLE(); |
...
}
Have a great day,
Daniel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Alessandro,
Actually, this code is executed with interrupt disable, it is wrapped in the macro. Please check the macro _KLOGX2 defines.
#define _KLOGX2(fn,p1) _KLOG(_klog_log(KLOG_FUNCTION_EXIT, \
(_mqx_max_type)(fn), (_mqx_max_type)(p1), (_mqx_max_type)0, (_mqx_max_type)0, (_mqx_max_type)0);)
void _klog_log
(
_mqx_uint type,
_mqx_max_type p1,
_mqx_max_type p2,
_mqx_max_type p3,
_mqx_max_type p4,
_mqx_max_type p5
)
{ /* Body */
...
_INT_DISABLE(); | |
_lwlog_write(LOG_KERNEL_LOG_NUMBER, (_mqx_max_type)type, p1, p2, p3, p4, p5, | |
calling_pc); | |
_INT_ENABLE(); |
...
}
Have a great day,
Daniel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------