Skip to content

Commit

Permalink
Fix #26, Use CFE_ES_MemAddress_t instead of cpuaddr in tables/tlm…
Browse files Browse the repository at this point in the history
…/cmd structs
  • Loading branch information
thnkslprpt committed Sep 5, 2023
1 parent d9c1034 commit e36d0e6
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 69 deletions.
81 changes: 43 additions & 38 deletions fsw/inc/cs_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,36 @@
*/
typedef struct
{
uint8 CmdCounter; /**< \brief CS Application Command Counter */
uint8 CmdErrCounter; /**< \brief CS Application Command Error Counter */
uint8 ChecksumState; /**< \brief CS Application global checksum state */
uint8 EepromCSState; /**< \brief CS EEPROM table checksum state */
uint8 MemoryCSState; /**< \brief CS Memory table checksum state */
uint8 AppCSState; /**< \brief CS App table checksum state */
uint8 TablesCSState; /**< \brief CS Tables table checksum state */
uint8 OSCSState; /**< \brief OS code segment checksum state */
uint8 CfeCoreCSState; /**< \brief cFE Core code segment checksum stat e*/
uint8 RecomputeInProgress; /**< \brief CS "Recompute In Progress" flag */
uint8 OneShotInProgress; /**< \brief CS "OneShot In Progress" flag */
uint8 Filler8; /**< \brief 8 bit padding */
uint16 EepromCSErrCounter; /**< \brief EEPROM miscompare counter */
uint16 MemoryCSErrCounter; /**< \brief Memory miscompare counter */
uint16 AppCSErrCounter; /**< \brief App miscompare counter */
uint16 TablesCSErrCounter; /**< \brief Tables miscompare counter */
uint16 CfeCoreCSErrCounter; /**< \brief cFE core miscompare counter */
uint16 OSCSErrCounter; /**< \brief OS code segment miscopmare counter */
uint16 CurrentCSTable; /**< \brief Current table being checksummed */
uint16 CurrentEntryInTable; /**< \brief Current entry ID in table being checksummed */
uint32 EepromBaseline; /**< \brief Baseline checksum for all of EEPROM */
uint32 OSBaseline; /**< \brief Baseline checksum for the OS code segment */
uint32 CfeCoreBaseline; /**< \brief Basline checksum for the cFE core */
cpuaddr LastOneShotAddress; /**< \brief Address used in last one shot checksum command */
uint32 LastOneShotSize; /**< \brief Size used in the last one shot checksum command */
uint32 LastOneShotMaxBytesPerCycle; /**< \brief Max bytes per cycle for last one shot checksum command */
uint32 LastOneShotChecksum; /**< \brief Checksum of the last one shot checksum command */
uint32 PassCounter; /**< \brief Number of times CS has passed through all of its tables */
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief cFE SB Tlm Msg Hdr */

uint8 CmdCounter; /**< \brief CS Application Command Counter */
uint8 CmdErrCounter; /**< \brief CS Application Command Error Counter */
uint8 ChecksumState; /**< \brief CS Application global checksum state */
uint8 EepromCSState; /**< \brief CS EEPROM table checksum state */
uint8 MemoryCSState; /**< \brief CS Memory table checksum state */
uint8 AppCSState; /**< \brief CS App table checksum state */
uint8 TablesCSState; /**< \brief CS Tables table checksum state */
uint8 OSCSState; /**< \brief OS code segment checksum state */
uint8 CfeCoreCSState; /**< \brief cFE Core code segment checksum stat e*/
uint8 RecomputeInProgress; /**< \brief CS "Recompute In Progress" flag */
uint8 OneShotInProgress; /**< \brief CS "OneShot In Progress" flag */
uint8 Filler8; /**< \brief 8 bit padding */
uint16 EepromCSErrCounter; /**< \brief EEPROM miscompare counter */
uint16 MemoryCSErrCounter; /**< \brief Memory miscompare counter */
uint16 AppCSErrCounter; /**< \brief App miscompare counter */
uint16 TablesCSErrCounter; /**< \brief Tables miscompare counter */
uint16 CfeCoreCSErrCounter; /**< \brief cFE core miscompare counter */
uint16 OSCSErrCounter; /**< \brief OS code segment miscopmare counter */
uint16 CurrentCSTable; /**< \brief Current table being checksummed */
uint16 CurrentEntryInTable; /**< \brief Current entry ID in table being checksummed */
uint32 EepromBaseline; /**< \brief Baseline checksum for all of EEPROM */
uint32 OSBaseline; /**< \brief Baseline checksum for the OS code segment */
uint32 CfeCoreBaseline; /**< \brief Basline checksum for the cFE core */
CFE_ES_MemAddress_t LastOneShotAddress; /**< \brief Address used in last one shot checksum command */
uint32 LastOneShotSize; /**< \brief Size used in the last one shot checksum command */
uint32 LastOneShotMaxBytesPerCycle; /**< \brief Max bytes per cycle for last one shot checksum command */
uint32 LastOneShotChecksum; /**< \brief Checksum of the last one shot checksum command */
uint32 PassCounter; /**< \brief Number of times CS has passed through all of its tables */
} CS_HkPacket_Payload_t;

/**
Expand All @@ -73,7 +75,7 @@ typedef struct
typedef struct
{
CFE_MSG_TelemetryHeader_t TlmHeader; /**< \brief cFE SB Tlm Msg Hdr */
CS_HkPacket_Payload_t Payload; /**< \brief CS HK Payload */
CS_HkPacket_Payload_t Payload; /**< \brief CS HK Payload */
} CS_HkPacket_t;

/**\}*/
Expand All @@ -88,7 +90,7 @@ typedef struct
*/
typedef struct
{
cpuaddr Address; /**< \brief Address to get the ID for */
CFE_ES_MemAddress_t Address; /**< \brief Address to get the ID for */
} CS_GetEntryIDCmd_Payload_t;

/**
Expand Down Expand Up @@ -120,10 +122,10 @@ typedef struct
*/
typedef struct
{
cpuaddr Address; /**< \brief Address to start checksum */
uint32 Size; /**< \brief Number of bytes to checksum */
uint32 MaxBytesPerCycle; /**< \brief Max Number of bytes to compute per cycle. Value of Zero to use platform config
value */
CFE_ES_MemAddress_t Address; /**< \brief Address to start checksum */
uint32 Size; /**< \brief Number of bytes to checksum */
uint32 MaxBytesPerCycle; /**< \brief Max Number of bytes to compute per cycle. Value of Zero to use platform config
value */
} CS_OneShotCmd_Payload_t;

/**
Expand All @@ -148,7 +150,7 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader;
CS_GetEntryIDCmd_Payload_t Payload;
CFE_ES_MemAddress_t Address; /**< \brief Address to get the ID for */
} CS_GetEntryIDCmd_t;

/**
Expand All @@ -160,7 +162,7 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader;
CS_EntryCmd_Payload_t Payload;
CS_EntryCmd_Payload_t Payload;
} CS_EntryCmd_t;

/**
Expand All @@ -171,7 +173,7 @@ typedef struct
*/
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader;
CFE_MSG_CommandHeader_t CmdHeader;
CS_TableNameCmd_Payload_t Payload;
} CS_TableNameCmd_t;

Expand All @@ -195,7 +197,10 @@ typedef struct
typedef struct
{
CFE_MSG_CommandHeader_t CmdHeader;
CS_OneShotCmd_Payload_t Payload;
CFE_ES_MemAddress_t Address; /**< \brief Address to start checksum */
uint32 Size; /**< \brief Number of bytes to checksum */
uint32 MaxBytesPerCycle; /**< \brief Max Number of bytes to compute per cycle. Value of Zero to use platform config
value */
} CS_OneShotCmd_t;

/**\}*/
Expand Down
61 changes: 30 additions & 31 deletions fsw/inc/cs_tbldefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,24 @@
*/
typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 Filler16; /** <\brief Padding */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
CFE_ES_MemAddress_t StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 Filler16; /** <\brief Padding */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
} CS_Def_EepromMemory_Table_Entry_t;

/**
* \brief Data structure for the Eeporom or Memory results table
*/
typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
uint32 Filler32; /**< \brief Padding */
CFE_ES_MemAddress_t StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
} CS_Res_EepromMemory_Table_Entry_t;

/**
Expand All @@ -112,32 +111,32 @@ typedef struct
*/
typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
CFE_TBL_Handle_t TblHandle; /**< \brief handle recieved from CFE_TBL */
bool IsCSOwner; /**< \brief Is CS the original owner of this table */
bool Filler8; /**< \brief Padding */
char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief name of the table */
CFE_ES_MemAddress_t StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
CFE_TBL_Handle_t TblHandle; /**< \brief handle recieved from CFE_TBL */
bool IsCSOwner; /**< \brief Is CS the original owner of this table */
bool Filler8; /**< \brief Padding */
char Name[CFE_TBL_MAX_FULL_NAME_LEN]; /**< \brief name of the table */
} CS_Res_Tables_Table_Entry_t;

/**
* \brief Data structure for the app result table
*/
typedef struct
{
cpuaddr StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
char Name[OS_MAX_API_NAME]; /**< \brief name of the app */
CFE_ES_MemAddress_t StartAddress; /**< \brief The Start address to Checksum */
uint16 State; /**< \brief Uses the CS_STATE_... defines from above */
uint16 ComputedYet; /**< \brief Have we computed an Integrity value yet */
uint32 NumBytesToChecksum; /**< \brief The number of Bytes to Checksum */
uint32 ComparisonValue; /**< \brief The Memory Integrity Value */
uint32 ByteOffset; /**< \brief Where a previous unfinished calc left off */
uint32 TempChecksumValue; /**< \brief The unfinished caluculation */
char Name[OS_MAX_API_NAME]; /**< \brief name of the app */
} CS_Res_App_Table_Entry_t;

/**************************************************************************
Expand Down

0 comments on commit e36d0e6

Please sign in to comment.