Skip to content

Commit

Permalink
Merge pull request #33 from skliper/fix32-rm_psp_mem_use
Browse files Browse the repository at this point in the history
Fix #32, Remove CFE_PSP_MemSet use for addresses in RAM
  • Loading branch information
astrogeco authored Jun 1, 2022
2 parents 575a043 + 72305b3 commit b4f97a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions fsw/src/lc_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ int32 LC_AppInit(void)
/*
** Zero out the global data structures...
*/
CFE_PSP_MemSet(&LC_OperData, 0, sizeof(LC_OperData_t));
CFE_PSP_MemSet(&LC_AppData, 0, sizeof(LC_AppData_t));
memset(&LC_OperData, 0, sizeof(LC_OperData));
memset(&LC_AppData, 0, sizeof(LC_AppData));

/*
** Initialize event services
Expand Down
6 changes: 3 additions & 3 deletions fsw/src/lc_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ void LC_CreateHashTable(void)
}

/* Initialize hash table structures */
CFE_PSP_MemSet(LC_OperData.HashTable, 0, (LC_HASH_TABLE_ENTRIES * sizeof(LC_MessageList_t *)));
CFE_PSP_MemSet(LC_OperData.MessageLinks, 0, (LC_MAX_WATCHPOINTS * sizeof(LC_MessageList_t)));
CFE_PSP_MemSet(LC_OperData.WatchPtLinks, 0, (LC_MAX_WATCHPOINTS * sizeof(LC_WatchPtList_t)));
memset(LC_OperData.HashTable, 0, sizeof(LC_OperData.HashTable));
memset(LC_OperData.MessageLinks, 0, sizeof(LC_OperData.MessageLinks));
memset(LC_OperData.WatchPtLinks, 0, sizeof(LC_OperData.WatchPtLinks));

LC_OperData.MessageIDsCount = 0;
LC_OperData.WatchpointCount = 0;
Expand Down
4 changes: 2 additions & 2 deletions unit-test/lc_app_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ void LC_AppInit_Test_Nominal(void)
int32 Result;
char Message[125];

CFE_PSP_MemSet(&LC_OperData, 1, sizeof(LC_OperData_t));
CFE_PSP_MemSet(&LC_AppData, 1, sizeof(LC_AppData_t));
memset(&LC_OperData, 1, sizeof(LC_OperData));
memset(&LC_AppData, 1, sizeof(LC_AppData));

/* Set to prevent errors when initializing tables */
UT_SetDefaultReturnValue(UT_KEY(CFE_TBL_Load), CFE_SUCCESS);
Expand Down
12 changes: 6 additions & 6 deletions unit-test/utilities/lc_test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ void LC_Test_Setup(void)
/* initialize test environment to default state for every test */
UT_ResetState(0);

memset(&LC_AppData, 0, sizeof(LC_AppData_t));
memset(&LC_OperData, 0, sizeof(LC_OperData_t));
memset(&LC_AppData, 0, sizeof(LC_AppData));
memset(&LC_OperData, 0, sizeof(LC_OperData));

LC_OperData.WDTPtr = WDTable;
LC_OperData.ADTPtr = ADTable;
LC_OperData.WRTPtr = WRTable;
LC_OperData.ARTPtr = ARTable;

memset(LC_OperData.WDTPtr, 0, sizeof(LC_WDTEntry_t) * LC_MAX_WATCHPOINTS);
memset(LC_OperData.ADTPtr, 0, sizeof(LC_ADTEntry_t) * LC_MAX_ACTIONPOINTS);
memset(LC_OperData.WRTPtr, 0, sizeof(LC_WRTEntry_t) * LC_MAX_WATCHPOINTS);
memset(LC_OperData.ARTPtr, 0, sizeof(LC_ARTEntry_t) * LC_MAX_ACTIONPOINTS);
memset(&WDTable, 0, sizeof(WDTable));
memset(&ADTable, 0, sizeof(ADTable));
memset(&WRTable, 0, sizeof(WRTable));
memset(&ARTable, 0, sizeof(ARTable));

memset(context_CFE_EVS_SendEvent, 0, sizeof(context_CFE_EVS_SendEvent));
memset(&context_CFE_ES_WriteToSysLog, 0, sizeof(context_CFE_ES_WriteToSysLog));
Expand Down

0 comments on commit b4f97a9

Please sign in to comment.