fix a bug in the kernel obj verify function
This commit is contained in:
@@ -23,9 +23,7 @@ __CDECLS_BEGIN
|
|||||||
#if TOS_CFG_BARRIER_EN > 0
|
#if TOS_CFG_BARRIER_EN > 0
|
||||||
|
|
||||||
typedef struct k_barrier_st {
|
typedef struct k_barrier_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
pend_obj_t pend_obj;
|
pend_obj_t pend_obj;
|
||||||
k_barrier_cnt_t count;
|
k_barrier_cnt_t count;
|
||||||
|
@@ -21,9 +21,7 @@
|
|||||||
typedef uint32_t k_bmtbl_t;
|
typedef uint32_t k_bmtbl_t;
|
||||||
|
|
||||||
typedef struct k_bitmap_st {
|
typedef struct k_bitmap_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
uint32_t bit_ndx_max;
|
uint32_t bit_ndx_max;
|
||||||
uint32_t bit_max;
|
uint32_t bit_max;
|
||||||
|
@@ -25,9 +25,7 @@ __CDECLS_BEGIN
|
|||||||
typedef uint16_t completion_done_t;
|
typedef uint16_t completion_done_t;
|
||||||
|
|
||||||
typedef struct k_completion_st {
|
typedef struct k_completion_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
pend_obj_t pend_obj;
|
pend_obj_t pend_obj;
|
||||||
completion_done_t done;
|
completion_done_t done;
|
||||||
|
@@ -22,9 +22,7 @@ __CDECLS_BEGIN
|
|||||||
|
|
||||||
#if TOS_CFG_COUNTDOWNLATCH_EN > 0
|
#if TOS_CFG_COUNTDOWNLATCH_EN > 0
|
||||||
typedef struct k_countdownlatch_st {
|
typedef struct k_countdownlatch_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
pend_obj_t pend_obj;
|
pend_obj_t pend_obj;
|
||||||
k_countdownlatch_cnt_t count;
|
k_countdownlatch_cnt_t count;
|
||||||
|
@@ -43,9 +43,7 @@ typedef enum opt_event_post_en {
|
|||||||
} opt_event_post_t;
|
} opt_event_post_t;
|
||||||
|
|
||||||
typedef struct k_event_st {
|
typedef struct k_event_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
pend_obj_t pend_obj;
|
pend_obj_t pend_obj;
|
||||||
k_event_flag_t flag;
|
k_event_flag_t flag;
|
||||||
@@ -83,7 +81,7 @@ __API__ k_err_t tos_event_destroy(k_event_t *event);
|
|||||||
* pend an event.
|
* pend an event.
|
||||||
*
|
*
|
||||||
* @attention if opt is TOS_OPT_EVENT_PEND_ANY, any of the flag_expect is set is ok;
|
* @attention if opt is TOS_OPT_EVENT_PEND_ANY, any of the flag_expect is set is ok;
|
||||||
* if opt is TOS_OPT_EVENT_PEND_ALL<4C><4C> must all the flag_expect is set is ok.
|
* if opt is TOS_OPT_EVENT_PEND_ALL<4C><4C> must all the flag_expect is set is ok.
|
||||||
*
|
*
|
||||||
* @param[in] event pointer to the handler of the event.
|
* @param[in] event pointer to the handler of the event.
|
||||||
* @param[in] flag_expect the flag we expect from the event.
|
* @param[in] flag_expect the flag we expect from the event.
|
||||||
|
@@ -24,9 +24,7 @@ __CDECLS_BEGIN
|
|||||||
#define K_MMBLK_ALIGN_MASK (sizeof(void *) - 1u)
|
#define K_MMBLK_ALIGN_MASK (sizeof(void *) - 1u)
|
||||||
|
|
||||||
typedef struct k_mmblk_pool_st {
|
typedef struct k_mmblk_pool_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
void *pool_start;
|
void *pool_start;
|
||||||
void *free_list;
|
void *free_list;
|
||||||
|
@@ -23,9 +23,7 @@ __CDECLS_BEGIN
|
|||||||
#if TOS_CFG_MUTEX_EN > 0u
|
#if TOS_CFG_MUTEX_EN > 0u
|
||||||
|
|
||||||
typedef struct k_mutex_st {
|
typedef struct k_mutex_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
pend_obj_t pend_obj;
|
pend_obj_t pend_obj;
|
||||||
k_nesting_t pend_nesting;
|
k_nesting_t pend_nesting;
|
||||||
|
@@ -25,9 +25,7 @@ __CDECLS_BEGIN
|
|||||||
typedef uint16_t rw_cnt_t;
|
typedef uint16_t rw_cnt_t;
|
||||||
|
|
||||||
typedef struct k_rwlock_st {
|
typedef struct k_rwlock_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
k_mutex_t lock;
|
k_mutex_t lock;
|
||||||
k_sem_t signal;
|
k_sem_t signal;
|
||||||
|
@@ -23,9 +23,7 @@ __CDECLS_BEGIN
|
|||||||
#if TOS_CFG_SEM_EN > 0u
|
#if TOS_CFG_SEM_EN > 0u
|
||||||
|
|
||||||
typedef struct k_sem_st {
|
typedef struct k_sem_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
pend_obj_t pend_obj;
|
pend_obj_t pend_obj;
|
||||||
k_sem_cnt_t count;
|
k_sem_cnt_t count;
|
||||||
|
@@ -21,9 +21,7 @@
|
|||||||
__CDECLS_BEGIN
|
__CDECLS_BEGIN
|
||||||
|
|
||||||
typedef struct k_stopwatch_st {
|
typedef struct k_stopwatch_st {
|
||||||
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
|
||||||
knl_obj_t knl_obj;
|
knl_obj_t knl_obj;
|
||||||
#endif
|
|
||||||
|
|
||||||
k_tick_t until;
|
k_tick_t until;
|
||||||
} k_stopwatch_t;
|
} k_stopwatch_t;
|
||||||
|
@@ -109,8 +109,10 @@ TEST test_tos_timer_stop(void)
|
|||||||
err = tos_timer_stop(K_NULL);
|
err = tos_timer_stop(K_NULL);
|
||||||
ASSERT_EQ(err, K_ERR_OBJ_PTR_NULL);
|
ASSERT_EQ(err, K_ERR_OBJ_PTR_NULL);
|
||||||
|
|
||||||
|
#if TOS_CFG_OBJECT_VERIFY_EN > 0u
|
||||||
err = tos_timer_stop(&test_timer_00);
|
err = tos_timer_stop(&test_timer_00);
|
||||||
ASSERT_EQ(err, K_ERR_OBJ_INVALID);
|
ASSERT_EQ(err, K_ERR_OBJ_INVALID);
|
||||||
|
#endif
|
||||||
|
|
||||||
err = tos_timer_create(&test_timer_00, (k_tick_t)500u, (k_tick_t)0u,
|
err = tos_timer_create(&test_timer_00, (k_tick_t)500u, (k_tick_t)0u,
|
||||||
test_timer_call_back_dummy, K_NULL,
|
test_timer_call_back_dummy, K_NULL,
|
||||||
|
Reference in New Issue
Block a user