Skip to content
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

Merged

Conversation

jphickey
Copy link
Contributor

@jphickey jphickey commented Oct 7, 2020

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.

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.
@jphickey jphickey force-pushed the fix-56-cds-mempool-consolidate branch from af4f72a to daf6c04 Compare October 7, 2020 01:17
@jphickey jphickey added the CCB:Ready Ready for discussion at the Configuration Control Board (CCB) label Oct 7, 2020
@skliper skliper requested review from a user and dmknutsen October 7, 2020 16:35
@astrogeco
Copy link
Contributor

CCB 2020-10-06 APPROVED

  • Maybe transform the sample_app table into a critical table for testing and demonstration
  • Might want to set up CI to do power-on and processor resets

@astrogeco astrogeco added IC-20201007 and removed CCB:Ready Ready for discussion at the Configuration Control Board (CCB) labels Oct 7, 2020
@astrogeco astrogeco changed the base branch from main to integration-candidate October 13, 2020 13:37
@astrogeco astrogeco merged commit 85469ce into nasa:integration-candidate Oct 13, 2020
astrogeco added a commit to nasa/cFS that referenced this pull request Oct 13, 2020
@jphickey jphickey deleted the fix-56-cds-mempool-consolidate branch October 13, 2020 21:07
Copy link

@ghost ghost left a 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 */
Copy link

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
Copy link

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()
Copy link

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'
Copy link

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()
Copy link

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 ()?

@skliper skliper added this to the 7.0.0 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate CDS and generic/ram mempool code into single implementation
3 participants