Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
264 changes: 0 additions & 264 deletions fsw/inc/cs_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,268 +140,4 @@ typedef struct
char Name[OS_MAX_API_NAME]; /**< \brief name of the app */
} CS_Res_App_Table_Entry_t;

/**************************************************************************
**
** Function Prototypes
**
**************************************************************************/

/**
* \brief Validate EEPROM definition table
*
* \par Description
* This function is a callback to cFE Table Services that gets called
* when a validation is requested.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] TblPtr A pointer to the table to be validated
*
* \return Execution status see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copydoc CFE_SUCCESS
* \retval #CS_TABLE_ERROR \copydoc CS_TABLE_ERROR
*/
CFE_Status_t CS_ValidateEepromChecksumDefinitionTable(void *TblPtr);

/**
* \brief Validate Memory definition table
*
* \par Description
* This function is a callback to cFE Table Services that gets called
* when a validation is requested.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] TblPtr A pointer to the table to be validated
*
* \return Execution status see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copydoc CFE_SUCCESS
* \retval #CS_TABLE_ERROR \copydoc CS_TABLE_ERROR
*/
CFE_Status_t CS_ValidateMemoryChecksumDefinitionTable(void *TblPtr);

/**
* \brief Validate Tables definition table
*
* \par Description
* This function is a callback to cFE Table Services that gets called
* when a validation is requested.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] TblPtr A pointer to the table to be validated
*
* \return Execution status see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copydoc CFE_SUCCESS
* \retval #CS_TABLE_ERROR \copydoc CS_TABLE_ERROR
*/
CFE_Status_t CS_ValidateTablesChecksumDefinitionTable(void *TblPtr);

/**
* \brief Validate App definition table
*
* \par Description
* This function is a callback to cFE Table Services that gets called
* when a validation is requested.
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] TblPtr A pointer to the table to be validated
*
* \return Execution status see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copydoc CFE_SUCCESS
* \retval #CS_TABLE_ERROR \copydoc CS_TABLE_ERROR
*/
CFE_Status_t CS_ValidateAppChecksumDefinitionTable(void *TblPtr);

/**
* \brief Processes a new definition table for EEPROM or Memory tables
*
* \par Description
* Copies data from the definition table to the results table
* because the results table is where CS keeps all of its
* checksum data
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] DefinitionTblPtr A pointer to the definiton table
* (#CS_Def_EepromMemory_Table_Entry_t)
* that we are operating on
*
* \param [in] ResultsTblPtr A pointer to the result table
* (#CS_Res_EepromMemory_Table_Entry_t)
* to operate on
* \param [in] NumEntries The number of entries in the table
* \param [in] Table The specific table we are operating on
*/
void CS_ProcessNewEepromMemoryDefinitionTable(const CS_Def_EepromMemory_Table_Entry_t *DefinitionTblPtr,
const CS_Res_EepromMemory_Table_Entry_t *ResultsTblPtr,
const uint16 NumEntries, const uint16 Table);

/**
* \brief Processes a new definition table for the Tables table
*
* \par Description
* Copies data from the definition table to the results table
* because the results table is where CS keeps all of its
* checksum data
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] DefinitionTblPtr A pointer to the definiton table
* (#CS_Def_Tables_Table_Entry_t)
* that we are operating on
*
* \param [in] ResultsTblPtr A pointer to the result table
* (#CS_Res_Tables_Table_Entry_t)
* to operate on
*/
void CS_ProcessNewTablesDefinitionTable(const CS_Def_Tables_Table_Entry_t *DefinitionTblPtr,
const CS_Res_Tables_Table_Entry_t *ResultsTblPtr);

/**
* \brief Processes a new definition table for the App table
*
* \par Description
* Copies data from the definition table to the results table
* because the results table is where CS keeps all of its
* checksum data
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] DefinitionTblPtr A pointer to the definiton table
* (#CS_Def_App_Table_Entry_t)
* that we are operating on
*
* \param [in] ResultsTblPtr A pointer to the result table
* (#CS_Res_App_Table_Entry_t)
* to operate on
*/
void CS_ProcessNewAppDefinitionTable(const CS_Def_App_Table_Entry_t *DefinitionTblPtr,
const CS_Res_App_Table_Entry_t *ResultsTblPtr);

/**
* \brief Initializes the results and definition table on startup
*
* \par Description
* Completes the Table Services registration and table load for
* the definition table and the registration for the results table
*
* \par Assumptions, External Events, and Notes:
* This function is used on all four type of tables individally.
* Also, if the default table file is not found for the definitionm
* table, this function loads a 'blank' table from memory
*
* \param [in] DefinitionTableHandle A #CFE_TBL_Handle_t pointer
* that will get filled in with the
* table handle to the definition
* table
*
* \param [in] ResultsTableHandle A #CFE_TBL_Handle_t pointer
* that will get filled in with the
* table handle to the results
* table
*
* \param [in] DefinitionTblPtr A pointer to the definiton table
* that we are operating on, it
* will get assigned during this
* call
*
* \param [in] ResultsTblPtr A pointer to the result table
* to operate on , it will get
* assigned during this call
*
* \param [in] Table The specific table we are
* operating on
*
* \param [in] DefinitionTableName The name of the definition table
*
* \param [in] ResultsTableName The name of the results table
*
* \param [in] NumEntries The number of entries in the
* table
*
* \param [in] DefinitionTableFileName The name of the file to load the
* definition table from
*
* \param [in] DefaultDefTableAddress The address of the default
* definition table that we may
* have to load from memory if
* the file is absent
*
* \param [in] SizeofDefinitionTableEntry The sizeof an entry in the
* definition table
*
* \param [in] SizeofResultsTableEntry The size of an enrty in the
* results table
*
* \param [in] CallBackFunction A pointer to a function used to
* validate the definition table
*
* \param [out] * DefinitionTableHandle A #CFE_TBL_Handle_t pointer that
* will get filled in with the tbl
* handle to the definition table
*
* \param [out] * ResultsTableHandle A #CFE_TBL_Handle_t pointer that
* will get filled in with the tbl
* handle to the results table
*
* \param [out] * DefinitionTblPtr A pointer to the definiton table
* that we are operating on
*
* \param [in] * ResultsTblPtr A pointer to the result table
* to operate on , it will get
* be used to access the table
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
CFE_Status_t CS_TableInit(CFE_TBL_Handle_t *DefinitionTableHandle, CFE_TBL_Handle_t *ResultsTableHandle,
void *DefinitionTblPtr, void *ResultsTblPtr, const uint16 Table,
const char *DefinitionTableName, const char *ResultsTableName, const uint16 NumEntries,
const char *DefinitionTableFileName, const void *DefaultDefTableAddress,
const uint16 SizeofDefinitionTableEntry, const uint16 SizeofResultsTableEntry,
const CFE_TBL_CallbackFuncPtr_t CallBackFunction);

/**
* \brief Handles table updates for all CS tables
*
* \par Description
* Completes the handshake with Table Services that releases
* Addresses for the tables and checks for updates
*
* \par Assumptions, External Events, and Notes:
* None
*
* \param [in] DefinitionTblPtr A pointer to the definiton table
* that we are operating on
*
* \param [in] ResultsTblPtr A pointer to the result table
* to operate on
* \param [in] DefinitionTableHandle A table handle to the definition
* table
*
* \param [in] ResultsTableHandle A table handle to the results
* table
*
* \param [in] NumEntries The number of entries in the table
*
* \param [in] Table The specific table we are operating
* on
*
* \return Execution status, see \ref CFEReturnCodes
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
CFE_Status_t CS_HandleTableUpdate(void *DefinitionTblPtr, void *ResultsTblPtr,
const CFE_TBL_Handle_t DefinitionTableHandle,
const CFE_TBL_Handle_t ResultsTableHandle, const uint16 Table,
const uint16 NumEntries);

#endif
14 changes: 1 addition & 13 deletions fsw/src/cs_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "cs_perfids.h"
#include "cs_verify.h"
#include "cs_version.h"
#include "cs_table_processing.h"

/**************************************************************************
**
Expand All @@ -65,13 +66,6 @@
#define CS_CMD_PIPE_NAME_LEN 16
/**\}*/

/**
* \name CS Name of Table Size
* \{
*/
#define CS_TABLETYPE_NAME_SIZE 10
/**\}*/

/**
* \name CS Child Task Names
* \{
Expand Down Expand Up @@ -205,8 +199,6 @@ extern CS_AppData_t CS_AppData;
*/
void CS_AppMain(void);

#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)

/**
* \brief CFS Checksum (CS) Critical Data Store Update
*
Expand All @@ -218,8 +210,6 @@ void CS_AppMain(void);
*/
void CS_UpdateCDS(void);

#endif

/**
* \brief Initialize the Checksum CFS application
*
Expand Down Expand Up @@ -284,7 +274,6 @@ void CS_HousekeepingCmd(const CS_NoArgsCmd_t *CmdPtr);
*/
void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr);

#if (CS_PRESERVE_STATES_ON_PROCESSOR_RESET == true)
/**
* \brief Restore tables states from CDS if enabled
*
Expand All @@ -298,6 +287,5 @@ void CS_ProcessCmd(const CFE_SB_Buffer_t *BufPtr);
* \retval #CFE_SUCCESS \copybrief CFE_SUCCESS
*/
CFE_Status_t CS_CreateRestoreStatesFromCDS(void);
#endif

#endif
23 changes: 5 additions & 18 deletions fsw/src/cs_compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,7 @@ CFE_Status_t CS_ComputeApp(CS_Res_App_Table_Entry_t *ResultsEntry, uint32 *Compu
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void CS_RecomputeEepromMemoryChildTask(void)
{
uint32 NewChecksumValue = 0;
char TableType[CS_TABLETYPE_NAME_SIZE];
uint32 NewChecksumValue = 0;
CS_Res_EepromMemory_Table_Entry_t *ResultsEntry = NULL;
uint16 Table = 0;
uint16 EntryID = 0;
Expand All @@ -449,8 +448,6 @@ void CS_RecomputeEepromMemoryChildTask(void)
CFE_TBL_Handle_t DefTblHandle = CFE_TBL_BAD_TABLE_HANDLE;
CS_Res_Tables_Table_Entry_t * TablesTblResultEntry = NULL;

strncpy(TableType, "Undef Tbl", CS_TABLETYPE_NAME_SIZE); /* Initialize table type string */

Table = CS_AppData.ChildTaskTable;
EntryID = CS_AppData.ChildTaskEntryID;
ResultsEntry = CS_AppData.RecomputeEepromMemoryEntryPtr;
Expand Down Expand Up @@ -528,29 +525,19 @@ void CS_RecomputeEepromMemoryChildTask(void)
CFE_TBL_Modified(DefTblHandle);
}

/* send event message */

if (Table == CS_EEPROM_TABLE)
{
snprintf(TableType, CS_TABLETYPE_NAME_SIZE, "%s", "EEPROM");
}
if (Table == CS_MEMORY_TABLE)
{
snprintf(TableType, CS_TABLETYPE_NAME_SIZE, "%s", "Memory");
}
/* Update reported value in HK TLM, if applicable */
if (Table == CS_CFECORE)
{
snprintf(TableType, CS_TABLETYPE_NAME_SIZE, "%s", "cFE Core");
CS_AppData.HkPacket.Payload.CfeCoreBaseline = NewChecksumValue;
}
if (Table == CS_OSCORE)
{
snprintf(TableType, CS_TABLETYPE_NAME_SIZE, "%s", "OS");
CS_AppData.HkPacket.Payload.OSBaseline = NewChecksumValue;
}

/* send event message */
CFE_EVS_SendEvent(CS_RECOMPUTE_FINISH_EEPROM_MEMORY_INF_EID, CFE_EVS_EventType_INFORMATION,
"%s entry %d recompute finished. New baseline is 0X%08X", TableType, EntryID,
"%s entry %d recompute finished. New baseline is 0X%08X", CS_GetTableTypeAsString(Table), EntryID,
(unsigned int)NewChecksumValue);

CS_AppData.HkPacket.Payload.RecomputeInProgress = false;
Expand Down Expand Up @@ -814,7 +801,7 @@ void CS_OneShotChildTask(void)
(unsigned int)(CS_AppData.HkPacket.Payload.LastOneShotChecksum));

CS_AppData.HkPacket.Payload.OneShotInProgress = false;
CS_AppData.ChildTaskID = CFE_ES_TASKID_UNDEFINED;
CS_AppData.ChildTaskID = CFE_ES_TASKID_UNDEFINED;

CFE_ES_ExitChildTask();
}
Loading
Loading