Skip to content

Commit

Permalink
Merge pull request #2549 from nasa/integration-candidate
Browse files Browse the repository at this point in the history
cFE Integration candidate: Equuleus-rc1+dev11
  • Loading branch information
dzbaker authored Apr 16, 2024
2 parents 5a1034b + 5c84059 commit 28a5820
Show file tree
Hide file tree
Showing 11 changed files with 525 additions and 539 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Development Build: equuleus-rc1+dev131
- add handle list operation routines
- See <https://github.com/nasa/cFE/pull/2548>

## Development Build: equuleus-rc1+dev127
- improve app dev guide
- consistent TIME values for TBL structures
Expand Down
2 changes: 1 addition & 1 deletion modules/core_api/fsw/inc/cfe_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#define CFE_VERSION_H

/* Development Build Macro Definitions */
#define CFE_BUILD_NUMBER 127 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_NUMBER 131 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
#define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */
#define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
#define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */
Expand Down
52 changes: 23 additions & 29 deletions modules/tbl/fsw/src/cfe_tbl_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,8 @@ CFE_Status_t CFE_TBL_Share(CFE_TBL_Handle_t *TblHandlePtr, const char *TblName)
AccessDescPtr->RegIndex = CFE_TBL_TxnRegId(&Txn);
AccessDescPtr->UsedFlag = true;

AccessDescPtr->PrevLink = CFE_TBL_END_OF_LIST; /* We are the new head of the list */
AccessDescPtr->NextLink = RegRecPtr->HeadOfAccessList;

/* Make sure the old head of the list now sees this as the head */
CFE_TBL_Global.Handles[RegRecPtr->HeadOfAccessList].PrevLink = CFE_TBL_TxnHandle(&Txn);

/* Make sure the Registry Record see this as the head of the list */
RegRecPtr->HeadOfAccessList = CFE_TBL_TxnHandle(&Txn);
CFE_TBL_HandleLinkInit(&AccessDescPtr->Link);
CFE_TBL_HandleListInsertLink(RegRecPtr, AccessDescPtr);
}

CFE_TBL_TxnFinish(&Txn);
Expand Down Expand Up @@ -647,7 +641,7 @@ CFE_Status_t CFE_TBL_Update(CFE_TBL_Handle_t TblHandle)
/*
* Note that (Status < 0) specifically matches ERROR, not WARNING codes. The CFE_TBL_UpdateInternal() function
* currently only produces two possible codes (aside from CFE_SUCCESS) and both of these are defined as
* warnings, not errors. Therefore, its impossible to reach this code with RegRegPtr != NULL.
* warnings, not errors. Therefore, its impossible to reach this code with RegRecPtr != NULL.
*/
CFE_EVS_SendEventWithAppID(CFE_TBL_UPDATE_ERR_EID, CFE_EVS_EventType_ERROR, CFE_TBL_Global.TableTaskAppId,
"%s Failed to update table, Status=0x%08X", AppName, (unsigned int)Status);
Expand Down Expand Up @@ -1088,7 +1082,6 @@ CFE_Status_t CFE_TBL_GetInfo(CFE_TBL_Info_t *TblInfoPtr, const char *TblName)
int32 Status = CFE_SUCCESS;
int32 NumAccessDescriptors = 0;
CFE_TBL_RegistryRec_t *RegRecPtr;
CFE_TBL_Handle_t HandleIterator;

if (TblInfoPtr == NULL || TblName == NULL)
{
Expand Down Expand Up @@ -1117,13 +1110,7 @@ CFE_Status_t CFE_TBL_GetInfo(CFE_TBL_Info_t *TblInfoPtr, const char *TblName)
strncpy(TblInfoPtr->LastFileLoaded, RegRecPtr->LastFileLoaded, sizeof(TblInfoPtr->LastFileLoaded) - 1);
TblInfoPtr->LastFileLoaded[sizeof(TblInfoPtr->LastFileLoaded) - 1] = 0;

/* Count the number of Access Descriptors to determine the number of users */
HandleIterator = RegRecPtr->HeadOfAccessList;
while (HandleIterator != CFE_TBL_END_OF_LIST)
{
NumAccessDescriptors++;
HandleIterator = CFE_TBL_Global.Handles[HandleIterator].NextLink;
}
CFE_TBL_ForeachAccessDescriptor(RegRecPtr, CFE_TBL_CountAccessDescHelper, &NumAccessDescriptors);

TblInfoPtr->NumUsers = NumAccessDescriptors;

Expand Down Expand Up @@ -1190,6 +1177,23 @@ CFE_Status_t CFE_TBL_DumpToBuffer(CFE_TBL_Handle_t TblHandle)
return Status;
}

/*----------------------------------------------------------------
*
* Local helper function, not invoked outside this unit
* Intended to be used with CFE_TBL_ForeachAccessDescriptor()
*
*-----------------------------------------------------------------*/
static void CFE_TBL_NotifyOtherAppHelper(CFE_TBL_AccessDescriptor_t *AccessDescPtr, void *Arg)
{
CFE_TBL_TxnState_t *Txn = Arg;

/* Only notify *OTHER* applications that the contents have changed */
if (!CFE_RESOURCEID_TEST_EQUAL(AccessDescPtr->AppId, CFE_TBL_TxnAppId(Txn)))
{
AccessDescPtr->Updated = true;
}
}

/*----------------------------------------------------------------
*
* Implemented per public API
Expand All @@ -1201,7 +1205,6 @@ CFE_Status_t CFE_TBL_Modified(CFE_TBL_Handle_t TblHandle)
CFE_TBL_TxnState_t Txn;
int32 Status;
CFE_TBL_RegistryRec_t *RegRecPtr = NULL;
CFE_TBL_Handle_t AccessIterator;
CFE_ES_AppId_t ThisAppId;
size_t FilenameLen;

Expand Down Expand Up @@ -1241,17 +1244,8 @@ CFE_Status_t CFE_TBL_Modified(CFE_TBL_Handle_t TblHandle)
strncpy(&RegRecPtr->LastFileLoaded[sizeof(RegRecPtr->LastFileLoaded) - 4], "(*)", 4);
}

AccessIterator = RegRecPtr->HeadOfAccessList;
while (AccessIterator != CFE_TBL_END_OF_LIST)
{
/* Only notify *OTHER* applications that the contents have changed */
if (!CFE_RESOURCEID_TEST_EQUAL(CFE_TBL_Global.Handles[AccessIterator].AppId, ThisAppId))
{
CFE_TBL_Global.Handles[AccessIterator].Updated = true;
}

AccessIterator = CFE_TBL_Global.Handles[AccessIterator].NextLink;
}
/* Only notify *OTHER* applications that the contents have changed */
CFE_TBL_ForeachAccessDescriptor(RegRecPtr, CFE_TBL_NotifyOtherAppHelper, &Txn);
}
else
{
Expand Down
Loading

0 comments on commit 28a5820

Please sign in to comment.