-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #56, Refactor CDS to use generic pool implementation #939
Fix #56, Refactor CDS to use generic pool implementation #939
Conversation
Rather than having a second pool implementation only for CDS, use the generic pool implementation. This also uses the abstract resource identifiers to identify CDS blocks, rather than a direct reference.
af4f72a
to
daf6c04
Compare
CCB 2020-10-06 APPROVED
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I like the consolidation into a single memory pool implementation.
CFE_ES_SysLogWrite_Unsync("CFE_ES_CDS_EarlyInit: Failed to create mutex with error %d\n", (int)Status); | ||
return CFE_STATUS_EXTERNAL_RESOURCE_FAIL; | ||
} | ||
|
||
/* Get CDS size from OS BSP */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth changing comment to "Get CFDS Size from PSP" ?
|
||
} /* End of CFE_ES_CDS_EarlyInit() */ | ||
|
||
/*******************************************************************/ | ||
/* | ||
* CFE_ES_LocateCDSBlockRecordByID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update function name in comment
|
||
/*******************************************************************/ | ||
/* | ||
* CFE_ES_CacheRead() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update function name in comment
@@ -559,16 +679,22 @@ void CFE_ES_FormCDSName(char *FullCDSName, const char *CDSName, CFE_ES_ResourceI | |||
** NOTE: For complete prolog information, see 'cfe_es_cds.h' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update function name in comment
@@ -639,24 +778,40 @@ int32 CFE_ES_FindCDSInRegistry(const char *CDSName) | |||
** NOTE: For complete prolog information, see 'cfe_es_cds.h' | |||
********************************************************************/ | |||
|
|||
int32 CFE_ES_FindFreeCDSRegistryEntry(void) | |||
CFE_ES_CDS_RegRec_t *CFE_ES_AllocateNewCDSRegistryEntry() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the function have (void) instead of ()?
Describe the contribution
Rather than having a second pool implementation only for CDS, use the generic pool implementation. This also uses the abstract resource identifiers to identify CDS blocks, rather than a direct reference.
Fixes #56
Testing performed
Build and sanity test CFE
Confirm all unit tests working
Also tested/Confirmed that the CFE TBL critical table registry is correctly restored when booting in a processor reset mode. In this case the data is successfully restored from CDS.
Expected behavior changes
No impact to behavior.
System(s) tested on
Ubuntu 20.04
Additional context
This consolidates and simplifies a bunch of code in the CDS access area.
Note that previously there was a separate mutex for the CDS pool and CDS registry. However almost all accesses needed both, because pool access and registry access go together. So this is simplified to one mutex now.
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.