Menu

#166 Dummy structures sizes mot match sizies of TCB_t and Queue_t when configSUPPORT_STATIC_ALLOCATION and configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES are TRUE

v1.0 (example)
closed-wont-fix
nobody
None
2
2018-04-23
2018-04-23
No

I found problem with few dummy structures (xSTATIC_LIST_ITEM, xSTATIC_LIST_ITEM and xSTATIC_LIST) in FreeRTOS.h file, when configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES and configSUPPORT_STATIC_ALLOCATION are TRUE. The size of the dummy structures are differnet from the real structures (TCB_t and Queue_t ).
I made my own fix, see the code below :

if( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )

struct xSTATIC_LIST_ITEM
{
TickType_t xDummy1;
void *pvDummy2[ 4 ];
};
typedef struct xSTATIC_LIST_ITEM StaticListItem_t;

/ See the comments above the struct xSTATIC_LIST_ITEM definition. /
struct xSTATIC_MINI_LIST_ITEM
{
TickType_t xDummy1;
void *pvDummy2[ 2 ];
};
typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;

/ See the comments above the struct xSTATIC_LIST_ITEM definition. /
typedef struct xSTATIC_LIST
{
UBaseType_t uxDummy1;
void *pvDummy2;
StaticMiniListItem_t xDummy3;
} StaticList_t;

else

struct xSTATIC_LIST_ITEM
{
TickType_t xDummyBeging;
TickType_t xDummy1;
void *pvDummy2[ 4 ];
TickType_t xDummyEnd;
};
typedef struct xSTATIC_LIST_ITEM StaticListItem_t;

struct xSTATIC_MINI_LIST_ITEM
{
TickType_t xDummyBeging;
TickType_t xDummy1;
void *pvDummy2[ 2 ];
};
typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;

typedef struct xSTATIC_LIST
{
TickType_t xDummyBeging;
UBaseType_t uxDummy1;
void *pvDummy2;
StaticMiniListItem_t xDummy3;
TickType_t xDummyEnd;
} StaticList_t;

endif

, But may be the better one is to define all placeholder stucturs as unions.

Discussion

  • Richard Barry

    Richard Barry - 2018-04-23
    • status: open --> closed-wont-fix
     
  • Richard Barry

    Richard Barry - 2018-04-23

    Thanks for taking the time to post this issue. Closed as it duplicate 153.

     

Log in to post a comment.

Auth0 Logo