Skip to content

Commit 28a5820

Browse files
authored
Merge pull request #2549 from nasa/integration-candidate
cFE Integration candidate: Equuleus-rc1+dev11
2 parents 5a1034b + 5c84059 commit 28a5820

11 files changed

+525
-539
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Development Build: equuleus-rc1+dev131
4+
- add handle list operation routines
5+
- See <https://github.com/nasa/cFE/pull/2548>
6+
37
## Development Build: equuleus-rc1+dev127
48
- improve app dev guide
59
- consistent TIME values for TBL structures

modules/core_api/fsw/inc/cfe_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define CFE_VERSION_H
2727

2828
/* Development Build Macro Definitions */
29-
#define CFE_BUILD_NUMBER 127 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
29+
#define CFE_BUILD_NUMBER 131 /**< @brief Development: Number of development git commits since CFE_BUILD_BASELINE */
3030
#define CFE_BUILD_BASELINE "equuleus-rc1" /**< @brief Development: Reference git tag for build number */
3131
#define CFE_BUILD_DEV_CYCLE "equuleus-rc2" /**< @brief Development: Release name for current development cycle */
3232
#define CFE_BUILD_CODENAME "Equuleus" /**< @brief: Development: Code name for the current build */

modules/tbl/fsw/src/cfe_tbl_api.c

+23-29
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,8 @@ CFE_Status_t CFE_TBL_Share(CFE_TBL_Handle_t *TblHandlePtr, const char *TblName)
251251
AccessDescPtr->RegIndex = CFE_TBL_TxnRegId(&Txn);
252252
AccessDescPtr->UsedFlag = true;
253253

254-
AccessDescPtr->PrevLink = CFE_TBL_END_OF_LIST; /* We are the new head of the list */
255-
AccessDescPtr->NextLink = RegRecPtr->HeadOfAccessList;
256-
257-
/* Make sure the old head of the list now sees this as the head */
258-
CFE_TBL_Global.Handles[RegRecPtr->HeadOfAccessList].PrevLink = CFE_TBL_TxnHandle(&Txn);
259-
260-
/* Make sure the Registry Record see this as the head of the list */
261-
RegRecPtr->HeadOfAccessList = CFE_TBL_TxnHandle(&Txn);
254+
CFE_TBL_HandleLinkInit(&AccessDescPtr->Link);
255+
CFE_TBL_HandleListInsertLink(RegRecPtr, AccessDescPtr);
262256
}
263257

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

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

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

11281115
TblInfoPtr->NumUsers = NumAccessDescriptors;
11291116

@@ -1190,6 +1177,23 @@ CFE_Status_t CFE_TBL_DumpToBuffer(CFE_TBL_Handle_t TblHandle)
11901177
return Status;
11911178
}
11921179

1180+
/*----------------------------------------------------------------
1181+
*
1182+
* Local helper function, not invoked outside this unit
1183+
* Intended to be used with CFE_TBL_ForeachAccessDescriptor()
1184+
*
1185+
*-----------------------------------------------------------------*/
1186+
static void CFE_TBL_NotifyOtherAppHelper(CFE_TBL_AccessDescriptor_t *AccessDescPtr, void *Arg)
1187+
{
1188+
CFE_TBL_TxnState_t *Txn = Arg;
1189+
1190+
/* Only notify *OTHER* applications that the contents have changed */
1191+
if (!CFE_RESOURCEID_TEST_EQUAL(AccessDescPtr->AppId, CFE_TBL_TxnAppId(Txn)))
1192+
{
1193+
AccessDescPtr->Updated = true;
1194+
}
1195+
}
1196+
11931197
/*----------------------------------------------------------------
11941198
*
11951199
* Implemented per public API
@@ -1201,7 +1205,6 @@ CFE_Status_t CFE_TBL_Modified(CFE_TBL_Handle_t TblHandle)
12011205
CFE_TBL_TxnState_t Txn;
12021206
int32 Status;
12031207
CFE_TBL_RegistryRec_t *RegRecPtr = NULL;
1204-
CFE_TBL_Handle_t AccessIterator;
12051208
CFE_ES_AppId_t ThisAppId;
12061209
size_t FilenameLen;
12071210

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

1244-
AccessIterator = RegRecPtr->HeadOfAccessList;
1245-
while (AccessIterator != CFE_TBL_END_OF_LIST)
1246-
{
1247-
/* Only notify *OTHER* applications that the contents have changed */
1248-
if (!CFE_RESOURCEID_TEST_EQUAL(CFE_TBL_Global.Handles[AccessIterator].AppId, ThisAppId))
1249-
{
1250-
CFE_TBL_Global.Handles[AccessIterator].Updated = true;
1251-
}
1252-
1253-
AccessIterator = CFE_TBL_Global.Handles[AccessIterator].NextLink;
1254-
}
1247+
/* Only notify *OTHER* applications that the contents have changed */
1248+
CFE_TBL_ForeachAccessDescriptor(RegRecPtr, CFE_TBL_NotifyOtherAppHelper, &Txn);
12551249
}
12561250
else
12571251
{

0 commit comments

Comments
 (0)