From 9b4732f56c7d222c9526443bd3efc83cf2ac7e73 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 10 Feb 2021 15:46:35 -0500 Subject: [PATCH 01/27] Fix #1164, use FS file name parser for commands For commands containing file names, replace the call to CFE_SB_MessageStringGet() - which is just a basic copy - to the new filename-aware function CFE_FS_ParseInputFileName(). This means that the default pathname/extension logic is applied here too and only a "basename" is strictly necessary, although if a full/absolute path is given, it will be used as is. --- modules/es/fsw/src/cfe_es_perf.c | 32 ++-- modules/es/fsw/src/cfe_es_task.c | 189 ++++++++++++++++-------- modules/es/ut-coverage/es_UT.c | 53 ++++++- modules/evs/fsw/src/cfe_evs_log.c | 32 ++-- modules/evs/fsw/src/cfe_evs_task.c | 31 ++-- modules/evs/ut-coverage/evs_UT.c | 14 ++ modules/sb/fsw/src/cfe_sb_task.c | 55 +++++-- modules/sb/ut-coverage/sb_UT.c | 25 ++++ modules/tbl/fsw/src/cfe_tbl_task_cmds.c | 36 +++-- modules/tbl/ut-coverage/tbl_UT.c | 6 + 10 files changed, 352 insertions(+), 121 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_perf.c b/modules/es/fsw/src/cfe_es_perf.c index 76935fa56..d921a4f1a 100644 --- a/modules/es/fsw/src/cfe_es_perf.c +++ b/modules/es/fsw/src/cfe_es_perf.c @@ -203,6 +203,7 @@ int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data) { const CFE_ES_StopPerfCmd_Payload_t *CmdPtr = &data->Payload; CFE_ES_PerfDumpGlobal_t * PerfDumpState = &CFE_ES_TaskData.BackgroundPerfDumpState; + int32 Status; /* Ensure there is no file write in progress before proceeding */ /* note - also need to check the PendingState here, in case this command @@ -213,19 +214,30 @@ int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data) Perf->MetaData.State = CFE_ES_PERF_IDLE; /* Copy out the string, using default if unspecified */ - CFE_SB_MessageStringGet(PerfDumpState->DataFileName, CmdPtr->DataFileName, - CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME, sizeof(PerfDumpState->DataFileName), - sizeof(CmdPtr->DataFileName)); + Status = CFE_FS_ParseInputFileNameEx(PerfDumpState->DataFileName, CmdPtr->DataFileName, + sizeof(PerfDumpState->DataFileName), sizeof(CmdPtr->DataFileName), + CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); - PerfDumpState->PendingState = CFE_ES_PerfDumpState_INIT; - CFE_ES_BackgroundWakeup(); + if (Status == CFE_SUCCESS) + { + PerfDumpState->PendingState = CFE_ES_PerfDumpState_INIT; + CFE_ES_BackgroundWakeup(); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_TaskData.CommandCounter++; - CFE_EVS_SendEvent(CFE_ES_PERF_STOPCMD_EID, CFE_EVS_EventType_DEBUG, - "Perf Stop Cmd Rcvd, will write %d entries.%dmS dly every %d entries", - (int)Perf->MetaData.DataCount, (int)CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY, - (int)CFE_PLATFORM_ES_PERF_ENTRIES_BTWN_DLYS); + CFE_EVS_SendEvent(CFE_ES_PERF_STOPCMD_EID, CFE_EVS_EventType_DEBUG, + "Perf Stop Cmd Rcvd, will write %d entries.%dmS dly every %d entries", + (int)Perf->MetaData.DataCount, (int)CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY, + (int)CFE_PLATFORM_ES_PERF_ENTRIES_BTWN_DLYS); + } + else + { + CFE_ES_TaskData.CommandErrorCounter++; + CFE_EVS_SendEvent(CFE_ES_PERF_LOG_ERR_EID, CFE_EVS_EventType_ERROR, "Error parsing filename, RC = %d", + (int)Status); + } } /* if data to write == 0 */ else diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index b9154e9a2..060627ada 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -906,15 +906,16 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data) const CFE_ES_StartAppCmd_Payload_t *cmd = &data->Payload; CFE_ES_AppId_t AppID; int32 Result; - int32 FilenameLen; int32 AppEntryLen; int32 AppNameLen; char LocalAppName[OS_MAX_API_NAME]; CFE_ES_AppStartParams_t StartParams; /* Create local copies of all input strings and ensure null termination */ - FilenameLen = CFE_SB_MessageStringGet(StartParams.BasicInfo.FileName, cmd->AppFileName, NULL, - sizeof(StartParams.BasicInfo.FileName), sizeof(cmd->AppFileName)); + Result = CFE_FS_ParseInputFileNameEx(StartParams.BasicInfo.FileName, cmd->AppFileName, + sizeof(StartParams.BasicInfo.FileName), sizeof(cmd->AppFileName), NULL, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_DYNAMIC_MODULE), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_DYNAMIC_MODULE)); AppEntryLen = CFE_SB_MessageStringGet(StartParams.BasicInfo.InitSymbolName, cmd->AppEntryPoint, NULL, sizeof(StartParams.BasicInfo.InitSymbolName), sizeof(cmd->AppEntryPoint)); @@ -925,11 +926,11 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data) /* ** Verify command parameters */ - if (FilenameLen < 4) + if (Result != CFE_SUCCESS) { CFE_ES_TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_INVALID_FILENAME_ERR_EID, CFE_EVS_EventType_ERROR, - "CFE_ES_StartAppCmd: invalid filename: %s", StartParams.BasicInfo.FileName); + "CFE_ES_StartAppCmd: invalid filename, status=%lx", (unsigned long)Result); } else if (AppEntryLen <= 0) { @@ -1108,15 +1109,22 @@ int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadAppCmd_t *data) CFE_ES_AppId_t AppID; int32 Result; - CFE_SB_MessageStringGet(LocalFileName, (char *)cmd->AppFileName, NULL, sizeof(LocalFileName), - sizeof(cmd->AppFileName)); CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, sizeof(LocalApp), sizeof(cmd->Application)); Result = CFE_ES_GetAppIDByName(&AppID, LocalApp); if (Result == CFE_SUCCESS) { - Result = CFE_ES_ReloadApp(AppID, LocalFileName); + /* Read input string as a file name for dynamic module */ + Result = CFE_FS_ParseInputFileNameEx(LocalFileName, cmd->AppFileName, sizeof(LocalFileName), + sizeof(cmd->AppFileName), NULL, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_DYNAMIC_MODULE), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_DYNAMIC_MODULE)); + + if (Result == CFE_SUCCESS) + { + Result = CFE_ES_ReloadApp(AppID, LocalFileName); + } /* ** Send appropriate event message. @@ -1231,12 +1239,6 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) CFE_ES_AppRecord_t * AppRecPtr; CFE_ES_LibRecord_t * LibRecPtr; - /* - ** Copy the commanded filename into local buffer to ensure size limitation and to allow for modification - */ - CFE_SB_MessageStringGet(QueryAllFilename, (char *)CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE, - sizeof(QueryAllFilename), sizeof(CmdPtr->FileName)); - /* * Collect list of active resource IDs. * @@ -1267,21 +1269,31 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) } CFE_ES_UnlockSharedData(__func__, __LINE__); - /* - ** Check to see if the file already exists - */ - Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); - if (Result >= 0) + /* Copy the commanded filename, using default if unspecified */ + Result = CFE_FS_ParseInputFileNameEx(QueryAllFilename, CmdPtr->FileName, sizeof(QueryAllFilename), + sizeof(CmdPtr->FileName), CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Result == CFE_SUCCESS) { - OS_close(FileDescriptor); - OS_remove(QueryAllFilename); + /* + ** Check to see if the file already exists + */ + Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); + if (Result >= 0) + { + OS_close(FileDescriptor); + OS_remove(QueryAllFilename); + } + + /* + ** Create ES task log data file + */ + Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, + OS_WRITE_ONLY); } - /* - ** Create ES task log data file - */ - Result = - OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); if (Result >= 0) { /* @@ -1385,12 +1397,6 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) uint32 NumTasks; CFE_ES_TaskRecord_t * TaskRecPtr; - /* - ** Copy the commanded filename into local buffer to ensure size limitation and to allow for modification - */ - CFE_SB_MessageStringGet(QueryAllFilename, (char *)CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE, - sizeof(QueryAllFilename), sizeof(CmdPtr->FileName)); - /* * Collect list of active task IDs. * @@ -1412,20 +1418,32 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) CFE_ES_UnlockSharedData(__func__, __LINE__); /* - ** Check to see if the file already exists + ** Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); - if (Result >= 0) + Result = CFE_FS_ParseInputFileNameEx(QueryAllFilename, CmdPtr->FileName, sizeof(QueryAllFilename), + sizeof(CmdPtr->FileName), CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Result == CFE_SUCCESS) { - OS_close(FileDescriptor); - OS_remove(QueryAllFilename); + /* + ** Check to see if the file already exists + */ + Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); + if (Result >= 0) + { + OS_close(FileDescriptor); + OS_remove(QueryAllFilename); + } + + /* + ** Create ES task log data file + */ + Result = OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, + OS_WRITE_ONLY); } - /* - ** Create ES task log data file - */ - Result = - OS_OpenCreate(&FileDescriptor, QueryAllFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); if (Result >= 0) { /* @@ -1576,10 +1594,26 @@ int32 CFE_ES_WriteSysLogCmd(const CFE_ES_WriteSysLogCmd_t *data) int32 Stat; char LogFilename[OS_MAX_PATH_LEN]; - CFE_SB_MessageStringGet(LogFilename, (char *)CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE, - sizeof(LogFilename), sizeof(CmdPtr->FileName)); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + ** + ** Note even though this fundamentally contains strings, it is written as a binary file with an FS header, + ** not as normal text file, so still using the BINARY DATA DUMP category for its default extension. + */ + Stat = CFE_FS_ParseInputFileNameEx(LogFilename, CmdPtr->FileName, sizeof(LogFilename), sizeof(CmdPtr->FileName), + CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); - Stat = CFE_ES_SysLogDump(LogFilename); + if (Stat != CFE_SUCCESS) + { + CFE_EVS_SendEvent(CFE_ES_SYSLOG2_ERR_EID, CFE_EVS_EventType_ERROR, "Error parsing file name RC = 0x%08X", + (unsigned int)Stat); + } + else + { + Stat = CFE_ES_SysLogDump(LogFilename); + } if (Stat == CFE_SUCCESS) { @@ -1661,18 +1695,37 @@ int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLogCmd_t *data) StatePtr->FileWrite.GetData = CFE_ES_BackgroundERLogFileDataGetter; StatePtr->FileWrite.OnEvent = CFE_ES_BackgroundERLogFileEventHandler; - CFE_SB_MessageStringGet(StatePtr->FileWrite.FileName, CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_ER_LOG_FILE, - sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->FileName)); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Status = CFE_FS_ParseInputFileNameEx(StatePtr->FileWrite.FileName, CmdPtr->FileName, + sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->FileName), + CFE_PLATFORM_ES_DEFAULT_ER_LOG_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); - Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + if (Status == CFE_SUCCESS) + { + Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + } } if (Status != CFE_SUCCESS) { - CFE_EVS_SendEvent(CFE_ES_ERLOG_PENDING_ERR_EID, CFE_EVS_EventType_ERROR, - "Error log write to file %s already in progress", StatePtr->FileWrite.FileName); + if (Status == CFE_STATUS_REQUEST_ALREADY_PENDING) + { + /* Specific event if already pending */ + CFE_EVS_SendEvent(CFE_ES_ERLOG_PENDING_ERR_EID, CFE_EVS_EventType_ERROR, + "Error log write already in progress"); + } + else + { + /* Some other validation issue e.g. bad file name */ + CFE_EVS_SendEvent(CFE_ES_ERLOG2_ERR_EID, CFE_EVS_EventType_ERROR, "Error creating file, RC = %d", + (int)Status); + } - /* background dump already running, consider this an error */ + /* background dump did not start, consider this an error */ CFE_ES_TaskData.CommandErrorCounter++; } else @@ -1894,14 +1947,33 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) int32 FileSize = 0; int32 NumEntries = 0; - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(DumpFilename, CmdPtr->DumpFilename, CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE, - sizeof(DumpFilename), sizeof(CmdPtr->DumpFilename)); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Status = CFE_FS_ParseInputFileNameEx(DumpFilename, CmdPtr->DumpFilename, sizeof(DumpFilename), + sizeof(CmdPtr->DumpFilename), CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Status != OS_SUCCESS) + { + CFE_EVS_SendEvent(CFE_ES_CREATING_CDS_DUMP_ERR_EID, CFE_EVS_EventType_ERROR, + "Error parsing CDS dump filename, Status=0x%08X", (unsigned int)Status); + } + else + { + /* Create a new dump file, overwriting anything that may have existed previously */ + Status = + OS_OpenCreate(&FileDescriptor, DumpFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); - /* Create a new dump file, overwriting anything that may have existed previously */ - Status = OS_OpenCreate(&FileDescriptor, DumpFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); + if (Status != OS_SUCCESS) + { + CFE_EVS_SendEvent(CFE_ES_CREATING_CDS_DUMP_ERR_EID, CFE_EVS_EventType_ERROR, + "Error creating CDS dump file '%s', Status=0x%08X", DumpFilename, (unsigned int)Status); + } + } - if (Status >= OS_SUCCESS) + if (Status == OS_SUCCESS) { /* Initialize the standard cFE File Header for the Dump File */ CFE_FS_InitHeader(&StdFileHeader, "CDS_Registry", CFE_FS_SubType_ES_CDS_REG); @@ -1974,9 +2046,6 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) } else { - CFE_EVS_SendEvent(CFE_ES_CREATING_CDS_DUMP_ERR_EID, CFE_EVS_EventType_ERROR, - "Error creating CDS dump file '%s', Status=0x%08X", DumpFilename, (unsigned int)Status); - /* Increment Command Error Counter */ CFE_ES_TaskData.CommandErrorCounter++; } diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 67e48dc4f..fb2dfc41c 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -2348,7 +2348,7 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_START_ERR_EID), "CFE_ES_StartAppCmd", "Start application from file name fail"); - /* Test app create with the file name too short */ + /* Test app create with an invalid file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.StartAppCmd.Payload.AppFileName, "123", sizeof(CmdBuf.StartAppCmd.Payload.AppFileName) - 1); @@ -2361,6 +2361,7 @@ void TestTask(void) CmdBuf.StartAppCmd.Payload.Priority = 160; CmdBuf.StartAppCmd.Payload.StackSize = CFE_ES_MEMOFFSET_C(12096); CmdBuf.StartAppCmd.Payload.ExceptionAction = CFE_ES_ExceptionAction_RESTART_APP; + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.StartAppCmd), UT_TPID_CFE_ES_CMD_START_APP_CC); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_START_INVALID_FILENAME_ERR_EID), "CFE_ES_StartAppCmd", "Invalid file name"); @@ -2626,6 +2627,14 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_ALL_APPS_EID), "CFE_ES_QueryAllCmd", "Query all applications - null file name"); + /* Test write of all app data to file with a bad file name */ + ES_ResetUnitTest(); + memset(&CmdBuf, 0, sizeof(CmdBuf)); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllCmd), UT_TPID_CFE_ES_CMD_QUERY_ALL_CC); + UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_OSCREATE_ERR_EID), "CFE_ES_QueryAllCmd", + "Query all applications - bad file name"); + /* Test write of all app data to file with a write header failure */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); @@ -2661,6 +2670,15 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_TASKINFO_EID), "CFE_ES_QueryAllTasksCmd", "Task information file written"); + /* Test write of all task data to a file with file name validation failure */ + ES_ResetUnitTest(); + memset(&CmdBuf, 0, sizeof(CmdBuf)); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.QueryAllTasksCmd), + UT_TPID_CFE_ES_CMD_QUERY_ALL_TASKS_CC); + UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_TASKINFO_OSCREATE_ERR_EID), "CFE_ES_QueryAllTasksCmd", + "Task information file write fail; OS create"); + /* Test write of all task data to a file with write header failure */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); @@ -2726,6 +2744,14 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_SYSLOG2_EID), "CFE_ES_WriteSysLogCmd", "Write system log; success"); + /* Test writing the system log using a bad file name */ + ES_ResetUnitTest(); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + memset(&CmdBuf, 0, sizeof(CmdBuf)); + UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); + UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_SYSLOG2_ERR_EID), "CFE_ES_WriteSysLogCmd", + "Write system log; bad file name"); + /* Test writing the system log using a null file name */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); @@ -2783,6 +2809,13 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, !UT_EventIsInHistory(CFE_ES_ERLOG_PENDING_ERR_EID), "CFE_ES_WriteERLogCmd", "Write E&R log command; no events"); + /* Failure of parsing the file name */ + UT_ClearEventHistory(); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteERLogCmd), UT_TPID_CFE_ES_CMD_WRITE_ER_LOG_CC); + UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_ERLOG2_ERR_EID), "CFE_ES_WriteERLogCmd", + "Write E&R log command; bad file name"); + /* Failure from CFE_FS_BackgroundFileDumpRequest() should send the pending error event ID */ UT_ClearEventHistory(); UT_SetDeferredRetcode(UT_KEY(CFE_FS_BackgroundFileDumpRequest), 1, CFE_STATUS_REQUEST_ALREADY_PENDING); @@ -2930,6 +2963,15 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_CDS_REG_DUMP_INF_EID), "CFE_ES_DumpCDSRegistryCmd", "Dump CDS; success (default dump file)"); + /* Test dumping of the CDS to a file with a bad file name */ + ES_ResetUnitTest(); + memset(&CmdBuf, 0, sizeof(CmdBuf)); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.DumpCDSRegistryCmd), + UT_TPID_CFE_ES_CMD_DUMP_CDS_REGISTRY_CC); + UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_CREATING_CDS_DUMP_ERR_EID), "CFE_ES_DumpCDSRegistryCmd", + "Dump CDS; bad file name"); + /* Test dumping of the CDS to a file with a bad FS write header */ ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); @@ -3287,6 +3329,15 @@ void TestPerf(void) UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PERF_STOPCMD_EID), "CFE_ES_StopPerfDataCmd", "Stop collecting performance data"); + /* Test performance data collection stop with a file name validation issue */ + ES_ResetUnitTest(); + memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); + memset(&CmdBuf, 0, sizeof(CmdBuf)); + UT_SetDefaultReturnValue(UT_KEY(CFE_FS_ParseInputFileNameEx), CFE_FS_INVALID_PATH); + UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); + UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PERF_LOG_ERR_EID), "CFE_ES_StopPerfDataCmd", + "Stop performance data command bad file name"); + /* Test successful performance data collection stop with a non-default file name */ ES_ResetUnitTest(); diff --git a/modules/evs/fsw/src/cfe_evs_log.c b/modules/evs/fsw/src/cfe_evs_log.c index bd665e005..4518364b3 100644 --- a/modules/evs/fsw/src/cfe_evs_log.c +++ b/modules/evs/fsw/src/cfe_evs_log.c @@ -144,20 +144,32 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data) CFE_FS_Header_t LogFileHdr; char LogFilename[OS_MAX_PATH_LEN]; - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(LogFilename, (const char *)CmdPtr->LogFilename, CFE_PLATFORM_EVS_DEFAULT_LOG_FILE, - sizeof(LogFilename), sizeof(CmdPtr->LogFilename)); - - /* Create the log file */ - Result = OS_OpenCreate(&LogFileHandle, LogFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); - - if (Result < OS_SUCCESS) + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Result = CFE_FS_ParseInputFileNameEx(LogFilename, CmdPtr->LogFilename, sizeof(LogFilename), + sizeof(CmdPtr->LogFilename), CFE_PLATFORM_EVS_DEFAULT_LOG_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Result != OS_SUCCESS) { EVS_SendEvent(CFE_EVS_ERR_CRLOGFILE_EID, CFE_EVS_EventType_ERROR, - "Write Log File Command Error: OS_OpenCreate = 0x%08X, filename = %s", (unsigned int)Result, - LogFilename); + "Write Log File Command Error: CFE_FS_ParseInputFileNameEx() = 0x%08X", (unsigned int)Result); } else + { + /* Create the log file */ + Result = OS_OpenCreate(&LogFileHandle, LogFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); + if (Result != OS_SUCCESS) + { + EVS_SendEvent(CFE_EVS_ERR_CRLOGFILE_EID, CFE_EVS_EventType_ERROR, + "Write Log File Command Error: OS_OpenCreate = 0x%08X, filename = %s", (unsigned int)Result, + LogFilename); + } + } + + if (Result == OS_SUCCESS) { /* Result will be overridden if everything works */ Result = CFE_EVS_FILE_WRITE_ERROR; diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index e225fc0e7..378e3ca14 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -1693,20 +1693,33 @@ int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFileCmd_t *data) const CFE_EVS_AppDataCmd_Payload_t *CmdPtr = &data->Payload; char LocalName[OS_MAX_PATH_LEN]; - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(LocalName, CmdPtr->AppDataFilename, CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE, - sizeof(LocalName), sizeof(CmdPtr->AppDataFilename)); - - /* Create Application Data File */ - Result = OS_OpenCreate(&FileHandle, LocalName, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Result = CFE_FS_ParseInputFileNameEx(LocalName, CmdPtr->AppDataFilename, sizeof(LocalName), + sizeof(CmdPtr->AppDataFilename), CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); - if (Result < OS_SUCCESS) + if (Result != CFE_SUCCESS) { EVS_SendEvent(CFE_EVS_ERR_CRDATFILE_EID, CFE_EVS_EventType_ERROR, - "Write App Data Command Error: OS_OpenCreate = 0x%08X, filename = %s", (unsigned int)Result, - LocalName); + "Write App Data Command Error: CFE_FS_ParseInputFileNameEx() = 0x%08X", (unsigned int)Result); } else + { + /* Create Application Data File */ + Result = OS_OpenCreate(&FileHandle, LocalName, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); + + if (Result != OS_SUCCESS) + { + EVS_SendEvent(CFE_EVS_ERR_CRDATFILE_EID, CFE_EVS_EventType_ERROR, + "Write App Data Command Error: OS_OpenCreate = 0x%08X, filename = %s", (unsigned int)Result, + LocalName); + } + } + + if (Result == OS_SUCCESS) { /* Result will be overridden if everything works */ Result = CFE_EVS_FILE_WRITE_ERROR; diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index d863302a4..47a0c78f2 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -1023,6 +1023,12 @@ void Test_Logging(void) UT_Report(__FILE__, __LINE__, CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd) == CFE_SUCCESS, "CFE_EVS_WriteLogDataFileCmd", "Write single event log entry - successful (default log name)"); + /* Test writing a log entry with a file name failure */ + UT_InitData(); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_Report(__FILE__, __LINE__, CFE_EVS_WriteLogDataFileCmd(&CmdBuf.logfilecmd) != CFE_SUCCESS, + "CFE_EVS_WriteLogDataFileCmd", "FS parse filename failure"); + /* Test writing a log entry with a create failure */ UT_InitData(); UT_SetDeferredRetcode(UT_KEY(OS_MutSemCreate), 1, OS_SUCCESS); @@ -1113,6 +1119,14 @@ void Test_WriteApp(void) UT_Report(__FILE__, __LINE__, UT_EVS_EventBuf.EventID == CFE_EVS_ERR_CRDATFILE_EID, "CFE_EVS_WriteAppDataFileCmd", "OS create fail (default file name)"); + /* Test writing application data with bad file name */ + UT_InitData(); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_EVS_DoDispatchCheckEvents(&CmdBuf.AppDataCmd, sizeof(CmdBuf.AppDataCmd), + UT_TPID_CFE_EVS_CMD_WRITE_APP_DATA_FILE_CC, &UT_EVS_EventBuf); + UT_Report(__FILE__, __LINE__, UT_EVS_EventBuf.EventID == CFE_EVS_ERR_CRDATFILE_EID, "CFE_EVS_WriteAppDataFileCmd", + "parse filename failure"); + /* Test writing application data with a write/close failure */ UT_InitData(); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 28dbcd3fe..df2791a29 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -1022,11 +1022,6 @@ int32 CFE_SB_WriteRoutingInfoCmd(const CFE_SB_WriteRoutingInfoCmd_t *data) /* Reset the entire state object (just for good measure, ensure no stale data) */ memset(StatePtr, 0, sizeof(*StatePtr)); - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(StatePtr->FileWrite.FileName, CmdPtr->Filename, - CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME, sizeof(StatePtr->FileWrite.FileName), - sizeof(CmdPtr->Filename)); - /* * Fill out the remainder of meta data. * This data is currently the same for every request @@ -1037,7 +1032,19 @@ int32 CFE_SB_WriteRoutingInfoCmd(const CFE_SB_WriteRoutingInfoCmd_t *data) StatePtr->FileWrite.GetData = CFE_SB_WriteRouteInfoDataGetter; StatePtr->FileWrite.OnEvent = CFE_SB_BackgroundFileEventHandler; - Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Status = CFE_FS_ParseInputFileNameEx(StatePtr->FileWrite.FileName, CmdPtr->Filename, + sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->Filename), + CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Status == CFE_SUCCESS) + { + Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + } } else { @@ -1153,10 +1160,6 @@ int32 CFE_SB_WritePipeInfoCmd(const CFE_SB_WritePipeInfoCmd_t *data) /* Reset the entire state object (just for good measure, ensure no stale data) */ memset(StatePtr, 0, sizeof(*StatePtr)); - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(StatePtr->FileWrite.FileName, CmdPtr->Filename, CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME, - sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->Filename)); - /* * Fill out the remainder of meta data. * This data is currently the same for every request @@ -1167,7 +1170,19 @@ int32 CFE_SB_WritePipeInfoCmd(const CFE_SB_WritePipeInfoCmd_t *data) StatePtr->FileWrite.GetData = CFE_SB_WritePipeInfoDataGetter; StatePtr->FileWrite.OnEvent = CFE_SB_BackgroundFileEventHandler; - Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Status = CFE_FS_ParseInputFileNameEx(StatePtr->FileWrite.FileName, CmdPtr->Filename, + sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->Filename), + CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Status == CFE_SUCCESS) + { + Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + } } else { @@ -1261,10 +1276,6 @@ int32 CFE_SB_WriteMapInfoCmd(const CFE_SB_WriteMapInfoCmd_t *data) /* Reset the entire state object (just for good measure, ensure no stale data) */ memset(StatePtr, 0, sizeof(*StatePtr)); - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(StatePtr->FileWrite.FileName, CmdPtr->Filename, CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME, - sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->Filename)); - /* * Fill out the remainder of meta data. * This data is currently the same for every request @@ -1275,7 +1286,19 @@ int32 CFE_SB_WriteMapInfoCmd(const CFE_SB_WriteMapInfoCmd_t *data) StatePtr->FileWrite.GetData = CFE_SB_WriteMsgMapInfoDataGetter; StatePtr->FileWrite.OnEvent = CFE_SB_BackgroundFileEventHandler; - Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + /* + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Status = CFE_FS_ParseInputFileNameEx(StatePtr->FileWrite.FileName, CmdPtr->Filename, + sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->Filename), + CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); + + if (Status == CFE_SUCCESS) + { + Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + } } else { diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 76d530570..dbbe2096d 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -529,6 +529,15 @@ void Test_SB_Cmds_RoutingInfoDef(void) EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + CFE_SB_ProcessCmdPipePkt(&WriteRoutingInfo.SBBuf); + + EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + TEARDOWN(CFE_SB_DeletePipe(CFE_SB_Global.CmdPipe)); } /* end Test_SB_Cmds_RoutingInfoDef */ @@ -644,6 +653,14 @@ void Test_SB_Cmds_PipeInfoDef(void) EVTSENT(CFE_SB_PIPE_ADDED_EID); + /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + CFE_SB_ProcessCmdPipePkt(&WritePipeInfo.SBBuf); + EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + TEARDOWN(CFE_SB_DeletePipe(PipeId1)); TEARDOWN(CFE_SB_DeletePipe(PipeId2)); TEARDOWN(CFE_SB_DeletePipe(PipeId3)); @@ -847,6 +864,14 @@ void Test_SB_Cmds_MapInfoDef(void) EVTSENT(CFE_SB_SUBSCRIPTION_RCVD_EID); + /* Also test with a bad file name - should generate CFE_SB_SND_RTG_ERR1_EID */ + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetMsgId), &MsgId, sizeof(MsgId), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetSize), &Size, sizeof(Size), false); + UT_SetDataBuffer(UT_KEY(CFE_MSG_GetFcnCode), &FcnCode, sizeof(FcnCode), false); + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + CFE_SB_ProcessCmdPipePkt(&WriteMapInfo.SBBuf); + EVTSENT(CFE_SB_SND_RTG_ERR1_EID); + TEARDOWN(CFE_SB_DeletePipe(PipeId1)); TEARDOWN(CFE_SB_DeletePipe(PipeId2)); TEARDOWN(CFE_SB_DeletePipe(PipeId3)); diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c index b3bccb2e8..bfdb59282 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.c +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.c @@ -1230,11 +1230,6 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistryCmd_t *data) /* If a reg dump was already pending, do not overwrite the current request */ if (!CFE_FS_BackgroundFileDumpIsPending(&StatePtr->FileWrite)) { - /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(StatePtr->FileWrite.FileName, CmdPtr->DumpFilename, - CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE, sizeof(StatePtr->FileWrite.FileName), - sizeof(CmdPtr->DumpFilename)); - /* * Fill out the remainder of meta data. * This data is currently the same for every request @@ -1246,19 +1241,30 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistryCmd_t *data) StatePtr->FileWrite.OnEvent = CFE_TBL_DumpRegistryEventHandler; /* - * Before submitting the background request, use OS_stat() to check if the file exists already. - * - * This is because TBL services issued a different event ID in some cases if - * it is overwriting a file vs. creating a new file. - */ - StatePtr->FileExisted = (OS_stat(StatePtr->FileWrite.FileName, &FileStat) == OS_SUCCESS); - - Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + ** Copy the filename into local buffer with default name/path/extension if not specified + */ + Status = CFE_FS_ParseInputFileNameEx(StatePtr->FileWrite.FileName, CmdPtr->DumpFilename, + sizeof(StatePtr->FileWrite.FileName), sizeof(CmdPtr->DumpFilename), + CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE, + CFE_FS_GetDefaultMountPoint(CFE_FS_FileCategory_BINARY_DATA_DUMP), + CFE_FS_GetDefaultExtension(CFE_FS_FileCategory_BINARY_DATA_DUMP)); if (Status == CFE_SUCCESS) { - /* Increment the TBL generic command counter (successfully queued for background job) */ - ReturnCode = CFE_TBL_INC_CMD_CTR; + /* + * Before submitting the background request, use OS_stat() to check if the file exists already. + * + * This is because TBL services issued a different event ID in some cases if + * it is overwriting a file vs. creating a new file. + */ + StatePtr->FileExisted = (OS_stat(StatePtr->FileWrite.FileName, &FileStat) == OS_SUCCESS); + + Status = CFE_FS_BackgroundFileDumpRequest(&StatePtr->FileWrite); + if (Status == CFE_SUCCESS) + { + /* Increment the TBL generic command counter (successfully queued for background job) */ + ReturnCode = CFE_TBL_INC_CMD_CTR; + } } } diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 3d788f8a0..233e9cfdf 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -963,6 +963,12 @@ void Test_CFE_TBL_DumpRegCmd(void) UT_Report(__FILE__, __LINE__, CFE_TBL_DumpRegistryCmd(&DumpRegCmd) == CFE_TBL_INC_CMD_CTR, "CFE_TBL_DumpRegistryCmd", "Default dump file name"); + /* Test command with a bad file name */ + UT_SetDeferredRetcode(UT_KEY(CFE_FS_ParseInputFileNameEx), 1, CFE_FS_INVALID_PATH); + UT_Report(__FILE__, __LINE__, CFE_TBL_DumpRegistryCmd(&DumpRegCmd) == CFE_TBL_INC_ERR_CTR, + "CFE_TBL_DumpRegistryCmd", "Dump file name invalid"); + UT_ResetState(UT_KEY(CFE_FS_ParseInputFileNameEx)); + /* Test command with the dump file already pending (max requests pending) */ UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpIsPending), true); UT_SetDefaultReturnValue(UT_KEY(CFE_FS_BackgroundFileDumpRequest), CFE_STATUS_REQUEST_ALREADY_PENDING); From 096127ba7f47f21c821edca9bf12688d9946552e Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Thu, 18 Mar 2021 09:02:31 -0400 Subject: [PATCH 02/27] Fix #1223, shorten TestRunner function name --- docs/README_functionaltest.md | 2 +- modules/cfe_testrunner/inc/cfe_testrunner.h | 2 +- modules/cfe_testrunner/src/cfe_testrunner_main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/README_functionaltest.md b/docs/README_functionaltest.md index 027e9f757..f4bfaaec6 100644 --- a/docs/README_functionaltest.md +++ b/docs/README_functionaltest.md @@ -30,7 +30,7 @@ To execute tests at startup, the following lines can be added to `cfe_es_startup designated test target: CFE_LIB, /cf/cfe_assert.so, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0; - CFE_APP, /cf/cfe_testrunner.so, CFE_TestRunner_AppMain, TESTRUN_APP, 100, 16384, 0x0, 0; + CFE_APP, /cf/cfe_testrunner.so, CFE_TR_AppMain, TESTRUN_APP, 100, 16384, 0x0, 0; CFE_LIB, /cf/cfe_testcase.so, CFE_Test_Init, CFETEST_LIB, 0, 0, 0x0, 0; CFE_LIB, /cf/psp_test.so, PSP_Test_Init, PSPTEST_LIB, 0, 0, 0x0, 0; diff --git a/modules/cfe_testrunner/inc/cfe_testrunner.h b/modules/cfe_testrunner/inc/cfe_testrunner.h index 8502714af..e55b3b27c 100644 --- a/modules/cfe_testrunner/inc/cfe_testrunner.h +++ b/modules/cfe_testrunner/inc/cfe_testrunner.h @@ -54,7 +54,7 @@ ** ** *************************************************************************/ -void CFE_TestRunner_AppMain(void); +void CFE_TR_AppMain(void); #endif /* cfe_testrunner_h_ */ diff --git a/modules/cfe_testrunner/src/cfe_testrunner_main.c b/modules/cfe_testrunner/src/cfe_testrunner_main.c index c12153a23..eff1fb0e3 100644 --- a/modules/cfe_testrunner/src/cfe_testrunner_main.c +++ b/modules/cfe_testrunner/src/cfe_testrunner_main.c @@ -59,7 +59,7 @@ /* * Entry point for this application */ -void CFE_TestRunner_AppMain(void) +void CFE_TR_AppMain(void) { int32 rc; uint32 RunStatus; From d5bd7ca978c7a69b6ca50f36ad5dff26f05fa33a Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 17 Mar 2021 11:16:49 -0400 Subject: [PATCH 03/27] Fix #1192, Initialize TotalMsgSize in CFE_SB_GetUserDataLength --- modules/sb/fsw/src/cfe_sb_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sb/fsw/src/cfe_sb_util.c b/modules/sb/fsw/src/cfe_sb_util.c index 20de113b3..58e072ab4 100644 --- a/modules/sb/fsw/src/cfe_sb_util.c +++ b/modules/sb/fsw/src/cfe_sb_util.c @@ -119,7 +119,7 @@ void *CFE_SB_GetUserData(CFE_MSG_Message_t *MsgPtr) */ size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr) { - CFE_MSG_Size_t TotalMsgSize; + CFE_MSG_Size_t TotalMsgSize = 0; size_t HdrSize; if (MsgPtr == NULL) From 7091426b4389971ec8e3463ec51623ed4dab910e Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 17 Mar 2021 11:45:49 -0400 Subject: [PATCH 04/27] Fix #1186, Remove useless assignments/checks --- modules/es/fsw/src/cfe_es_apps.c | 2 -- modules/es/fsw/src/cfe_es_generic_pool.c | 1 - modules/es/fsw/src/cfe_es_mempool.c | 2 +- modules/evs/fsw/src/cfe_evs_task.c | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 1944e7153..4a5e14740 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -110,7 +110,6 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath) else { CFE_ES_WriteToSysLog("ES Startup: Cannot Open Volatile Startup file, Trying Nonvolatile.\n"); - FileOpened = false; } } /* end if */ @@ -141,7 +140,6 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath) { CFE_ES_WriteToSysLog("ES Startup: Error, Can't Open ES App Startup file: %s EC = 0x%08X\n", StartFilePath, (unsigned int)Status); - FileOpened = false; } } diff --git a/modules/es/fsw/src/cfe_es_generic_pool.c b/modules/es/fsw/src/cfe_es_generic_pool.c index bba148318..7b31dde39 100644 --- a/modules/es/fsw/src/cfe_es_generic_pool.c +++ b/modules/es/fsw/src/cfe_es_generic_pool.c @@ -419,7 +419,6 @@ int32 CFE_ES_GenPoolGetBlockSize(CFE_ES_GenPoolRecord_t *PoolRecPtr, size_t *Blo else { *BlockSizePtr = BdPtr->ActualSize; - Status = CFE_SUCCESS; } } diff --git a/modules/es/fsw/src/cfe_es_mempool.c b/modules/es/fsw/src/cfe_es_mempool.c index 7a084f695..b225e7645 100644 --- a/modules/es/fsw/src/cfe_es_mempool.c +++ b/modules/es/fsw/src/cfe_es_mempool.c @@ -172,7 +172,7 @@ int32 CFE_ES_PoolCreateEx(CFE_ES_MemHandle_t *PoolID, uint8 *MemPtr, size_t Size if (BlockSizes == NULL) { BlockSizes = CFE_ES_MemPoolDefSize; - if (NumBlockSizes == 0 || NumBlockSizes > CFE_PLATFORM_ES_POOL_MAX_BUCKETS) + if (NumBlockSizes == 0) { NumBlockSizes = CFE_PLATFORM_ES_POOL_MAX_BUCKETS; } diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index e225fc0e7..e75d7e339 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -80,7 +80,6 @@ int32 CFE_EVS_EarlyInit(void) /* Elements stored in the hk packet that have non-zero default values */ CFE_EVS_Global.EVS_TlmPkt.Payload.MessageFormatMode = CFE_PLATFORM_EVS_DEFAULT_MSG_FORMAT_MODE; CFE_EVS_Global.EVS_TlmPkt.Payload.OutputPort = CFE_PLATFORM_EVS_PORT_DEFAULT; - CFE_EVS_Global.EVS_TlmPkt.Payload.LogFullFlag = false; CFE_EVS_Global.EVS_TlmPkt.Payload.LogMode = CFE_PLATFORM_EVS_DEFAULT_LOG_MODE; /* Get a pointer to the CFE reset area from the BSP */ From 1072b0daed62e92a041d2a1ea9825dfabac49f57 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 17 Mar 2021 11:58:09 -0400 Subject: [PATCH 05/27] Fix #1180, Remove impossible conditions --- modules/es/fsw/src/cfe_es_apps.c | 63 ++++++++++++-------------- modules/tbl/fsw/src/cfe_tbl_internal.c | 2 +- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 1944e7153..e1e7b54f0 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -1287,42 +1287,37 @@ void CFE_ES_ProcessControlRequest(CFE_ES_AppId_t AppId) break; } - if (EventID != 0 && ReqName != NULL) + if (MessageDetail[0] != 0) { - if (MessageDetail[0] != 0) - { - /* Detail message already set, assume it is an error event */ - EventType = CFE_EVS_EventType_ERROR; - } - else if (StartupStatus != CFE_SUCCESS) - { - /* Make detail message for event containing startup error code */ - EventType = CFE_EVS_EventType_ERROR; - snprintf(MessageDetail, sizeof(MessageDetail), "Failed: AppCreate Error 0x%08X.", - (unsigned int)StartupStatus); - } - else if (CleanupStatus != CFE_SUCCESS) - { - /* Make detail message for event containing cleanup error code */ - EventType = CFE_EVS_EventType_ERROR; - snprintf(MessageDetail, sizeof(MessageDetail), "Failed: CleanUpApp Error 0x%08X.", - (unsigned int)CleanupStatus); - } - else if (CFE_RESOURCEID_TEST_DEFINED(NewAppId)) - { - /* Record success message for event where app is restarted */ - EventType = CFE_EVS_EventType_INFORMATION; - snprintf(MessageDetail, sizeof(MessageDetail), "Completed, AppID=%lu", CFE_RESOURCEID_TO_ULONG(NewAppId)); - } - else - { - /* Record success message for event */ - EventType = CFE_EVS_EventType_INFORMATION; - snprintf(MessageDetail, sizeof(MessageDetail), "Completed."); - } - - CFE_EVS_SendEvent(EventID, EventType, "%s Application %s %s", ReqName, OrigAppName, MessageDetail); + /* Detail message already set, assume it is an error event */ + EventType = CFE_EVS_EventType_ERROR; + } + else if (StartupStatus != CFE_SUCCESS) + { + /* Make detail message for event containing startup error code */ + EventType = CFE_EVS_EventType_ERROR; + snprintf(MessageDetail, sizeof(MessageDetail), "Failed: AppCreate Error 0x%08X.", (unsigned int)StartupStatus); } + else if (CleanupStatus != CFE_SUCCESS) + { + /* Make detail message for event containing cleanup error code */ + EventType = CFE_EVS_EventType_ERROR; + snprintf(MessageDetail, sizeof(MessageDetail), "Failed: CleanUpApp Error 0x%08X.", (unsigned int)CleanupStatus); + } + else if (CFE_RESOURCEID_TEST_DEFINED(NewAppId)) + { + /* Record success message for event where app is restarted */ + EventType = CFE_EVS_EventType_INFORMATION; + snprintf(MessageDetail, sizeof(MessageDetail), "Completed, AppID=%lu", CFE_RESOURCEID_TO_ULONG(NewAppId)); + } + else + { + /* Record success message for event */ + EventType = CFE_EVS_EventType_INFORMATION; + snprintf(MessageDetail, sizeof(MessageDetail), "Completed."); + } + + CFE_EVS_SendEvent(EventID, EventType, "%s Application %s %s", ReqName, OrigAppName, MessageDetail); } /* End Function */ diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.c b/modules/tbl/fsw/src/cfe_tbl_internal.c index df6045b8d..4b1a4050b 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.c +++ b/modules/tbl/fsw/src/cfe_tbl_internal.c @@ -145,7 +145,7 @@ int32 CFE_TBL_EarlyInit(void) } j++; - } while ((j < CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS) && (Status >= CFE_PLATFORM_TBL_MAX_SNGL_TABLE_SIZE)); + } while (j < CFE_PLATFORM_TBL_MAX_SIMULTANEOUS_LOADS); } /* Try to obtain a previous image of the Critical Table Registry from the Critical Data Store */ From 2d1cf8bdaf25166f3f3e4b51e60a0e40181a6155 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 17 Mar 2021 16:28:02 -0400 Subject: [PATCH 06/27] Fix #1002, Remove deprecated elements --- modules/core_api/fsw/inc/cfe_error.h | 10 - modules/core_api/fsw/inc/cfe_sb.h | 468 ------------------ .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 43 -- modules/core_api/ut-stubs/src/ut_sb_stubs.c | 440 ---------------- modules/sb/fsw/src/cfe_sb_api.c | 63 --- modules/sb/fsw/src/cfe_sb_msg_id_util.c | 42 -- modules/sb/fsw/src/cfe_sb_priv.c | 23 - modules/sb/fsw/src/cfe_sb_util.c | 133 ----- 8 files changed, 1222 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 2e9331e0a..6b0675043 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -1371,14 +1371,4 @@ typedef int32 CFE_Status_t; #define CFE_TIME_BAD_ARGUMENT ((CFE_Status_t)0xce000005) /**@}*/ -/* Compatibility for error names which have been updated */ -#ifndef CFE_OMIT_DEPRECATED_6_8 -#define CFE_ES_ERR_TASKID CFE_ES_ERR_RESOURCEID_NOT_VALID -#define CFE_ES_ERR_APPID CFE_ES_ERR_RESOURCEID_NOT_VALID -#define CFE_ES_ERR_MEM_HANDLE CFE_ES_ERR_RESOURCEID_NOT_VALID -#define CFE_ES_ERR_APPNAME CFE_ES_ERR_NAME_NOT_FOUND -#define CFE_ES_CDS_NOT_FOUND_ERR CFE_ES_ERR_NAME_NOT_FOUND -#define CFE_ES_CDS_REGISTRY_FULL CFE_ES_NO_RESOURCE_IDS_AVAILABLE -#endif - #endif /* _cfe_error_ */ diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index c673e5329..3cf9aa620 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -40,11 +40,6 @@ #include "cfe_sb_api_typedefs.h" #include "cfe_es_api_typedefs.h" -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* only deprecated functions depend on TIME types */ -#include "cfe_time_api_typedefs.h" -#endif - /* ** Macro Definitions */ @@ -428,68 +423,6 @@ CFE_Status_t CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeI **/ CFE_Status_t CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount); -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief DEPRECATED: Send a software bus message -** \deprecated Use CFE_SB_TransmitMsg -** -** \par Description -** This routine sends the specified message to all subscribers. The -** software bus will read the message ID from the message header to -** determine which pipes should receive the message. -** -** \par Assumptions, External Events, and Notes: -** - This routine will not normally wait for the receiver tasks to -** process the message before returning control to the caller's task. -** - However, if a higher priority task is pending and subscribed to -** this message, that task may get to run before returning -** control to the caller. -** - This function tracks and increments the source sequence counter -** of a telemetry message. -** -** \param[in] MsgPtr A pointer to the message to be sent. This must point -** to the first byte of the message header. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT -** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -**/ -CFE_Status_t CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr); - -/*****************************************************************************/ -/** -** \brief DEPRECATED: Passes a software bus message -** \deprecated Use CFE_SB_TransmitMsg -** -** \par Description -** This routine sends the specified message to all subscribers. The -** software bus will read the message ID from the message header to -** determine which pipes should receive the message. This routine is -** intended to pass messages not generated by the sending application. -** -** \par Assumptions, External Events, and Notes: -** - This routine will not normally wait for the receiver tasks to -** process the message before returning control to the caller's task. -** - However, if a higher priority task is pending and subscribed to -** this message, that task may get to run before #CFE_SB_PassMsg -** returns control to the caller. -** - This routine will not modify the sequence counter in the message. -** -** \param[in] MsgPtr A pointer to the message to be sent. This must point -** to the first byte of the message header. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT -** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -**/ -CFE_Status_t CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief Receive a message from a software bus pipe @@ -530,14 +463,6 @@ CFE_Status_t CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr); ** \retval #CFE_SB_NO_MESSAGE \copybrief CFE_SB_NO_MESSAGE **/ CFE_Status_t CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut); - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/** - * \brief DEPRECATED: receive buffer - * \deprecated use CFE_SB_ReceiveBuffer - */ -CFE_Status_t CFE_SB_RcvMsg(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ /**@}*/ /** @defgroup CFEAPISBZeroCopy cFE Zero Copy APIs @@ -649,143 +574,12 @@ CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_Zero **/ CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle, bool IncrementSequenceCount); - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief DEPRECATED: Send an SB message in "zero copy" mode. -** \deprecated use CFE_SB_TransmitBuffer -** -** \par Description -** This routine sends a message that has been created directly in an -** internal SB message buffer by an application (after a call to -** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than -** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of -** the message from the user's memory buffer to the software bus -** internal buffer. The "zero copy" interface can be used to improve -** performance in high-rate, high-volume software bus traffic. -** -** \par Assumptions, External Events, and Notes: -** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for -** one call to #CFE_SB_TransmitBuffer. -** -# Callers must not use the same SB message buffer for multiple sends. -** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_TransmitBuffer is equivalent -** to a \c free(). -** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_TransmitBuffer. -** -# This function tracks and increments the source sequence counter -** of a telemetry message. -** -** \param[in] BufPtr A pointer to the SB buffer to be sent. -** -** \param[in] BufferHandle The handle supplied with the #CFE_SB_ZeroCopyGetPtr call. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT -** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID -**/ -CFE_Status_t CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); - -/*****************************************************************************/ -/** -** \brief DEPRECATED: Pass an SB message in "zero copy" mode. -** \deprecated use CFE_SB_TransmitBuffer -** -** \par Description -** This routine sends a message that has been created directly in an -** internal SB message buffer by an application (after a call to -** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than -** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of -** the message from the user's memory buffer to the software bus -** internal buffer. The "zero copy" interface can be used to improve -** performance in high-rate, high-volume software bus traffic. This -** version is intended to pass messages not generated by the caller -** (to preserve the source sequence count). -** -** \par Assumptions, External Events, and Notes: -** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for -** one call to #CFE_SB_TransmitBuffer or #CFE_SB_ZeroCopyPass. -** -# Callers must not use the same SB message buffer for multiple sends. -** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_ZeroCopyPass is equivalent -** to a \c free(). -** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_ZeroCopyPass. -** -# This routine will not modify the sequence counter in a telemetry -** message -** -** \param[in] BufPtr A pointer to the SB buffer to be sent. -** -** \param[in] BufferHandle The handle supplied with the #CFE_SB_ZeroCopyGetPtr call. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT -** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID -**/ -CFE_Status_t CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); /**@}*/ -#endif /** @defgroup CFEAPISBSetMessage cFE Setting Message Characteristics APIs * @{ */ -#ifndef CFE_OMIT_DEPRECATED_6_8 - -/*****************************************************************************/ -/** -** \brief DEPRECATED - Initialize a buffer for a software bus message. -** \deprecated Use CFE_MSG_Init -** -** \par Description -** This routine fills in the header information needed to create a -** valid software bus message. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \param[in] MsgPtr A pointer to the buffer that will contain the message. -** This will point to the first byte of the message header. -** The \c void* data type allows the calling routine to use -** any data type when declaring its message buffer. -** -** \param[in] MsgId The message ID to put in the message header. -** -** \param[in] Length The total number of bytes of message data, including the SB -** message header . -** -** \param[in] Clear A flag indicating whether to clear the rest of the message: -** \arg true - fill sequence count and packet data with zeroes. -** \arg false - leave sequence count and packet data unchanged. -**/ -void CFE_SB_InitMsg(void *MsgPtr, CFE_SB_MsgId_t MsgId, size_t Length, bool Clear); - -/*****************************************************************************/ -/** -** \brief DEPRECATED - Sets the message ID of a software bus message. -** \deprecated Use CFE_MSG_SetMsgId -** -** \par Description -** This routine sets the Message ID in a software bus message header. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \param[in] MsgId The message ID to put into the message header. -**/ -void CFE_SB_SetMsgId(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief Sets the length of user data in a software bus message. @@ -808,61 +602,6 @@ void CFE_SB_SetMsgId(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId); **/ void CFE_SB_SetUserDataLength(CFE_MSG_Message_t *MsgPtr, size_t DataLength); -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief DEPRECATED: Sets the total length of a software bus message. -** \deprecated Use CFE_MSG_SetSize -** -** \par Description -** This routine sets the field in the SB message header that determines -** the total length of the message. SB message header formats can be -** different for each deployment of the cFE. So, applications should -** use this function rather than trying to poke a length value directly -** into their SB message buffers. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \param[in] TotalLength The length to set (total size of the message, in bytes, -** including headers). -**/ -void CFE_SB_SetTotalMsgLength(CFE_MSG_Message_t *MsgPtr, size_t TotalLength); - -/*****************************************************************************/ -/** -** \brief Sets the time field in a software bus message. -** \deprecated Use CFE_MSG_SetMsgTime -** -** \par Description -** This routine sets the time of a software bus message. Most applications -** will want to use #CFE_SB_TimeStampMsg instead of this function. But, -** when needed, this API can be used to send a group of SB messages -** with identical time stamps. -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not include -** a time field, then this routine will do nothing to the message contents -** and will return #CFE_SB_WRONG_MSG_TYPE. -** - Note default implementation of command messages do not have a time field -** and will trigger the #CFE_SB_WRONG_MSG_TYPE error -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \param[in] Time The time to include in the message. This will usually be a time -** returned by the function #CFE_TIME_GetTime. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_WRONG_MSG_TYPE \copybrief CFE_SB_WRONG_MSG_TYPE -**/ -CFE_Status_t CFE_SB_SetMsgTime(CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTime_t Time); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief Sets the time field in a software bus message with the current spacecraft time. @@ -881,33 +620,6 @@ CFE_Status_t CFE_SB_SetMsgTime(CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTime_t Tim **/ void CFE_SB_TimeStampMsg(CFE_MSG_Message_t *MsgPtr); -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief DEPRECATED:Sets the command code field in a software bus message. -** \deprecated Use CFE_MSG_SetFcnCode -** -** \par Description -** This routine sets the command code of a software bus message (if SB -** messages are implemented as CCSDS packets, this will be the function code). -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not -** include a command code field, then this routine will do nothing to -** the message contents and will return #CFE_SB_WRONG_MSG_TYPE. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \param[in] CmdCode The command code to include in the message. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_WRONG_MSG_TYPE \copybrief CFE_SB_WRONG_MSG_TYPE -**/ -CFE_Status_t CFE_SB_SetCmdCode(CFE_MSG_Message_t *MsgPtr, uint16 CmdCode); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /******************************************************************************/ /** ** \brief Copies a string into a software bus message @@ -967,26 +679,6 @@ int32 CFE_SB_MessageStringSet(char *DestStringPtr, const char *SourceStringPtr, **/ void *CFE_SB_GetUserData(CFE_MSG_Message_t *MsgPtr); -#ifndef CFE_OMIT_DEPRECATED_6_8 - -/*****************************************************************************/ -/** -** \brief DEPRECATED:Get the message ID of a software bus message. -** \deprecated Use CFE_MSG_GetMsgId -** -** \par Description -** This routine returns the message ID from a software bus message. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** -** \return The software bus Message ID from the message header. -**/ -CFE_SB_MsgId_t CFE_SB_GetMsgId(const CFE_MSG_Message_t *MsgPtr); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief Gets the length of user data in a software bus message. @@ -1004,71 +696,6 @@ CFE_SB_MsgId_t CFE_SB_GetMsgId(const CFE_MSG_Message_t *MsgPtr); **/ size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr); -#ifndef CFE_OMIT_DEPRECATED_6_8 - -/*****************************************************************************/ -/** -** \brief DEPRECATED: Gets the total length of a software bus message. -** \deprecated Use CFE_MSG_GetSize -** -** \par Description -** This routine returns the total size of the software bus message. -** -** \par Assumptions, External Events, and Notes: -** - For the CCSDS implementation of this API, the size is derived from -** the message header. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \return The total size (in bytes) of the software bus message, including headers. -**/ -size_t CFE_SB_GetTotalMsgLength(const CFE_MSG_Message_t *MsgPtr); - -/*****************************************************************************/ -/** -** \brief DEPRECATED: Gets the command code field from a software bus message. -** \deprecated Use CFE_MSG_GetFcnCode -** -** \par Description -** This routine gets the command code from a software bus message (if -** SB messages are implemented as CCSDS packets, this will be the function -** code). -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not -** include a command code field, then this routine will return a zero. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \return The command code included in the software bus message header (if present). -** Otherwise, returns a command code value of zero. -**/ -uint16 CFE_SB_GetCmdCode(CFE_MSG_Message_t *MsgPtr); - -/*****************************************************************************/ -/** -** \brief DEPRECATED: Gets the time field from a software bus message. -** \deprecated Use CFE_MSG_GetMsgTime -** -** \par Description -** This routine gets the time from a software bus message. -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not -** include a time field, then this routine will return a zero time. -** - Note default implementation of command messages do not have a time field. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \return The system time included in the software bus message header (if present), -** otherwise, returns a time value of zero. -**/ -CFE_TIME_SysTime_t CFE_SB_GetMsgTime(CFE_MSG_Message_t *MsgPtr); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /******************************************************************************/ /** ** \brief Copies a string out of a software bus message @@ -1112,84 +739,6 @@ int32 CFE_SB_MessageStringGet(char *DestStringPtr, const char *SourceStringPtr, size_t DestMaxSize, size_t SourceMaxSize); /**@}*/ -#ifndef CFE_OMIT_DEPRECATED_6_8 -/** @defgroup CFEAPISBChecksum cFE Checksum Control APIs - * @{ - */ - -/*****************************************************************************/ -/** -** \brief DEPRECATED:Gets the checksum field from a software bus message. -** \deprecated No use case -** -** \par Description -** This routine gets the checksum (or other message integrity check -** value) from a software bus message. The contents and location of -** this field will depend on the underlying implementation of software -** bus messages. It may be a checksum, a CRC, or some other algorithm. -** Users should not call this function as part of a message integrity -** check (call #CFE_SB_ValidateChecksum instead). -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not -** include a checksum field, then this routine will return a zero. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \return The checksum included in the software bus message header (if present), otherwise, -** returns a checksum value of zero. -**/ -uint16 CFE_SB_GetChecksum(CFE_MSG_Message_t *MsgPtr); - -/*****************************************************************************/ -/** -** \brief DEPRECATED:Calculates and sets the checksum of a software bus message -** \deprecated Use CFE_MSG_GenerateChecksum -** -** \par Description -** This routine calculates the checksum of a software bus message according -** to an implementation-defined algorithm. Then, it sets the checksum field -** in the message with the calculated value. The contents and location of -** this field will depend on the underlying implementation of software bus -** messages. It may be a checksum, a CRC, or some other algorithm. -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not -** include a checksum field, then this routine will do nothing. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -**/ -void CFE_SB_GenerateChecksum(CFE_MSG_Message_t *MsgPtr); - -/*****************************************************************************/ -/** -** \brief DEPRECATED:Validates the checksum of a software bus message. -** \deprecated Use CFE_MSG_ValidateChecksum -** -** \par Description -** This routine calculates the expected checksum of a software bus message -** according to an implementation-defined algorithm. Then, it checks the -** calculated value against the value in the message's checksum. If the -** checksums do not match, this routine will generate an event message -** reporting the error. -** -** \par Assumptions, External Events, and Notes: -** - If the underlying implementation of software bus messages does not -** include a checksum field this routine will always return false. -** -** \param[in] MsgPtr A pointer to the buffer that contains the software bus message. -** This must point to the first byte of the message header. -** -** \return Boolean checksum result -** \retval true The checksum field in the packet is valid. -** \retval false The checksum field in the packet is not valid or the message type is wrong. -**/ -bool CFE_SB_ValidateChecksum(CFE_MSG_Message_t *MsgPtr); -/**@}*/ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /** @defgroup CFEAPISBMessageID cFE Message ID APIs * @{ */ @@ -1290,23 +839,6 @@ static inline CFE_SB_MsgId_t CFE_SB_ValueToMsgId(CFE_SB_MsgId_Atom_t MsgIdValue) CFE_SB_MsgId_t Result = CFE_SB_MSGID_WRAP_VALUE(MsgIdValue); return Result; } - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** - * \brief Identifies packet type given message ID - - * - * Provides the packet type associated with the given message ID - * - * \return Packet type - * \retval #CFE_MSG_Type_Cmd Command packet type - * \retval #CFE_MSG_Type_Tlm Telemetry packet type - * \retval #CFE_MSG_Type_Invalid Invalid/unknown packet type - */ -uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId); -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /**@}*/ #endif /* CFE_SB_API_H */ diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h index 3aca7caaf..bd914c6a9 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -98,18 +98,6 @@ */ #define CFE_SB_INVALID_MSG_ID CFE_SB_MSGID_RESERVED -#ifndef CFE_OMIT_DEPRECATED_6_8 -/** - * \defgroup CFESBPktTypeDefs cFE SB Packet Type Defines - * \{ - */ -#define CFE_SB_PKTTYPE_INVALID \ - CFE_MSG_Type_Invalid /**< \brief #CFE_SB_GetPktType response if message type can not be determined */ -#define CFE_SB_PKTTYPE_CMD CFE_MSG_Type_Cmd /**< \brief #CFE_SB_GetPktType response for command packets */ -#define CFE_SB_PKTTYPE_TLM CFE_MSG_Type_Tlm /**< \brief #CFE_SB_GetPktType response for telemetry packets */ -/** \} */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /** * \brief Cast/Convert a generic CFE_ResourceId_t to a CFE_SB_PipeId_t */ @@ -142,28 +130,6 @@ typedef union CFE_SB_Msg long double LongDouble; /**< \brief Align to support Long Double */ } CFE_SB_Buffer_t; -#ifndef CFE_OMIT_DEPRECATED_6_8 - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_SB_Buffer_t CFE_SB_Msg_t; - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_MSG_CommandHeader_t CFE_SB_CmdHdr_t; - -/** \brief Deperecated type to minimize required changes */ -typedef CFE_MSG_TelemetryHeader_t CFE_SB_TlmHdr_t; - -#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t)) /**< \brief Size of command header */ -#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t)) /**< \brief Size of telemetry header */ - -/** \brief Pointer to an SB Message */ -typedef CFE_MSG_Message_t *CFE_SB_MsgPtr_t; - -/** \brief CFE_SB_MsgPayloadPtr_t defined as an opaque pointer to a message Payload portion */ -typedef uint8 *CFE_SB_MsgPayloadPtr_t; - -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /** \brief CFE_SB_ZeroCopyHandle_t to primitive type definition ** ** Software Zero Copy handle used in many SB APIs @@ -173,14 +139,5 @@ typedef struct struct CFE_SB_BufferD *BufDscPtr; /* abstract descriptor reference (internal use) */ } CFE_SB_ZeroCopyHandle_t; -#ifndef CFE_OMIT_DEPRECATED_6_8 - -#define CFE_SB_Default_Qos CFE_SB_DEFAULT_QOS /**< \deprecated use CFE_SB_DEFAULT_QOS */ - -#define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t)) /**< \brief Size of command header */ -#define CFE_SB_TLM_HDR_SIZE (sizeof(CFE_MSG_TelemetryHeader_t)) /**< \brief Size of telemetry header */ - -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - #endif /* CFE_SB_API_TYPEDEFS_H */ /*****************************************************************************/ diff --git a/modules/core_api/ut-stubs/src/ut_sb_stubs.c b/modules/core_api/ut-stubs/src/ut_sb_stubs.c index 296c18ed6..b5438734a 100644 --- a/modules/core_api/ut-stubs/src/ut_sb_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_sb_stubs.c @@ -287,146 +287,6 @@ int32 CFE_SB_GetPipeIdByName(CFE_SB_PipeId_t *PipeIdPtr, const char *PipeName) return status; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief CFE_SB_GetCmdCode stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_GetCmdCode. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns either the function code from command secondary header or 0. -** -******************************************************************************/ -uint16 CFE_SB_GetCmdCode(CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GetCmdCode), MsgPtr); - - int32 status; - uint16 cmdcode = 0; - - status = UT_DEFAULT_IMPL(CFE_SB_GetCmdCode); - - if (status != 0) - { - cmdcode = status; - } - else - { - cmdcode = CFE_SB_StubMsg_GetMetaData(MsgPtr)->CommandCode; - } - - return cmdcode; -} - -/*****************************************************************************/ -/** -** \brief CFE_SB_GetMsgId stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_GetMsgId. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns the entire stream ID from the primary header. -** -******************************************************************************/ -CFE_SB_MsgId_t CFE_SB_GetMsgId(const CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_GetMsgId), MsgPtr); - - CFE_SB_MsgId_t Result; - - UT_DEFAULT_IMPL(CFE_SB_GetMsgId); - - if (UT_Stub_CopyToLocal(UT_KEY(CFE_SB_GetMsgId), &Result, sizeof(Result)) < sizeof(Result)) - { - Result = CFE_SB_StubMsg_GetMetaData(MsgPtr)->MsgId; - } - - return Result; -} - -/*****************************************************************************/ -/** -** \brief DEPRECATED - CFE_SB_InitMsg stub function -** \deprecated -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_InitMsg. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** This function does not return a value. -** -******************************************************************************/ -void CFE_SB_InitMsg(void *MsgPtr, CFE_SB_MsgId_t MsgId, size_t Length, bool Clear) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_InitMsg), MsgPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_InitMsg), MsgId); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_InitMsg), Length); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_InitMsg), Clear); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_InitMsg); - - if (status >= 0) - { - CFE_SB_StubMsg_GetMetaData(MsgPtr)->MsgId = MsgId; - CFE_SB_StubMsg_GetMetaData(MsgPtr)->TotalLength = Length; - - UT_Stub_CopyToLocal(UT_KEY(CFE_SB_InitMsg), (uint8 *)MsgPtr, Length); - } -} - -/*****************************************************************************/ -/** -** \brief CFE_SB_RcvMsg stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_RcvMsg. By default it will return the TIMEOUT error response, -** unless the test setup sequence has indicated otherwise. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns CFE_SUCCESS or overridden unit test value -** -******************************************************************************/ -int32 CFE_SB_RcvMsg(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_RcvMsg), BufPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_RcvMsg), PipeId); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_RcvMsg), TimeOut); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_RcvMsg); - - if (status >= 0) - { - UT_Stub_CopyToLocal(UT_KEY(CFE_SB_RcvMsg), (uint8 *)BufPtr, sizeof(*BufPtr)); - } - - return status; -} - -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief CFE_SB_ReceiveBuffer stub function @@ -529,149 +389,6 @@ int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t Zer return status; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief CFE_SB_SendMsg stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_SendMsg. The user can adjust the response by setting -** the values in the SBSendMsgRtn structure prior to this function -** being called. If the value SBSendMsgRtn.count is greater than -** zero then the counter is decremented; if it then equals zero the -** return value is set to the user-defined value SBSendMsgRtn.value. -** CFE_SUCCESS is returned otherwise. Only EVS and TIME messages are -** handled directly by this function; other messages are passed to the -** unit test function, UT_ProcessSBMsg, for any further action. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns either a user-defined status flag or CFE_SUCCESS. -** -******************************************************************************/ -/* Only doing subset of total messages; -** NOTE: Currently does EVS, TIME -*/ -int32 CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_SendMsg), MsgPtr); - - int32 status = CFE_SUCCESS; - - /* - * Create a context entry so a hook function - * could do something useful with the message - */ - - status = UT_DEFAULT_IMPL(CFE_SB_SendMsg); - - if (status >= 0) - { - UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_SendMsg), &MsgPtr, sizeof(MsgPtr)); - } - - return status; -} - -/*****************************************************************************/ -/** -** \brief CFE_SB_SetCmdCode stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_SetCmdCode. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns either CFE_SB_WRONG_MSG_TYPE or CFE_SUCCESS. -** -******************************************************************************/ -int32 CFE_SB_SetCmdCode(CFE_MSG_Message_t *MsgPtr, uint16 CmdCode) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetCmdCode), MsgPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetCmdCode), CmdCode); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_SetCmdCode); - - if (status == 0) - { - CFE_SB_StubMsg_GetMetaData(MsgPtr)->CommandCode = CmdCode; - } - - return status; -} - -/*****************************************************************************/ -/** -** \brief CFE_SB_SetMsgId stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_SetMsgId. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** This function does not return a value. -** -******************************************************************************/ -void CFE_SB_SetMsgId(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetMsgId), MsgPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetMsgId), MsgId); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_SetMsgId); - - if (status == 0) - { - UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_SetMsgId), &MsgId, sizeof(MsgId)); - CFE_SB_StubMsg_GetMetaData(MsgPtr)->MsgId = MsgId; - } -} - -/*****************************************************************************/ -/** -** \brief CFE_SB_SetMsgTime stub function -** -** \par Description -** This function is used to mimic the response of the cFE SB function -** CFE_SB_SetMsgTime. It always returns CFE_SUCCESS. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns CFE_SUCCESS. -** -******************************************************************************/ -int32 CFE_SB_SetMsgTime(CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTime_t Time) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetMsgTime), MsgPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetMsgTime), Time); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_SetMsgTime); - - if (status == 0) - { - CFE_SB_StubMsg_GetMetaData(MsgPtr)->TimeStamp = Time; - } - - return status; -} -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief CFE_SB_SubscribeEx stub function @@ -794,44 +511,6 @@ void CFE_SB_TimeStampMsg(CFE_MSG_Message_t *MsgPtr) UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_TimeStampMsg), &MsgPtr, sizeof(MsgPtr)); } -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief CFE_SB_GetTotalMsgLength stub function -** -** \par Description -** This function is used as a placeholder for the cFE SB function -** CFE_SB_GetTotalMsgLength. It returns the user-defined value, -** UT_SB_TotalMsgLen. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns a user-defined status value, UT_SB_TotalMsgLen. -** -******************************************************************************/ -size_t CFE_SB_GetTotalMsgLength(const CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_GetTotalMsgLength), MsgPtr); - - int32 status; - uint16 result; - - status = UT_DEFAULT_IMPL_RC(CFE_SB_GetTotalMsgLength, -1); - - if (status >= 0) - { - result = status; - } - else - { - result = CFE_SB_StubMsg_GetMetaData(MsgPtr)->TotalLength; - } - return result; -} -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** ** \brief CFE_SB_CleanUpApp stub function @@ -958,50 +637,6 @@ int32 CFE_SB_Unsubscribe(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId) return status; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -/****************************************************************************** -** Function: CFE_SB_GetMsgTime() -** -** Purpose: -** Get the time field from a message. -** -** Arguments: -** MsgPtr - Pointer to a CFE_MSG_Message_t -** -** Return: -** Time field from message or -** Time value of zero for msgs that do not have a Time field in header -*/ -CFE_TIME_SysTime_t CFE_SB_GetMsgTime(CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GetMsgTime), MsgPtr); - - CFE_TIME_SysTime_t TimeFromMsg; - - UT_DEFAULT_IMPL(CFE_SB_GetMsgTime); - - if (UT_Stub_CopyToLocal(UT_KEY(CFE_SB_GetMsgTime), &TimeFromMsg, sizeof(CFE_TIME_SysTime_t)) != - sizeof(CFE_TIME_SysTime_t)) - { - TimeFromMsg = CFE_SB_StubMsg_GetMetaData(MsgPtr)->TimeStamp; - } - - return TimeFromMsg; - -} /* end CFE_SB_GetMsgTime */ - -bool CFE_SB_ValidateChecksum(CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ValidateChecksum), MsgPtr); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_ValidateChecksum); - - return (bool)status; -} -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - void *CFE_SB_GetUserData(CFE_MSG_Message_t *MsgPtr) { UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GetUserData), MsgPtr); @@ -1030,53 +665,6 @@ void *CFE_SB_GetUserData(CFE_MSG_Message_t *MsgPtr) return Result; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -void CFE_SB_SetTotalMsgLength(CFE_MSG_Message_t *MsgPtr, size_t TotalLength) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetTotalMsgLength), MsgPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_SetTotalMsgLength), TotalLength); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_SetTotalMsgLength); - - if (status == 0) - { - UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_SetTotalMsgLength), &TotalLength, sizeof(TotalLength)); - CFE_SB_StubMsg_GetMetaData(MsgPtr)->TotalLength = TotalLength; - } -} - -uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GetPktType), MsgId); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_GetPktType); - - return status; -} - -void CFE_SB_GenerateChecksum(CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GenerateChecksum), MsgPtr); - - UT_DEFAULT_IMPL(CFE_SB_GenerateChecksum); -} - -uint16 CFE_SB_GetChecksum(CFE_MSG_Message_t *MsgPtr) -{ - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GetChecksum), MsgPtr); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_GetChecksum); - - return status; -} -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - int32 CFE_SB_GetPipeOpts(CFE_SB_PipeId_t PipeId, uint8 *OptPtr) { UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_GetPipeOpts), PipeId); @@ -1177,20 +765,6 @@ CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t * return SBBufPtr; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -int32 CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopyPass), BufPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ZeroCopyPass), BufferHandle); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_ZeroCopyPass); - - return status; -} -#endif - int32 CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle) { UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopyReleasePtr), Ptr2Release); @@ -1202,17 +776,3 @@ int32 CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHan return status; } - -#ifndef CFE_OMIT_DEPRECATED_6_8 -int32 CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopySend), BufPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ZeroCopySend), BufferHandle); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_ZeroCopySend); - - return status; -} -#endif diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index f96ba031d..8e5c233d8 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -1441,34 +1441,6 @@ int32 CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount) return Status; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_SendMsg - See API and header file for details - */ -int32 CFE_SB_SendMsg(CFE_MSG_Message_t *MsgPtr) -{ - int32 Status = 0; - - Status = CFE_SB_TransmitMsg(MsgPtr, true); - - return Status; - -} /* end CFE_SB_SendMsg */ - -/* - * Function: CFE_SB_PassMsg - See API and header file for details - */ -int32 CFE_SB_PassMsg(CFE_MSG_Message_t *MsgPtr) -{ - int32 Status = 0; - - Status = CFE_SB_TransmitMsg(MsgPtr, false); - - return Status; - -} /* end CFE_SB_PassMsg */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /*****************************************************************************/ /** * \brief Internal routine to validate a transmit message before sending @@ -1812,13 +1784,6 @@ void CFE_SB_BroadcastBufferToRoute(CFE_SB_BufferD_t *BufDscPtr, CFE_SBR_RouteId_ } } -#ifndef CFE_OMIT_DEPRECATED_6_8 -int32 CFE_SB_RcvMsg(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut) -{ - return CFE_SB_ReceiveBuffer(BufPtr, PipeId, TimeOut); -} -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /* * Function: CFE_SB_ReceiveBuffer - See API and header file for details */ @@ -2244,31 +2209,3 @@ int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t Zer return Status; } - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_ZeroCopySend - See API and header file for details - */ -int32 CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - int32 Status = 0; - - Status = CFE_SB_TransmitBuffer(BufPtr, BufferHandle, true); - - return Status; - -} /* end CFE_SB_ZeroCopySend */ - -/* - * Function: CFE_SB_ZeroCopyPass - See API and header file for details - */ -int32 CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - int32 Status = 0; - - Status = CFE_SB_TransmitBuffer(BufPtr, BufferHandle, false); - - return Status; - -} /* end CFE_SB_ZeroCopyPass */ -#endif diff --git a/modules/sb/fsw/src/cfe_sb_msg_id_util.c b/modules/sb/fsw/src/cfe_sb_msg_id_util.c index 74efc5d30..9924a7a04 100644 --- a/modules/sb/fsw/src/cfe_sb_msg_id_util.c +++ b/modules/sb/fsw/src/cfe_sb_msg_id_util.c @@ -28,48 +28,6 @@ */ #include "cfe_sb_module_all.h" -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_GetMsgId - See API and header file for details - */ -CFE_SB_MsgId_t CFE_SB_GetMsgId(const CFE_MSG_Message_t *MsgPtr) -{ - CFE_SB_MsgId_t MsgId; - - /* Ignore return since no alternative action */ - CFE_MSG_GetMsgId(MsgPtr, &MsgId); - - return MsgId; - -} /* end CFE_SB_GetMsgId */ - -/* - * Function: CFE_SB_SetMsgId - See API and header file for details - */ -void CFE_SB_SetMsgId(CFE_MSG_Message_t *MsgPtr, CFE_SB_MsgId_t MsgId) -{ - - /* Ignore return, no alternate action */ - CFE_MSG_SetMsgId(MsgPtr, MsgId); - -} /* end CFE_SB_SetMsgId */ - -/* - * Function: CFE_SB_GetPktType - See API and header file for details - */ -uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId) -{ - - CFE_MSG_Type_t type; - - /* Ignores return, no alternate action */ - CFE_MSG_GetTypeFromMsgId(MsgId, &type); - - return type; - -} /* end CFE_SB_GetPktType */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /* * Function: CFE_SB_IsValidMsgId - See API and header file for details */ diff --git a/modules/sb/fsw/src/cfe_sb_priv.c b/modules/sb/fsw/src/cfe_sb_priv.c index 5c4e9a766..0df2d0fb3 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.c +++ b/modules/sb/fsw/src/cfe_sb_priv.c @@ -219,29 +219,6 @@ CFE_SB_DestinationD_t *CFE_SB_GetDestPtr(CFE_SBR_RouteId_t RouteId, CFE_SB_PipeI return destptr; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -/****************************************************************************** -** Function: CFE_SB_SetMsgSeqCnt() -** -** Purpose: -** SB internal function to set the sequence count of a message to a -** particular value. -** -** Arguments: -** MsgPtr : pointer to the message -** Count : sets the sequence count to this value -** -** Return: -** None -*/ -void CFE_SB_SetMsgSeqCnt(CFE_MSG_Message_t *MsgPtr, uint32 Count) -{ - - CFE_MSG_SetSequenceCount(MsgPtr, Count); - -} /* end CFE_SB_SetMsgSeqCnt */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /****************************************************************************** ** Function: CFE_SB_ValidateMsgId() ** diff --git a/modules/sb/fsw/src/cfe_sb_util.c b/modules/sb/fsw/src/cfe_sb_util.c index 20de113b3..b394e9ad8 100644 --- a/modules/sb/fsw/src/cfe_sb_util.c +++ b/modules/sb/fsw/src/cfe_sb_util.c @@ -37,18 +37,6 @@ #include -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_InitMsg - See API and header file for details - */ -void CFE_SB_InitMsg(void *MsgPtr, CFE_SB_MsgId_t MsgId, size_t Length, bool Clear) -{ - - CFE_MSG_Init((CFE_MSG_Message_t *)MsgPtr, MsgId, Length); - -} /* end CFE_SB_InitMsg */ -#endif - /****************************************************************************** ** Function: CFE_SB_MsgHdrSize() ** @@ -161,55 +149,6 @@ void CFE_SB_SetUserDataLength(CFE_MSG_Message_t *MsgPtr, size_t DataLength) } } /* end CFE_SB_SetUserDataLength */ -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_GetTotalMsgLength - See API and header file for details - */ -size_t CFE_SB_GetTotalMsgLength(const CFE_MSG_Message_t *MsgPtr) -{ - - CFE_MSG_Size_t size; - - CFE_MSG_GetSize(MsgPtr, &size); - - return size; - -} /* end CFE_SB_GetTotalMsgLength */ - -/* - * Function: CFE_SB_SetTotalMsgLength - See API and header file for details - */ -void CFE_SB_SetTotalMsgLength(CFE_MSG_Message_t *MsgPtr, size_t TotalLength) -{ - - CFE_MSG_SetSize(MsgPtr, TotalLength); - -} /* end CFE_SB_SetTotalMsgLength */ - -/* - * Function: CFE_SB_GetMsgTime - See API and header file for details - */ -CFE_TIME_SysTime_t CFE_SB_GetMsgTime(CFE_MSG_Message_t *MsgPtr) -{ - CFE_TIME_SysTime_t TimeFromMsg = {0}; - - CFE_MSG_GetMsgTime(MsgPtr, &TimeFromMsg); - - return TimeFromMsg; - -} /* end CFE_SB_GetMsgTime */ - -/* - * Function: CFE_SB_SetMsgTime - See API and header file for details - */ -int32 CFE_SB_SetMsgTime(CFE_MSG_Message_t *MsgPtr, CFE_TIME_SysTime_t NewTime) -{ - - return CFE_MSG_SetMsgTime(MsgPtr, NewTime); - -} /* end CFE_SB_SetMsgTime */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /* * Function: CFE_SB_TimeStampMsg - See API and header file for details */ @@ -219,78 +158,6 @@ void CFE_SB_TimeStampMsg(CFE_MSG_Message_t *MsgPtr) } /* end CFE_SB_TimeStampMsg */ -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_GetCmdCode - See API and header file for details - */ -uint16 CFE_SB_GetCmdCode(CFE_MSG_Message_t *MsgPtr) -{ - - CFE_MSG_FcnCode_t fc; - - CFE_MSG_GetFcnCode(MsgPtr, &fc); - - return fc; - -} /* end CFE_SB_GetCmdCode */ - -/* - * Function: CFE_SB_SetCmdCode - See API and header file for details - */ -int32 CFE_SB_SetCmdCode(CFE_MSG_Message_t *MsgPtr, uint16 CmdCode) -{ - - return CFE_MSG_SetFcnCode(MsgPtr, CmdCode); - -} /* end CFE_SB_SetCmdCode */ - -/* - * Function: CFE_SB_GetChecksum - See API and header file for details - */ -uint16 CFE_SB_GetChecksum(CFE_MSG_Message_t *MsgPtr) -{ - - CFE_MSG_Type_t type = CFE_MSG_Type_Invalid; - bool hassechdr = false; - - CFE_MSG_GetHasSecondaryHeader(MsgPtr, &hassechdr); - CFE_MSG_GetType(MsgPtr, &type); - - /* if msg type is telemetry or there is no secondary hdr... */ - if ((type == CFE_MSG_Type_Tlm) || (!hassechdr)) - { - return 0; - } /* end if */ - - /* Byte access for now to avoid error if secondary doesn't contain checksum */ - return MsgPtr->Byte[sizeof(CCSDS_SpacePacket_t) + 1]; - -} /* end CFE_SB_GetChecksum */ - -/* - * Function: CFE_SB_GenerateChecksum - See API and header file for details - */ -void CFE_SB_GenerateChecksum(CFE_MSG_Message_t *MsgPtr) -{ - - CFE_MSG_GenerateChecksum(MsgPtr); - -} /* end CFE_SB_GenerateChecksum */ - -/* - * Function: CFE_SB_ValidateChecksum - See API and header file for details - */ -bool CFE_SB_ValidateChecksum(CFE_MSG_Message_t *MsgPtr) -{ - bool isvalid = false; - - CFE_MSG_ValidateChecksum(MsgPtr, &isvalid); - - return isvalid; - -} /* end CFE_SB_ValidateChecksum */ -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - /* * Function: CFE_SB_MessageStringGet - See API and header file for details */ From f1bcbe550792f0b1d56a55eb7fb575ccf80275dd Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 17 Mar 2021 17:13:28 -0400 Subject: [PATCH 07/27] Fix #1185, Squash possible uninitialized variable false alarms --- modules/es/fsw/src/cfe_es_apps.c | 2 +- modules/sb/fsw/src/cfe_sb_api.c | 2 +- modules/time/fsw/src/cfe_time_api.c | 27 +++++++++++++-------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 1944e7153..4b7348a4c 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -660,7 +660,7 @@ int32 CFE_ES_AppCreate(CFE_ES_AppId_t *ApplicationIdPtr, const char *AppName, co { CFE_Status_t Status; CFE_ES_AppRecord_t *AppRecPtr; - CFE_ResourceId_t PendingResourceId; + CFE_ResourceId_t PendingResourceId = CFE_RESOURCEID_UNDEFINED; /* * The AppName must not be NULL diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index f96ba031d..33f59ff15 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -95,7 +95,7 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const char *Pi osal_id_t SysQueueId; int32 Status; CFE_SB_PipeD_t * PipeDscPtr; - CFE_ResourceId_t PendingPipeId; + CFE_ResourceId_t PendingPipeId = CFE_RESOURCEID_UNDEFINED; uint16 PendingEventId; char FullName[(OS_MAX_API_NAME * 2)]; diff --git a/modules/time/fsw/src/cfe_time_api.c b/modules/time/fsw/src/cfe_time_api.c index e1ad20845..3176e08ca 100644 --- a/modules/time/fsw/src/cfe_time_api.c +++ b/modules/time/fsw/src/cfe_time_api.c @@ -736,21 +736,20 @@ int32 CFE_TIME_UnregisterSynchCallback(CFE_TIME_SynchCallbackPtr_t CallbackFuncP if (Status == CFE_SUCCESS) { Status = CFE_ES_AppID_ToIndex(AppId, &AppIndex); - } - if (Status != CFE_SUCCESS) - { - /* Called from an invalid context */ - return Status; - } - if (AppIndex >= (sizeof(CFE_TIME_Global.SynchCallback) / sizeof(CFE_TIME_Global.SynchCallback[0])) || - CFE_TIME_Global.SynchCallback[AppIndex].Ptr != CallbackFuncPtr) - { - Status = CFE_TIME_CALLBACK_NOT_REGISTERED; - } - else - { - CFE_TIME_Global.SynchCallback[AppIndex].Ptr = NULL; + if (Status == CFE_SUCCESS) + { + + if (AppIndex >= (sizeof(CFE_TIME_Global.SynchCallback) / sizeof(CFE_TIME_Global.SynchCallback[0])) || + CFE_TIME_Global.SynchCallback[AppIndex].Ptr != CallbackFuncPtr) + { + Status = CFE_TIME_CALLBACK_NOT_REGISTERED; + } + else + { + CFE_TIME_Global.SynchCallback[AppIndex].Ptr = NULL; + } + } } return Status; From 360d0ca8b5ec4c05ee698709629ea30b43a8126b Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Thu, 18 Mar 2021 14:13:33 -0400 Subject: [PATCH 08/27] Fix #1187, Increment CreatePipeErrorCounter for all create pipe errors --- modules/sb/fsw/src/cfe_sb_api.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index f96ba031d..b48715856 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -211,19 +211,8 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const char *Pi } PendingPipeId = CFE_RESOURCEID_UNDEFINED; - /* - * If there is a relevant error counter, increment it now - * while the global data is locked. - */ - switch (PendingEventId) - { - case CFE_SB_CR_PIPE_BAD_ARG_EID: - ++CFE_SB_Global.HKTlmMsg.Payload.CreatePipeErrorCounter; - break; - default: - /* no counter */ - break; - } + /* Increment error counter for all errors */ + CFE_SB_Global.HKTlmMsg.Payload.CreatePipeErrorCounter++; } CFE_SB_UnlockSharedData(__func__, __LINE__); From 4cf48f196409855b0d52dfa1f17160e8ad348666 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Mon, 22 Mar 2021 09:49:22 -0400 Subject: [PATCH 09/27] Fix #1246, Typo in CFE_TBL_Validate AppName --- modules/tbl/fsw/src/cfe_tbl_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tbl/fsw/src/cfe_tbl_api.c b/modules/tbl/fsw/src/cfe_tbl_api.c index bab6fadb0..6ef711549 100644 --- a/modules/tbl/fsw/src/cfe_tbl_api.c +++ b/modules/tbl/fsw/src/cfe_tbl_api.c @@ -1114,7 +1114,7 @@ int32 CFE_TBL_Validate(CFE_TBL_Handle_t TblHandle) CFE_ES_AppId_t ThisAppId; CFE_TBL_RegistryRec_t * RegRecPtr; CFE_TBL_AccessDescriptor_t *AccessDescPtr; - char AppName[OS_MAX_API_NAME] = {"UNKNWON"}; + char AppName[OS_MAX_API_NAME] = {"UNKNOWN"}; /* Verify that this application has the right to perform operation */ Status = CFE_TBL_ValidateAccess(TblHandle, &ThisAppId); From 8c70e950b37bcee4dd35fcd1c62c7609f97e0d87 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 23 Mar 2021 10:25:01 -0400 Subject: [PATCH 10/27] Fix #1215, remove task registration calls Explicit task registration is no longer necessary, since all required actions can be done before invoking the entry point. This moves the invocation of CFE_PSP_AttachExceptions() from the registration function to the pre-entry function, this was the only remaining action in task registration. All references to task registration in code, docs, and tests are removed. --- docs/cFE Application Developers Guide.md | 100 +++++++++--------- docs/src/cfe_api.dox | 2 - .../cfe_testrunner/src/cfe_testrunner_main.c | 10 -- modules/core_api/fsw/inc/cfe_error.h | 5 +- modules/core_api/fsw/inc/cfe_es.h | 47 +------- modules/core_api/ut-stubs/src/ut_es_stubs.c | 53 ---------- .../ut-stubs/inc/ut_osprintf_stubs.h | 2 - .../ut-stubs/src/ut_osprintf_stubs.c | 3 - modules/es/fsw/src/cfe_es_api.c | 77 -------------- modules/es/fsw/src/cfe_es_apps.c | 16 ++- modules/es/fsw/src/cfe_es_backgroundtask.c | 8 -- modules/es/fsw/src/cfe_es_task.c | 10 -- modules/es/ut-coverage/es_UT.c | 40 ------- modules/evs/fsw/src/cfe_evs_task.c | 8 -- modules/evs/ut-coverage/evs_UT.c | 17 +-- modules/sb/fsw/src/cfe_sb_task.c | 8 -- modules/sb/ut-coverage/sb_UT.c | 15 --- modules/sb/ut-coverage/sb_UT.h | 15 --- modules/tbl/fsw/src/cfe_tbl_task.c | 11 -- modules/tbl/ut-coverage/tbl_UT.c | 12 --- modules/time/fsw/src/cfe_time_task.c | 7 -- modules/time/fsw/src/cfe_time_tone.c | 78 +++++++------- modules/time/ut-coverage/time_UT.c | 12 --- 23 files changed, 110 insertions(+), 446 deletions(-) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index 28ae5a10f..ac995d283 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -313,20 +313,20 @@ directory is described as a note under each folder. ![](.//media/cFE_Application_Developers_Guide_image6.png) -Each cFE core component is itself a modular entity, all of which work together to form the +Each cFE core component is itself a modular entity, all of which work together to form the complete cFE core executive. These modules are all contained under the `modules` subdirectory: | **Directory** | **Content** | |:------------------------|:------------------------------------------------------------------------------------------------------------------ | | `modules/core_api/` | Contains the public interface definition of the complete CFE core - public API/headers only, no implementation | | `modules/core_private/` | Contains the inter-module interface definition of the CFE core - internal API/headers only, no implementation | -| `modules/es/` | Implementation of the Executive Services (ES) core module - provides app and task management | -| `modules/evs/` | Implementation of the Event Services (EVS) core module - manages sending of events on behalf of other apps | -| `modules/fs/` | Implementation of the File Services (FS) core module - defines file-related functions | -| `modules/msg/` | Implementation of the Message (MSG) core module - defines message header manipulation/access routines | -| `modules/resourceid/` | Implementation of the Resource ID core module - maniplation/access of system resource IDs (AppID, PipeID, etc.) | -| `modules/sb/` | Implementation of the Software Bus (SB) core module - sends messages between applications | -| `modules/tbl/` | Implementation of the Table Services (TBL) core module - manages runtime tables | +| `modules/es/` | Implementation of the Executive Services (ES) core module - provides app and task management | +| `modules/evs/` | Implementation of the Event Services (EVS) core module - manages sending of events on behalf of other apps | +| `modules/fs/` | Implementation of the File Services (FS) core module - defines file-related functions | +| `modules/msg/` | Implementation of the Message (MSG) core module - defines message header manipulation/access routines | +| `modules/resourceid/` | Implementation of the Resource ID core module - maniplation/access of system resource IDs (AppID, PipeID, etc.) | +| `modules/sb/` | Implementation of the Software Bus (SB) core module - sends messages between applications | +| `modules/tbl/` | Implementation of the Table Services (TBL) core module - manages runtime tables | | `modules/time/` | Implementation of the Time Services (TIME) core module - manages timing and synchronization | **NOTE**: The modules contained here constitute the "reference" implementation of each module. The CMake build system also permits advanced users @@ -357,7 +357,7 @@ Each module directory is in turn divided into subdirectories as follows: In order for applications to use and call cFE service functions, the developer must include the appropriate header files in their source -code. +code. The cFE header files are split into several parts/sections, allowing application/libraries to individually select the parts they need. The @@ -373,11 +373,11 @@ naming convention is as follows: In general the files are scoped such that an application/library should only need to include the information it actually needs to use for the task it performs. For instance, if a tool needs to interpret a data file generated by CFE ES, only the `cfe_es_extern_typedefs.h` file should be required. To send commands or interpret telemetry, the -`cfe_es_msg.h` may be used. If a library builds upon data types or extends functions from the ES API, then the +`cfe_es_msg.h` may be used. If a library builds upon data types or extends functions from the ES API, then the `cfe_es_api_typedefs.h` header may be used. An "unqualified" header file (with no extra suffix) provides the complete runtime API definition for the component. -This includes all API function prototypes and is intended for use in C source files. The following API header files +This includes all API function prototypes and is intended for use in C source files. The following API header files are provided by cFE: | **Filename** | **Contents** | @@ -392,11 +392,11 @@ are provided by cFE: | cfe_time.h | cFE Time Service Interface | -**NOTE**: The files listed above provide function prototypes and are intended to be used by C source files +**NOTE**: The files listed above provide function prototypes and are intended to be used by C source files that contain code which needs to invoke the function(s) prototyped within them. When referencing the data types or macros from another header file, the targeted/qualified header should be used instead. -As a rule of thumb, files listed in the first table (with suffix) should be included from within other +As a rule of thumb, files listed in the first table (with suffix) should be included from within other headers, while files listed in the second table (without suffix) should be used by source files. Finally, to simplify application headers, a single "all-inclusive" cFE header is also provided: @@ -501,12 +501,12 @@ applications. ## 4.2 Best Practices ### 4.2.1 cFS Application Template -Applications designed to interface with the cFE should follow standard templates. +Applications designed to interface with the cFE should follow standard templates. Reference sample_app on Github for “live” example. | **Directory** | **Descriptions** | |:--------------------------------------|:-------------------------------------------------------------------------------------------------------------| -| fsw/ | All components which are used on/deployed to the actual target or define the interface to those components | +| fsw/ | All components which are used on/deployed to the actual target or define the interface to those components | | fsw/inc/ | Public/Interface headers for the component | | fsw/src/ | Source files and private headers for the component | | tables/ | Example/Initial table definitions | @@ -525,7 +525,7 @@ Reference sample_app on Github for “live” example. In addition to showing the standard structure of a cFS application, the sample_app also demonstrates how to interface with cFS libraries and table -services. +services. ### 4.2.2 Avoid "Endian-ness" Dependencies @@ -558,7 +558,7 @@ Examples of items that must be shared with other Applications include Message IDs and Message data structures. Inter- application communication should rely on the published interfaces described above (generally using the software bus) rather than directly calling functions internal to another -application. +application. Examples of items that do not need to be shared with other Applications include Table IDs, Table data structures, Event IDs and Pipe IDs. Tables are not @@ -595,9 +595,9 @@ found in the OSAL Library API documentation. ## 5.1 Application Registration -All cFE Applications must register immediately with ES when started. -This is accomplished with the CFE_ES_RegisterApp function and it -should be the first function called by a cFE Application's main task. +All cFE Applications are now automatically registered with ES before the +user-specified entry point is invoked. There is no specific registration +function to invoke as was necessary in older versions of cFE. ## 5.2 Application Names and IDs @@ -625,10 +625,11 @@ additional threads that are spawned by this thread are referred to as Child Tasks. There are a handful of functions provided by the Executive Services for controlling Child Tasks. The first is CFE_ES_CreateChildTask. This function spawns a Child Task that is -"owned" by the Main Task. Each of the Child Tasks must then register -with ES via the CFE_ES_RegisterChildTask function. The remaining -functions, CFE_ES_DeleteChildTask, CFE_ES_SuspendChildTask and -CFE_ES_ResumeChildTask can control the existence and execution of the +"owned" by the Main Task. This child task is automatically registered +with ES before invoking the entry point. + +The remaining functions, CFE_ES_DeleteChildTask, CFE_ES_SuspendChildTask +and CFE_ES_ResumeChildTask can control the existence and execution of the Child Task. All of these functions require the task ID that is returned by the CFE_ES_CreateChildTask function in order to identify the Child Task. Note that Child Tasks can only be created from an Application's @@ -736,7 +737,7 @@ osobjtab.c file for the processor. A binary semaphore can be created using the OS_BinSemCreate function. Upon success, the OS_BinSemCreate function sets the sem_id parameter to the ID of the newly-created resource. This ID is used in all other functions that use -the binary semaphore. +the binary semaphore. ``` int32 OS_BinSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME, @@ -780,10 +781,10 @@ implement a kind of handshake between its main task and its child task. ### 5.7.3.1 Counting Semaphore Functions -A counting semaphore can be created using the OS_CountSemCreate function. +A counting semaphore can be created using the OS_CountSemCreate function. Upon success, the OS_CountSemCreate function sets the sem_id parameter to the ID of the newly-created resource. This ID is used in all other functions that -use the binary semaphore. +use the binary semaphore. ``` int32 OS_CountSemCreate(uint32 *xxx_SEM_ID, const char *xxx_SEM_NAME, @@ -895,7 +896,7 @@ to the OSAL Library API). ## 5.8 Interrupt Handling -OSAL interrupt handling functions have been deprecated due to +OSAL interrupt handling functions have been deprecated due to platform dependencies, incomplete testing, and incomplete implementaion No longer supporting abstracted interrupt handling API from OSAL. Could @@ -1097,7 +1098,7 @@ int32 SAMPLE_TaskInit(void) { /* Critical Data Store already existed, we need to get a */ /* copy of its current contents to see if we can work use it */ - Status = CFE_ES_RestoreFromCDS(&SAMPLE_MyCDSDataType_t, + Status = CFE_ES_RestoreFromCDS(&SAMPLE_MyCDSDataType_t, SAMPLE_TaskData.MyCDSHandle); if (Status == CFE_SUCCESS) @@ -1165,7 +1166,7 @@ void SAMPLE_TaskMain(void) ### 5.10.4 Standard CRC Calculations There are many Applications that require a validation of received data or of -data in memory. This is usually done by a Cyclic Redundancy Check (CRC). +data in memory. This is usually done by a Cyclic Redundancy Check (CRC). There are many different ways to calculate a CRC. To help ensure that the calculation is done consistently for a mission, the Executive Services provides an API for a CRC calculation that can be used by all Applications on a mission. @@ -1269,7 +1270,7 @@ main execution loop. Applications can track performance of multiple sections of code, but must define a unique "performance id" (or "perfid") for each segment of code to monitor. Applications typically define these perfids in their xx_mission_cfg.h file. A common pattern for performance monitoring is -shown below. +shown below. ``` FILE: xx_app.c @@ -1280,9 +1281,6 @@ void XX_AppMain(void) CFE_SB_Buffer_t *SBBufPtr; int32 Result = CFE_SUCCESS; - /* Register application */ - Result = CFE_ES_RegisterApp(); - /* Performance Log (start time counter) */ CFE_ES_PerfLogEntry(XX_APPMAIN_PERF_ID); @@ -1773,7 +1771,7 @@ sizeof(CFE_MSG_CommandHeader_t) and sizeof(CFE_MSG_TelemetryHeader_t) respective It is important to note that some API calls require the presence of a particular header type and will return an error if the other header type -is present instead. The following section provides more detail. +is present instead. The following section provides more detail. ### 6.5.2 Setting Message Header Information @@ -1805,7 +1803,7 @@ The preference is to use CFE_MSG_SetSize and actual packet structure information when available. ### 6.5.2.1 Modifying Command Message Header Information -The most common update for command messages is to set the command code. +The most common update for command messages is to set the command code. This is done through the CFE_MSG_SetFcnCode() API call. This code is used to distinguish between multiple commands that share a Message ID. It is common practice for an application to have a single "CMD_MID" to capture @@ -1937,7 +1935,7 @@ a CFE_SB_NO_MESSAGE status code. After a message is received, the SB Message Header accessor functions (as described in Section 6.5.3) should be used to identify the message so that -the application can react to it appropriately. +the application can react to it appropriately. ## 6.8 Improving Message Transfer Performance for Large Messages @@ -2043,7 +2041,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ The following are recommended "best practices" for applications using EVS. 1. Applications should use the Software Bus for all communication with other applications. -2. Pipe depth and message limits are dependent on the entire software system. +2. Pipe depth and message limits are dependent on the entire software system. Consider both the receiving application and any sending application(s) when choosing those limits. 3. Applications shall always use AB API functions to read or manipulate the SB @@ -2051,7 +2049,7 @@ The following are recommended "best practices" for applications using EVS. 4. Applications should maintain a command counter and a command error counter in housekeeping telemetry. 5. Applications should support a "No-operation" command and a "Reset Counters" - command. + command. 6. Every application should have at least one pipe. # 7. Event Service Interface @@ -2072,7 +2070,7 @@ Child Task. Event messages are implemented as software bus messages. It is important for developers to note that Event Messages are not automatically sent as telemetry. A Telemetry Output (or equivalent) application must be -configured to downlink event messages if they need to be sent as telemetry. +configured to downlink event messages if they need to be sent as telemetry. ## 7.2 Event Types @@ -2129,7 +2127,7 @@ the short format does not include the text string portion of the message. Because of this, it is very important that Event Messages IDs be unique across an Application, including all Child Tasks. Unique message IDs will allow a message to be understood even in "short format" when the text -string is unavailable to provide supplemental information. +string is unavailable to provide supplemental information. ## 7.4 Event Service Registration @@ -2137,7 +2135,7 @@ Applications must register with the EVS in order to use cFE event services. If an application has registered with EVS, then all of its Child Tasks are also registered and able to send Event Messages. cFE libraries however are not able to register for EVS or send Event -Messages. +Messages. Event services include the sending and filtering of event messages. EVS registration is performed using the CFE_EVS_Register @@ -2384,7 +2382,7 @@ CFE_EVS_Unregister (); The following are recommended "best practices" for applications using EVS. 1. Event Message IDs should be unique across an application so that an - event can be identified even without text. + event can be identified even without text. 2. The "No Operation" command in an application should send an Information Event Message with the application's version number. 3. Abide by the guidance in Section 7.5.1 when creating event message @@ -2396,7 +2394,7 @@ The following are recommended "best practices" for applications using EVS. 5. Ensure that adequate debug messages are left in an application to allow debugging to occur in flight if necessary. When an application is complete, all remaining debug "printf" statements should be either - removed or converted to Debug event messages. + removed or converted to Debug event messages. # 8. Table Service Interface @@ -2511,7 +2509,7 @@ they wish to have created and the cFE responds with an Application unique Table Handle. An example of this process is shown in Section 8.5.1. It should be noted that the Table Services automatically makes the table name -processor specific by prepending the Application name to the given table name. +processor specific by prepending the Application name to the given table name. Therefore, after the above example is executed, Table Services would have added a table with the name “SAMPLE.MyTableName” to the Table Registry. If an Application is sharing a Table that is created by another Application, @@ -2781,13 +2779,13 @@ xx | |----xx_tbl.c | |----tables - | |----xx_table1.c + | |----xx_table1.c | |----platform_inc - |----xx_platform_cfg.h + |----xx_platform_cfg.h The xx_app.h file is included in this layout only because table handles are -typically stored in an application's AppData_t structure. +typically stored in an application's AppData_t structure. The file xx_tbldefs.h (sometimes just named xx_tbl.h) typically contains the structure definition of a single table entry. This file is included in the @@ -2798,7 +2796,7 @@ The xx_tbl.c file typically contains table-related utility functions. For instance, many applications define table initialization and validation functions in this file. -The xx_table1.c file is the source code for a table itself. +The xx_table1.c file is the source code for a table itself. The xx_platform_cfg.h file contains configuration parameters for applications, and there are typically several configuration parameters associated with tables. @@ -2896,7 +2894,7 @@ int32 XX_ValidateTable(void *TableData) { /* validate each entry of the table */ ... - } + } ... return Status; @@ -2939,7 +2937,7 @@ FILE: xx_platform_cfg.h #define XX_TABLE_ENTRY_COUNT 3 ``` -## 8.6 Building Tables +## 8.6 Building Tables In order to build application tables with the CMake build system, the "add_cfe_tables" command needs to be added to the CMakeLists.txt file. If the diff --git a/docs/src/cfe_api.dox b/docs/src/cfe_api.dox index cfeafb50b..e31d906c6 100644 --- a/docs/src/cfe_api.dox +++ b/docs/src/cfe_api.dox @@ -15,7 +15,6 @@
  • \ref CFEAPIESAppBehavior
      -
    • #CFE_ES_RegisterApp - \copybrief CFE_ES_RegisterApp
    • #CFE_ES_RunLoop - \copybrief CFE_ES_RunLoop
    • #CFE_ES_WaitForStartupSync - \copybrief CFE_ES_WaitForStartupSync
    • #CFE_ES_WaitForSystemState - \copybrief CFE_ES_WaitForSystemState @@ -33,7 +32,6 @@
  • \ref CFEAPIESChildTask
      -
    • #CFE_ES_RegisterChildTask - \copybrief CFE_ES_RegisterChildTask
    • #CFE_ES_CreateChildTask - \copybrief CFE_ES_CreateChildTask
    • #CFE_ES_DeleteChildTask - \copybrief CFE_ES_DeleteChildTask
    • #CFE_ES_ExitChildTask - \copybrief CFE_ES_ExitChildTask diff --git a/modules/cfe_testrunner/src/cfe_testrunner_main.c b/modules/cfe_testrunner/src/cfe_testrunner_main.c index bd0c32416..e9cd9c32d 100644 --- a/modules/cfe_testrunner/src/cfe_testrunner_main.c +++ b/modules/cfe_testrunner/src/cfe_testrunner_main.c @@ -64,16 +64,6 @@ void CFE_TestRunner_AppMain(void) int32 rc; uint32 RunStatus; - /* - ** Register the app with Executive services - */ - rc = CFE_ES_RegisterApp(); - if (rc != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("Error in CFE_ES_RegisterApp(): %08lx\n", (unsigned long)rc); - return; - } - /* * Delay until the system reaches "operational" state -- this is when all libs have initialized * and all apps have reached their RunLoop. diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 2e9331e0a..8bb60b995 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -438,7 +438,7 @@ typedef int32 CFE_Status_t; /** * @brief Application Register Error * - * Occurs when the #CFE_ES_RegisterApp fails. + * Occurs when a task cannot be registered in ES global tables * */ #define CFE_ES_ERR_APP_REGISTER ((CFE_Status_t)0xc4000017) @@ -950,9 +950,6 @@ typedef int32 CFE_Status_t; * @brief Bad Application ID * * The calling application does not have a legitimate Application ID. - * Most likely cause is a failure to register with the cFE via the - * #CFE_ES_RegisterApp function. - * */ #define CFE_TBL_ERR_BAD_APP_ID ((CFE_Status_t)0xcc00000A) diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 0a9ed536e..27750236f 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -341,7 +341,7 @@ CFE_Status_t CFE_ES_DeleteApp(CFE_ES_AppId_t AppID); ** \arg #CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR - \copybrief CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR ** ** -** \sa #CFE_ES_RunLoop, #CFE_ES_RegisterApp +** \sa #CFE_ES_RunLoop ** ******************************************************************************/ void CFE_ES_ExitApp(uint32 ExitStatus); @@ -367,7 +367,7 @@ void CFE_ES_ExitApp(uint32 ExitStatus); ** \retval true Application should continue running ** \retval false Application should not continue running ** -** \sa #CFE_ES_ExitApp, #CFE_ES_RegisterApp +** \sa #CFE_ES_ExitApp ** ******************************************************************************/ bool CFE_ES_RunLoop(uint32 *ExitStatus); @@ -436,23 +436,6 @@ CFE_Status_t CFE_ES_WaitForSystemState(uint32 MinSystemState, uint32 TimeOutMill ******************************************************************************/ void CFE_ES_WaitForStartupSync(uint32 TimeOutMilliseconds); -/*****************************************************************************/ -/** -** \brief Registers a cFE Application with the Executive Services -** -** \par Description -** This API registers the calling Application with the cFE. -** -** \par Assumptions, External Events, and Notes: -** NOTE: This function \b MUST be called before any other cFE API functions are called. -** -** \return Execution status, see \ref CFEReturnCodes -** -** \sa #CFE_ES_ExitApp, #CFE_ES_RunLoop -** -******************************************************************************/ -CFE_Status_t CFE_ES_RegisterApp(void); - /*****************************************************************************/ /** ** \ingroup CFEAPIESAppBehavior @@ -793,26 +776,6 @@ int32 CFE_ES_GetModuleInfo(CFE_ES_AppInfo_t *ModuleInfo, CFE_ResourceId_t Resour * @{ */ -/*****************************************************************************/ -/** -** \brief Registers a cFE Child task associated with a cFE Application -** -** \par Description -** This routine registers a cFE Child task and associates it with its parent -** cFE Application. -** -** \par Assumptions, External Events, and Notes: -** NOTE: This API \b MUST be called by the Child Task before any other cFE API calls are made. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_ES_ERR_CHILD_TASK_REGISTER \copybrief CFE_ES_ERR_CHILD_TASK_REGISTER -** -** \sa #CFE_ES_CreateChildTask, #CFE_ES_DeleteChildTask, #CFE_ES_ExitChildTask -** -******************************************************************************/ -CFE_Status_t CFE_ES_RegisterChildTask(void); - /*****************************************************************************/ /** ** \brief Creates a new task under an existing Application @@ -850,7 +813,7 @@ CFE_Status_t CFE_ES_RegisterChildTask(void); ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_CHILD_TASK_CREATE \copybrief CFE_ES_ERR_CHILD_TASK_CREATE ** -** \sa #CFE_ES_RegisterChildTask, #CFE_ES_DeleteChildTask, #CFE_ES_ExitChildTask +** \sa #CFE_ES_DeleteChildTask, #CFE_ES_ExitChildTask ** ******************************************************************************/ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *TaskName, @@ -930,7 +893,7 @@ CFE_Status_t CFE_ES_GetTaskName(char *TaskName, CFE_ES_TaskId_t TaskId, size_t B ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_NOT_IMPLEMENTED \copybrief CFE_ES_NOT_IMPLEMENTED ** -** \sa #CFE_ES_RegisterChildTask, #CFE_ES_CreateChildTask, #CFE_ES_ExitChildTask +** \sa #CFE_ES_CreateChildTask, #CFE_ES_ExitChildTask ** ******************************************************************************/ CFE_Status_t CFE_ES_DeleteChildTask(CFE_ES_TaskId_t TaskId); @@ -950,7 +913,7 @@ CFE_Status_t CFE_ES_DeleteChildTask(CFE_ES_TaskId_t TaskId); ** at all, it is assumed that the Task was either unregistered or ** this function was called from a cFE Application's main task. ** -** \sa #CFE_ES_RegisterChildTask, #CFE_ES_CreateChildTask, #CFE_ES_DeleteChildTask +** \sa #CFE_ES_CreateChildTask, #CFE_ES_DeleteChildTask ** ******************************************************************************/ void CFE_ES_ExitChildTask(void); diff --git a/modules/core_api/ut-stubs/src/ut_es_stubs.c b/modules/core_api/ut-stubs/src/ut_es_stubs.c index fcc138573..21c70c26c 100644 --- a/modules/core_api/ut-stubs/src/ut_es_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_es_stubs.c @@ -346,59 +346,6 @@ CFE_Status_t CFE_ES_GetAppName(char *AppName, CFE_ES_AppId_t AppId, size_t Buffe return status; } -/*****************************************************************************/ -/** -** \brief CFE_ES_RegisterApp stub function -** -** \par Description -** This function is used to mimic the response of the cFE ES function -** CFE_ES_RegisterApp. The user can adjust the response by setting -** the values in the ES_RegisterRtn structure prior to this function -** being called. If the value ES_RegisterRtn.count is greater than -** zero then the counter is decremented; if it then equals zero the -** return value is set to the user-defined value ES_RegisterRtn.value. -** CFE_SUCCESS is returned otherwise. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns either a user-defined status flag or CFE_SUCCESS. -** -******************************************************************************/ -int32 CFE_ES_RegisterApp(void) -{ - int32 status; - - status = UT_DEFAULT_IMPL(CFE_ES_RegisterApp); - - return status; -} - -/*****************************************************************************/ -/** -** \brief CFE_ES_RegisterChildTask stub function -** -** \par Description -** This function is used to mimic the response of the cFE ES function -** CFE_ES_RegisterChildTask. It always returns CFE_SUCCESS when called. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** Returns CFE_SUCCESS. -** -******************************************************************************/ -int32 CFE_ES_RegisterChildTask(void) -{ - int32 status = CFE_SUCCESS; - - status = UT_DEFAULT_IMPL(CFE_ES_RegisterChildTask); - - return status; -} - /*****************************************************************************/ /** ** \brief CFE_ES_WriteToSysLog stub function diff --git a/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h index a58c3c299..16d0377bb 100644 --- a/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h +++ b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h @@ -68,7 +68,6 @@ #define UT_OSP_ES_APP_STARTUP_OPEN 39 #define UT_OSP_COMMAND_PIPE 40 #define UT_OSP_APP_INIT 41 -#define UT_OSP_REGISTER_APP 42 #define UT_OSP_SHARED_LIBRARY_INIT 43 #define UT_OSP_DECOMPRESS_LIBRARY 44 #define UT_OSP_EXTRACT_FILENAME_CF 45 @@ -96,7 +95,6 @@ #define UT_OSP_STARTUP_SYNC_FAIL_2 67 #define UT_OSP_MODULE_UNLOAD_FAILED 68 #define UT_OSP_TASKEXIT_BAD_CONTEXT 69 -#define UT_OSP_BACKGROUND_REGISTER 70 #define UT_OSP_BACKGROUND_TAKE 71 #endif diff --git a/modules/core_private/ut-stubs/src/ut_osprintf_stubs.c b/modules/core_private/ut-stubs/src/ut_osprintf_stubs.c index 452cbb498..dcf28a370 100644 --- a/modules/core_private/ut-stubs/src/ut_osprintf_stubs.c +++ b/modules/core_private/ut-stubs/src/ut_osprintf_stubs.c @@ -46,8 +46,6 @@ const char *UT_OSP_MESSAGES[] = { [UT_OSP_MOUNT_VOLATILE] = "ES Startup: Error Mounting Volatile(RAM) Volume. EC = 0x%08X\n", /* CFE_ES_ExitApp: CORE Application CFE_ES Had a Runtime Error. */ [UT_OSP_CORE_RUNTIME] = "CFE_ES_ExitApp: CORE Application %s Had a Runtime Error.\n", - /* ES:Call to CFE_ES_RegisterApp Failed, RC = 0x~ */ - [UT_OSP_REGISTER_APP] = "ES:Call to CFE_ES_RegisterApp Failed, RC = 0x%08X\n", /* ES Startup: OS_TaskCreate error creating core App: CFE_TBL: EC = 0x~ */ [UT_OSP_CORE_APP_CREATE] = "ES Startup: OS_TaskCreate error creating core App: %s: EC = 0x%08X\n", /* ES Startup: Error returned when calling function: CFE_TBL_EarlyInit: EC = 0x~ */ @@ -161,6 +159,5 @@ const char *UT_OSP_MESSAGES[] = { [UT_OSP_RECORD_USED] = "ES Startup: Error: ES_TaskTable slot for ID %lx in use at task creation!\n", /* CFE_ES_ExitChildTask called from invalid task context */ [UT_OSP_TASKEXIT_BAD_CONTEXT] = "CFE_ES_ExitChildTask called from invalid task context\n", - [UT_OSP_BACKGROUND_REGISTER] = "CFE_ES: Background Task Failed to register: %08lx\n", [UT_OSP_BACKGROUND_TAKE] = "CFE_ES: Failed to take background sem: %08lx\n", }; diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index 78f9a6491..aadd7d0c1 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -639,44 +639,6 @@ void CFE_ES_WaitForStartupSync(uint32 TimeOutMilliseconds) CFE_ES_WaitForSystemState(CFE_ES_SystemState_OPERATIONAL, TimeOutMilliseconds); } -/* -** Function: - See API and header file for details -*/ -int32 CFE_ES_RegisterApp(void) -{ - int32 Result; - - CFE_ES_LockSharedData(__func__, __LINE__); - - /* - ** Register the task - */ - Result = OS_TaskRegister(); - - if (Result == OS_SUCCESS) - { - Result = CFE_SUCCESS; - } - else - { - /* - ** Cannot create a syslog entry here because it requires the task to - ** be registered - */ - Result = CFE_ES_ERR_APP_REGISTER; - } - - /* - ** Set the default exception environment - */ - CFE_PSP_SetDefaultExceptionEnvironment(); - - CFE_ES_UnlockSharedData(__func__, __LINE__); - - return (Result); - -} /* End of CFE_ES_RegisterApp() */ - /* ** Function: CFE_ES_GetAppIDByName - See API and header file for details */ @@ -1296,45 +1258,6 @@ int32 CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *TaskName, } /* End of CFE_ES_CreateChildTask() */ -/* -** Function: CFE_ES_RegisterChildTask - See API and header file for details -*/ -int32 CFE_ES_RegisterChildTask(void) -{ - int32 Result; - int32 ReturnCode; - - CFE_ES_LockSharedData(__func__, __LINE__); - - /* - ** Register the task with the OS - */ - Result = OS_TaskRegister(); - - if (Result != OS_SUCCESS) - { - /* - ** Cannot create a syslog entry here because it requires the task to - ** be registered - */ - ReturnCode = CFE_ES_ERR_CHILD_TASK_REGISTER; - } - else - { - ReturnCode = CFE_SUCCESS; - } - - /* - ** Set the default exception environment - */ - CFE_PSP_SetDefaultExceptionEnvironment(); - - CFE_ES_UnlockSharedData(__func__, __LINE__); - - return (ReturnCode); - -} /* End of CFE_ES_RegisterChildTask() */ - /* ** Function: CFE_ES_IncrementTaskCounter - See API and header file for details */ diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 1944e7153..8e7e9fc58 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -553,6 +553,18 @@ void CFE_ES_TaskEntryPoint(void) if (CFE_ES_GetTaskFunction(&RealEntryFunc) == CFE_SUCCESS && RealEntryFunc != NULL) { + /* + * Set the default exception environment, which should + * be done serialized (i.e. only one task at a time should + * call into CFE_PSP_SetDefaultExceptionEnvironment). + */ + CFE_ES_LockSharedData(__func__, __LINE__); + CFE_PSP_SetDefaultExceptionEnvironment(); + CFE_ES_UnlockSharedData(__func__, __LINE__); + + /* + * Call the actual task entry function + */ (*RealEntryFunc)(); } } @@ -565,8 +577,8 @@ void CFE_ES_TaskEntryPoint(void) ** ** Note that OSAL does not separate the action of creating and start a task, providing ** only OS_TaskCreate which does both. But there is a potential race condition if -** the real task code starts and calls e.g. CFE_ES_RegisterApp() or any other function -** that depends on having an AppID context, before its fully registered in the global app table. +** the real task code starts and calls any function that depends on having an AppID +** context before its fully registered in the global app table. ** ** Therefore this calls a dedicated CFE_ES_AppEntryPoint which then will wait until ** the task is fully registered in the global, before calling the actual app entry point. diff --git a/modules/es/fsw/src/cfe_es_backgroundtask.c b/modules/es/fsw/src/cfe_es_backgroundtask.c index 6410005db..df6581d37 100644 --- a/modules/es/fsw/src/cfe_es_backgroundtask.c +++ b/modules/es/fsw/src/cfe_es_backgroundtask.c @@ -111,14 +111,6 @@ void CFE_ES_BackgroundTask(void) OS_time_t LastTime; const CFE_ES_BackgroundJobEntry_t *JobPtr; - status = CFE_ES_RegisterChildTask(); - if (status != CFE_SUCCESS) - { - /* should never occur */ - CFE_ES_WriteToSysLog("CFE_ES: Background Task Failed to register: %08lx\n", (unsigned long)status); - return; - } - CFE_PSP_GetTime(&LastTime); while (true) diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index c559c6625..e689f5761 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -339,16 +339,6 @@ int32 CFE_ES_TaskInit(void) uint32 SizeofCfeSegment; cpuaddr CfeSegmentAddr; - /* - ** Register the Application - */ - Status = CFE_ES_RegisterApp(); - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("ES:Call to CFE_ES_RegisterApp Failed, RC = 0x%08X\n", (unsigned int)Status); - return (Status); - } - /* ** Initialize task command execution counters */ diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 67e48dc4f..6e28b8216 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -2199,15 +2199,6 @@ void TestTask(void) UT_Report(__FILE__, __LINE__, UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_COMMAND_PIPE]), "CFE_ES_TaskMain", "Command pipe error, UT_OSP_COMMAND_PIPE message"); - /* Test task main process loop with an initialization failure */ - ES_ResetUnitTest(); - UT_SetDefaultReturnValue(UT_KEY(OS_TaskRegister), OS_ERROR); - CFE_ES_TaskMain(); - UT_Report(__FILE__, __LINE__, UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_APP_INIT]), "CFE_ES_TaskMain", - "Task initialization fail, UT_OSP_APP_INIT message"); - UT_Report(__FILE__, __LINE__, UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_REGISTER_APP]), "CFE_ES_TaskMain", - "Task initialization fail, UT_OSP_REGISTER_APP message"); - /* Test task main process loop with bad checksum information */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_PSP_GetCFETextSegmentInfo), 1, -1); @@ -2236,12 +2227,6 @@ void TestTask(void) CFE_ES_TaskInit() == CFE_SUCCESS && CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF, "CFE_ES_TaskInit", "Checksum success, PR Path"); - /* Test task main process loop with a register app failure */ - ES_ResetUnitTest(); - UT_SetDefaultReturnValue(UT_KEY(OS_TaskRegister), OS_ERROR); - UT_Report(__FILE__, __LINE__, CFE_ES_TaskInit() == CFE_ES_ERR_APP_REGISTER, "CFE_ES_TaskInit", - "Register application fail"); - /* Test task main process loop with a with an EVS register failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(CFE_EVS_Register), 1, -1); @@ -3767,11 +3752,6 @@ void TestAPI(void) CFE_ES_RunLoop(&RunStatus) == true && UtAppRecPtr->AppState == CFE_ES_AppState_RUNNING, "CFE_ES_RunLoop", "Status change from initializing to run"); - /* Test successful CFE application registration */ - ES_ResetUnitTest(); - UT_Report(__FILE__, __LINE__, CFE_ES_RegisterApp() == CFE_SUCCESS, "CFE_ES_RegisterApp", - "Application registration successful"); - /* Test getting the cFE application and task ID by context */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, "UT", NULL, NULL); @@ -3981,17 +3961,6 @@ void TestAPI(void) UT_Report(__FILE__, __LINE__, UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_TASKEXIT_BAD_CONTEXT]), "CFE_ES_ExitChildTask", "Invalid context"); - /* Test registering a child task with an OS task register failure */ - ES_ResetUnitTest(); - UT_SetDefaultReturnValue(UT_KEY(OS_TaskRegister), OS_ERROR); - UT_Report(__FILE__, __LINE__, CFE_ES_RegisterChildTask() == CFE_ES_ERR_CHILD_TASK_REGISTER, - "CFE_ES_RegisterChildTask", "OS task register failed"); - - /* Test successfully registering a child task */ - ES_ResetUnitTest(); - UT_Report(__FILE__, __LINE__, CFE_ES_RegisterChildTask() == CFE_SUCCESS, "CFE_ES_RegisterChildTask", - "Register child task successful"); - /* Test successfully adding a time-stamped message to the system log that * must be truncated */ @@ -5287,15 +5256,6 @@ void TestBackground(void) CFE_ES_BackgroundCleanup(); UtAssert_True(UT_GetStubCount(UT_KEY(OS_BinSemDelete)) == 1, "CFE_ES_BackgroundCleanup - OS_BinSemDelete called"); - /* - * Test background task loop function - */ - ES_ResetUnitTest(); - UT_SetDeferredRetcode(UT_KEY(OS_TaskRegister), 1, -1); - CFE_ES_BackgroundTask(); - UT_Report(__FILE__, __LINE__, UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_BACKGROUND_REGISTER]), - "CFE_ES_BackgroundTask", "Failed to register error"); - /* * When testing the background task loop, it is normally an infinite loop, * so this is needed to set a condition for the loop to exit. diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index e225fc0e7..f7556cfbf 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -286,14 +286,6 @@ int32 CFE_EVS_TaskInit(void) int32 Status; CFE_ES_AppId_t AppID; - /* Register EVS application */ - Status = CFE_ES_RegisterApp(); - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("EVS:Call to CFE_ES_RegisterApp Failed:RC=0x%08X\n", (unsigned int)Status); - return Status; - } - /* Query and verify the AppID */ Status = CFE_ES_GetAppID(&AppID); if (Status != CFE_SUCCESS) diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index d863302a4..496742bbe 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -50,7 +50,7 @@ static const char *EVS_SYSLOG_MSGS[] = { "Event Log restored, n=%d, c=%d, f=%d, m=%d, o=%d\n", "EVS:Application Init Failed,RC=0x%08X\n", "EVS:Error reading cmd pipe,RC=0x%08X\n", - "EVS:Call to CFE_ES_RegisterApp Failed:RC=0x%08X\n", + NULL, /* old message removed - placeholder to maintain indices */ "EVS:Call to CFE_ES_GetAppID Failed:RC=0x%08X\n", "EVS:Call to CFE_EVS_Register Failed:RC=0x%08X\n", "EVS:Call to CFE_SB_CreatePipe Failed:RC=0x%08X\n", @@ -248,14 +248,6 @@ void Test_Init(void) ASSERT_TRUE(UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[8])); ASSERT_EQ(UT_EVS_EventBuf.EventID, CFE_EVS_ERR_MSGID_EID); - /* Test TaskMain with a register application failure */ - UT_InitData(); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterApp), 1, -1); - CFE_EVS_TaskMain(); - UT_Report(__FILE__, __LINE__, - UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[7]) && UT_GetStubCount(UT_KEY(CFE_ES_WriteToSysLog)) == 2, - "CFE_EVS_TaskMain", "Application initialization failure"); - /* Test early initialization with a get reset area failure */ UT_InitData(); UT_SetStatusBSPResetArea(-1, CFE_TIME_RESET_SIGNATURE, CFE_TIME_ToneSignalSelect_PRIMARY); @@ -325,13 +317,6 @@ void Test_Init(void) UT_Report(__FILE__, __LINE__, UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[4]), "CFE_EVS_EarlyInit", "Early initialization successful"); - /* Test task initialization where the application registration fails */ - UT_InitData(); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterApp), 1, -1); - CFE_EVS_TaskInit(); - UT_Report(__FILE__, __LINE__, UT_SyslogIsInHistory(EVS_SYSLOG_MSGS[9]), "CFE_EVS_TaskInit", - "Call to CFE_ES_RegisterApp failure"); - /* Test task initialization where event services fails */ UT_InitData(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetAppID), 2, -1); /* Set Failure in CFE_EVS_Register -> EVS_GetApp_ID */ diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 28dbcd3fe..344653070 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -138,14 +138,6 @@ int32 CFE_SB_AppInit(void) CFE_ES_MemPoolBuf_t TmpPtr; int32 Status; - Status = CFE_ES_RegisterApp(); - - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("SB:Call to CFE_ES_RegisterApp Failed:RC=0x%08X\n", (unsigned int)Status); - return Status; - } /* end if */ - /* Get the assigned Application ID for the SB Task */ CFE_ES_GetAppID(&CFE_SB_Global.AppId); diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 76d530570..82bcfa0c1 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -184,7 +184,6 @@ void SB_ResetUnitTest(void) */ void Test_SB_AppInit(void) { - SB_UT_ADD_SUBTEST(Test_SB_AppInit_ESRegFail); SB_UT_ADD_SUBTEST(Test_SB_AppInit_EVSRegFail); SB_UT_ADD_SUBTEST(Test_SB_AppInit_EVSSendEvtFail); SB_UT_ADD_SUBTEST(Test_SB_AppInit_CrPipeFail); @@ -194,20 +193,6 @@ void Test_SB_AppInit(void) SB_UT_ADD_SUBTEST(Test_SB_AppInit_PutPoolFail); } /* end Test_SB_AppInit */ -/* -** Test task init with ES_RegisterApp returning error -*/ -void Test_SB_AppInit_ESRegFail(void) -{ - int32 ForcedRtnVal = -1; - - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterApp), 1, ForcedRtnVal); - ASSERT_EQ(CFE_SB_AppInit(), ForcedRtnVal); - - EVTCNT(0); - -} /* end Test_SB_AppInit_ESRegFail */ - /* ** Test task init with EVS_Register returning error */ diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index f7f08f63a..c26dbb684 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -133,21 +133,6 @@ void Test_SB_App(void); ******************************************************************************/ void Test_SB_AppInit(void); -/*****************************************************************************/ -/** -** \brief Test task init with ES_RegisterApp returning error -** -** \par Description -** This function tests task init with ES_RegisterApp returning error. -** -** \par Assumptions, External Events, and Notes: -** None -** -** \returns -** This function does not return a value. -******************************************************************************/ -void Test_SB_AppInit_ESRegFail(void); - /*****************************************************************************/ /** ** \brief Test task init with EVS_Register returning error diff --git a/modules/tbl/fsw/src/cfe_tbl_task.c b/modules/tbl/fsw/src/cfe_tbl_task.c index 72a3dca1d..ee8356922 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.c +++ b/modules/tbl/fsw/src/cfe_tbl_task.c @@ -146,17 +146,6 @@ int32 CFE_TBL_TaskInit(void) { int32 Status; - /* - ** Register Table Services with ES - */ - Status = CFE_ES_RegisterApp(); - - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("TBL:Call to CFE_ES_RegisterApp Failed:RC=0x%08X\n", (unsigned int)Status); - return Status; - } /* end if */ - /* ** Initialize global Table Services data */ diff --git a/modules/tbl/ut-coverage/tbl_UT.c b/modules/tbl/ut-coverage/tbl_UT.c index 9f8921246..cad347f59 100644 --- a/modules/tbl/ut-coverage/tbl_UT.c +++ b/modules/tbl/ut-coverage/tbl_UT.c @@ -239,18 +239,6 @@ void Test_CFE_TBL_TaskInit(void) ExitCode == CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR && UT_GetStubCount(UT_KEY(CFE_ES_ExitApp)) == 1, "CFE_TBL_TaskMain", "Success"); - /* Test table services main entry point execution with a register - * application failure - */ - UT_InitData(); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterApp), 1, -1); - ExitCode = 0; - UT_SetDataBuffer(UT_KEY(CFE_ES_ExitApp), &ExitCode, sizeof(ExitCode), false); - CFE_TBL_TaskMain(); - UT_Report(__FILE__, __LINE__, - ExitCode == CFE_ES_RunStatus_CORE_APP_INIT_ERROR && UT_GetStubCount(UT_KEY(CFE_ES_ExitApp)) == 2, - "CFE_TBL_TaskMain", "Application register fail"); - /* Test successful table services core application initialization */ UT_InitData(); UT_Report(__FILE__, __LINE__, CFE_TBL_TaskInit() == CFE_SUCCESS, "CFE_TBL_TaskInit", "Success"); diff --git a/modules/time/fsw/src/cfe_time_task.c b/modules/time/fsw/src/cfe_time_task.c index e535be358..5994e31b7 100644 --- a/modules/time/fsw/src/cfe_time_task.c +++ b/modules/time/fsw/src/cfe_time_task.c @@ -198,13 +198,6 @@ int32 CFE_TIME_TaskInit(void) osal_id_t TimeBaseId; osal_id_t TimerId; - Status = CFE_ES_RegisterApp(); - if (Status != CFE_SUCCESS) - { - CFE_ES_WriteToSysLog("TIME:Call to CFE_ES_RegisterApp Failed:RC=0x%08X\n", (unsigned int)Status); - return Status; - } /* end if */ - Status = CFE_EVS_Register(NULL, 0, 0); if (Status != CFE_SUCCESS) { diff --git a/modules/time/fsw/src/cfe_time_tone.c b/modules/time/fsw/src/cfe_time_tone.c index 671c8456f..d03de6225 100644 --- a/modules/time/fsw/src/cfe_time_tone.c +++ b/modules/time/fsw/src/cfe_time_tone.c @@ -1148,9 +1148,9 @@ void CFE_TIME_Tone1HzISR(void) void CFE_TIME_Tone1HzTask(void) { - int32 Result = CFE_ES_RegisterChildTask(); + int32 Result; - while (Result == CFE_SUCCESS) + while (true) { /* Increment the Main task Execution Counter */ CFE_ES_IncrementTaskCounter(); @@ -1159,31 +1159,32 @@ void CFE_TIME_Tone1HzTask(void) ** Pend on semaphore given by tone ISR (above)... */ Result = OS_BinSemTake(CFE_TIME_Global.ToneSemaphore); + if (Result != OS_SUCCESS) + { + break; + } /* Start Performance Monitoring */ CFE_ES_PerfLogEntry(CFE_MISSION_TIME_TONE1HZTASK_PERF_ID); - if (Result == CFE_SUCCESS) - { - /* - ** Send tone signal command packet... - */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneSignalCmd.CmdHeader.Msg, false); + /* + ** Send tone signal command packet... + */ + CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneSignalCmd.CmdHeader.Msg, false); #if (CFE_MISSION_TIME_CFG_FAKE_TONE == true) - /* - ** If we are simulating the tone signal, also generate the message - ** to send the tone to other time clients. - ** (this is done by scheduler in non-fake mode) - */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneSendCmd.CmdHeader.Msg, false); + /* + ** If we are simulating the tone signal, also generate the message + ** to send the tone to other time clients. + ** (this is done by scheduler in non-fake mode) + */ + CFE_SB_TransmitMsg(&CFE_TIME_Global.ToneSendCmd.CmdHeader.Msg, false); #endif - /* - ** Maintain count of tone task wake-ups... - */ - CFE_TIME_Global.ToneTaskCounter++; - } + /* + ** Maintain count of tone task wake-ups... + */ + CFE_TIME_Global.ToneTaskCounter++; /* Exit performance monitoring */ CFE_ES_PerfLogExit(CFE_MISSION_TIME_TONE1HZTASK_PERF_ID); @@ -1343,9 +1344,9 @@ void CFE_TIME_Local1HzISR(void) void CFE_TIME_Local1HzTask(void) { - int32 Result = CFE_ES_RegisterChildTask(); + int32 Result; - while (Result == CFE_SUCCESS) + while (true) { /* Increment the Main task Execution Counter */ @@ -1355,31 +1356,32 @@ void CFE_TIME_Local1HzTask(void) ** Pend on the 1HZ semaphore (given by local 1Hz ISR)... */ Result = OS_BinSemTake(CFE_TIME_Global.LocalSemaphore); + if (Result != OS_SUCCESS) + { + break; + } /* Start Performance Monitoring */ CFE_ES_PerfLogEntry(CFE_MISSION_TIME_LOCAL1HZTASK_PERF_ID); - if (Result == CFE_SUCCESS) + /* + ** Send "info" event if we just started flywheel mode... + */ + if (CFE_TIME_Global.AutoStartFly) { - /* - ** Send "info" event if we just started flywheel mode... - */ - if (CFE_TIME_Global.AutoStartFly) - { - CFE_TIME_Global.AutoStartFly = false; + CFE_TIME_Global.AutoStartFly = false; - CFE_EVS_SendEvent(CFE_TIME_FLY_ON_EID, CFE_EVS_EventType_INFORMATION, "Start FLYWHEEL"); - } + CFE_EVS_SendEvent(CFE_TIME_FLY_ON_EID, CFE_EVS_EventType_INFORMATION, "Start FLYWHEEL"); + } - /* - ** Send 1Hz timing packet... - ** This used to be optional in previous CFE versions, but it is now required - ** as TIME subscribes to this itself to do state machine tasks. - */ - CFE_SB_TransmitMsg(&CFE_TIME_Global.Local1HzCmd.CmdHeader.Msg, false); + /* + ** Send 1Hz timing packet... + ** This used to be optional in previous CFE versions, but it is now required + ** as TIME subscribes to this itself to do state machine tasks. + */ + CFE_SB_TransmitMsg(&CFE_TIME_Global.Local1HzCmd.CmdHeader.Msg, false); - CFE_TIME_Global.LocalTaskCounter++; - } + CFE_TIME_Global.LocalTaskCounter++; /* Exit performance monitoring */ CFE_ES_PerfLogExit(CFE_MISSION_TIME_LOCAL1HZTASK_PERF_ID); diff --git a/modules/time/ut-coverage/time_UT.c b/modules/time/ut-coverage/time_UT.c index 42b8b412e..aac8c2d00 100644 --- a/modules/time/ut-coverage/time_UT.c +++ b/modules/time/ut-coverage/time_UT.c @@ -167,13 +167,6 @@ void Test_Main(void) CFE_TIME_TaskMain(); UT_Report(__FILE__, __LINE__, UT_SyslogIsInHistory(TIME_SYSLOG_MSGS[1]), "CFE_TIME_TaskMain", "Command pipe read error"); - - /* Test with an application initialization failure */ - UT_InitData(); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterApp), 1, -1); - CFE_TIME_TaskMain(); - UT_Report(__FILE__, __LINE__, UT_SyslogIsInHistory(TIME_SYSLOG_MSGS[2]), "CFE_TIME_TaskMain", - "Application initialization fail"); } /* @@ -211,11 +204,6 @@ void Test_Init(void) UT_InitData(); UT_Report(__FILE__, __LINE__, CFE_TIME_TaskInit() == CFE_SUCCESS, "CFE_TIME_Task_Init", "Successful"); - /* Test response to a failure to register an application */ - UT_InitData(); - UT_SetDeferredRetcode(UT_KEY(CFE_ES_RegisterApp), 1, -1); - UT_Report(__FILE__, __LINE__, CFE_TIME_TaskInit() == -1, "CFE_TIME_Task_Init", "Register application failure"); - /* Test response to a failure creating the first child task */ UT_InitData(); UT_SetDeferredRetcode(UT_KEY(CFE_ES_CreateChildTask), 1, -1); From e8f73aa5648e2e2c4ad0f71a2956bbfe16c09d5a Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 23 Mar 2021 11:57:41 -0400 Subject: [PATCH 11/27] Fix #1181, global variable cleanup Consolidate all ES global variables under a single CFE_ES_Global. Removes the separate CFE_ES_TaskData as well as some random pointers that were stored at global scope. All references adjusted accordingly (search and replace). --- modules/es/fsw/src/cfe_es_api.c | 11 +- modules/es/fsw/src/cfe_es_apps.c | 5 +- modules/es/fsw/src/cfe_es_backgroundtask.c | 4 +- modules/es/fsw/src/cfe_es_erlog.c | 38 +-- modules/es/fsw/src/cfe_es_global.h | 86 ++++++- modules/es/fsw/src/cfe_es_perf.c | 76 ++++-- modules/es/fsw/src/cfe_es_start.c | 48 ++-- modules/es/fsw/src/cfe_es_syslog.c | 39 +-- modules/es/fsw/src/cfe_es_task.c | 279 +++++++++++---------- modules/es/fsw/src/cfe_es_task.h | 75 ------ modules/es/ut-coverage/es_UT.c | 269 +++++++++++--------- 11 files changed, 500 insertions(+), 430 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index 78f9a6491..571d90114 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -49,10 +49,10 @@ int32 CFE_ES_GetResetType(uint32 *ResetSubtypePtr) { if (ResetSubtypePtr != NULL) { - *ResetSubtypePtr = CFE_ES_ResetDataPtr->ResetVars.ResetSubtype; + *ResetSubtypePtr = CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype; } - return (CFE_ES_ResetDataPtr->ResetVars.ResetType); + return (CFE_ES_Global.ResetDataPtr->ResetVars.ResetType); } /* End of CFE_ES_GetResetType() */ @@ -68,13 +68,14 @@ int32 CFE_ES_ResetCFE(uint32 ResetType) /* ** Increment the processor reset count */ - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount++; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount++; /* ** Before doing a Processor reset, check to see ** if the maximum number has been exceeded */ - if (CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount > CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount) + if (CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount > + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount) { CFE_ES_WriteToSysLog("POWER ON RESET due to max proc resets (Commanded).\n"); @@ -96,7 +97,7 @@ int32 CFE_ES_ResetCFE(uint32 ResetType) /* ** Update the reset variables */ - CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset = true; + CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset = true; /* ** Log the reset in the ER Log diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 1944e7153..5c17fbe74 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -993,7 +993,8 @@ bool CFE_ES_RunAppTableScan(uint32 ElapsedTime, void *Arg) /* * If the command count changes, then a scan becomes due immediately. */ - if (State->LastScanCommandCount == CFE_ES_TaskData.CommandCounter && State->BackgroundScanTimer > ElapsedTime) + if (State->LastScanCommandCount == CFE_ES_Global.TaskData.CommandCounter && + State->BackgroundScanTimer > ElapsedTime) { /* no action at this time, background scan is not due yet */ State->BackgroundScanTimer -= ElapsedTime; @@ -1008,7 +1009,7 @@ bool CFE_ES_RunAppTableScan(uint32 ElapsedTime, void *Arg) */ NumAppTimeouts = 0; State->BackgroundScanTimer = CFE_PLATFORM_ES_APP_SCAN_RATE; - State->LastScanCommandCount = CFE_ES_TaskData.CommandCounter; + State->LastScanCommandCount = CFE_ES_Global.TaskData.CommandCounter; State->PendingAppStateChanges = 0; /* diff --git a/modules/es/fsw/src/cfe_es_backgroundtask.c b/modules/es/fsw/src/cfe_es_backgroundtask.c index 6410005db..405ac575d 100644 --- a/modules/es/fsw/src/cfe_es_backgroundtask.c +++ b/modules/es/fsw/src/cfe_es_backgroundtask.c @@ -67,12 +67,12 @@ typedef struct const CFE_ES_BackgroundJobEntry_t CFE_ES_BACKGROUND_JOB_TABLE[] = { {/* ES app table background scan */ .RunFunc = CFE_ES_RunAppTableScan, - .JobArg = &CFE_ES_TaskData.BackgroundAppScanState, + .JobArg = &CFE_ES_Global.BackgroundAppScanState, .ActivePeriod = CFE_PLATFORM_ES_APP_SCAN_RATE / 4, .IdlePeriod = CFE_PLATFORM_ES_APP_SCAN_RATE}, {/* Performance Log Data Dump to file */ .RunFunc = CFE_ES_RunPerfLogDump, - .JobArg = &CFE_ES_TaskData.BackgroundPerfDumpState, + .JobArg = &CFE_ES_Global.BackgroundPerfDumpState, .ActivePeriod = CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY, .IdlePeriod = CFE_PLATFORM_ES_PERF_CHILD_MS_DELAY * 1000}, {/* Check for exceptions stored in the PSP */ diff --git a/modules/es/fsw/src/cfe_es_erlog.c b/modules/es/fsw/src/cfe_es_erlog.c index 5df6e9a98..7370df0bd 100644 --- a/modules/es/fsw/src/cfe_es_erlog.c +++ b/modules/es/fsw/src/cfe_es_erlog.c @@ -84,25 +84,25 @@ int32 CFE_ES_WriteToERLogWithContext(CFE_ES_LogEntryType_Enum_t EntryType, uint3 /* ** Try to clean up an invalid ER log index variable. */ - if (CFE_ES_ResetDataPtr->ERLogIndex >= CFE_PLATFORM_ES_ER_LOG_ENTRIES) + if (CFE_ES_Global.ResetDataPtr->ERLogIndex >= CFE_PLATFORM_ES_ER_LOG_ENTRIES) { - CFE_ES_ResetDataPtr->ERLogIndex = 0; + CFE_ES_Global.ResetDataPtr->ERLogIndex = 0; } - LogIdx = CFE_ES_ResetDataPtr->ERLogIndex; + LogIdx = CFE_ES_Global.ResetDataPtr->ERLogIndex; /* ** Now that the Local Index variable is set, increment the index for the next entry. */ - CFE_ES_ResetDataPtr->ERLogIndex++; - if (CFE_ES_ResetDataPtr->ERLogIndex >= CFE_PLATFORM_ES_ER_LOG_ENTRIES) + CFE_ES_Global.ResetDataPtr->ERLogIndex++; + if (CFE_ES_Global.ResetDataPtr->ERLogIndex >= CFE_PLATFORM_ES_ER_LOG_ENTRIES) { - CFE_ES_ResetDataPtr->ERLogIndex = 0; + CFE_ES_Global.ResetDataPtr->ERLogIndex = 0; } /* ** Clear out the log entry we are about to use. */ - EntryPtr = &CFE_ES_ResetDataPtr->ERLog[LogIdx]; + EntryPtr = &CFE_ES_Global.ResetDataPtr->ERLog[LogIdx]; memset(EntryPtr, 0, sizeof(*EntryPtr)); /* @@ -111,9 +111,9 @@ int32 CFE_ES_WriteToERLogWithContext(CFE_ES_LogEntryType_Enum_t EntryType, uint3 EntryPtr->BaseInfo.LogEntryType = EntryType; EntryPtr->BaseInfo.ResetType = ResetType; EntryPtr->BaseInfo.ResetSubtype = ResetSubtype; - EntryPtr->BaseInfo.BootSource = CFE_ES_ResetDataPtr->ResetVars.BootSource; - EntryPtr->BaseInfo.ProcessorResetCount = CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount; - EntryPtr->BaseInfo.MaxProcessorResetCount = CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount; + EntryPtr->BaseInfo.BootSource = CFE_ES_Global.ResetDataPtr->ResetVars.BootSource; + EntryPtr->BaseInfo.ProcessorResetCount = CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount; + EntryPtr->BaseInfo.MaxProcessorResetCount = CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount; /* ** Copy the ES Reset variables to the log (before they are modified by the log entry). @@ -140,7 +140,7 @@ int32 CFE_ES_WriteToERLogWithContext(CFE_ES_LogEntryType_Enum_t EntryType, uint3 /* ** Increment the number of ER log entries made */ - CFE_ES_ResetDataPtr->ERLogEntries++; + CFE_ES_Global.ResetDataPtr->ERLogEntries++; /* * Shared data update is complete @@ -188,7 +188,7 @@ bool CFE_ES_BackgroundERLogFileDataGetter(void *Meta, uint32 RecordNum, void **B if (RecordNum < CFE_PLATFORM_ES_ER_LOG_ENTRIES) { - EntryPtr = &CFE_ES_ResetDataPtr->ERLog[RecordNum]; + EntryPtr = &CFE_ES_Global.ResetDataPtr->ERLog[RecordNum]; /* First wipe the buffer before re-use */ memset(FileBufferPtr, 0, sizeof(*FileBufferPtr)); @@ -367,25 +367,25 @@ bool CFE_ES_RunExceptionScan(uint32 ElapsedTime, void *Arg) */ if (ResetType == 0) { - if (CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount >= - CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount) + if (CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount >= + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount) { CFE_ES_WriteToSysLog("Maximum Processor Reset count reached (%u)", - (unsigned int)CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount); + (unsigned int)CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount); ResetType = CFE_PSP_RST_TYPE_POWERON; } else { CFE_ES_WriteToSysLog("Processor Reset count not reached (%u/%u)", - (unsigned int)CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount, - (unsigned int)CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount); + (unsigned int)CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount, + (unsigned int)CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount); /* ** Update the reset variables */ - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount++; - CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset = true; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount++; + CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset = true; ResetType = CFE_PSP_RST_TYPE_PROCESSOR; } diff --git a/modules/es/fsw/src/cfe_es_global.h b/modules/es/fsw/src/cfe_es_global.h index bbe4ffb51..05369e76a 100644 --- a/modules/es/fsw/src/cfe_es_global.h +++ b/modules/es/fsw/src/cfe_es_global.h @@ -38,6 +38,7 @@ ** Includes */ #include "common_types.h" +#include "cfe_es_msg.h" #include "cfe_es_api_typedefs.h" #include "cfe_es_erlog_typedef.h" @@ -71,6 +72,61 @@ typedef struct uint32 NumJobsRunning; /**< Current Number of active jobs (updated by background task) */ } CFE_ES_BackgroundTaskState_t; +/* + * Background log dump state structure + * + * This structure is stored in global memory and keeps the state + * of the log dump from one iteration to the next. + * + * NOTE: This is used for log structures which are expected to be small + * enough so such that it is not necessary to throttle the file write or + * spread it over time. + * + * Therefore, the only thing necessary to be stored is whether there + * is a pending write request, and the data file name. + * + * Larger log files, such as the Perf log, must implement a state machine + * with a dedicated state data structure. + */ +typedef struct +{ + CFE_FS_FileWriteMetaData_t FileWrite; /**< FS state data - must be first */ + CFE_ES_ERLog_FileEntry_t EntryBuffer; /**< Temp holding area for record to write */ +} CFE_ES_BackgroundLogDumpGlobal_t; + +/* +** Type definition (ES task global data) +*/ +typedef struct +{ + /* + ** ES Task command interface counters + */ + uint8 CommandCounter; + uint8 CommandErrorCounter; + + /* + ** ES Task housekeeping telemetry + */ + CFE_ES_HousekeepingTlm_t HkPacket; + + /* + ** Single application telemetry + */ + CFE_ES_OneAppTlm_t OneAppPacket; + + /* + ** Memory statistics telemetry + */ + CFE_ES_MemStatsTlm_t MemStatsPacket; + + /* + ** ES Task operational data (not reported in housekeeping) + */ + CFE_SB_PipeId_t CmdPipe; + +} CFE_ES_TaskData_t; + /* ** Executive Services Global Memory Data ** This is the regular global data that is not preserved on a @@ -143,6 +199,31 @@ typedef struct CFE_ResourceId_t LastMemPoolId; CFE_ES_MemPoolRecord_t MemPoolTable[CFE_PLATFORM_ES_MAX_MEMORY_POOLS]; + /* + ** ES Task initialization data (not reported in housekeeping) + */ + CFE_ES_BackgroundLogDumpGlobal_t BackgroundERLogDumpState; + + /* + * Persistent state data associated with performance log data file writes + */ + CFE_ES_PerfDumpGlobal_t BackgroundPerfDumpState; + + /* + * Persistent state data associated with background app table scans + */ + CFE_ES_AppTableScanState_t BackgroundAppScanState; + + /* + * Task global data (formerly a separate global). + */ + CFE_ES_TaskData_t TaskData; + + /* + * Pointer to the Reset data that is preserved on a processor reset + */ + CFE_ES_ResetData_t *ResetDataPtr; + } CFE_ES_Global_t; /* @@ -150,11 +231,6 @@ typedef struct */ extern CFE_ES_Global_t CFE_ES_Global; -/* -** The Executive Services Nonvolatile Data declaration -*/ -extern CFE_ES_ResetData_t *CFE_ES_ResetDataPtr; - /* ** Functions used to lock/unlock shared data */ diff --git a/modules/es/fsw/src/cfe_es_perf.c b/modules/es/fsw/src/cfe_es_perf.c index 76935fa56..8b6c12b32 100644 --- a/modules/es/fsw/src/cfe_es_perf.c +++ b/modules/es/fsw/src/cfe_es_perf.c @@ -33,11 +33,6 @@ #include -/* -** Pointer to performance log in the reset area -*/ -CFE_ES_PerfData_t *Perf; - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Name: CFE_ES_SetupPerfVariables */ /* */ @@ -60,12 +55,13 @@ void CFE_ES_SetupPerfVariables(uint32 ResetType) uint8 Endian; } EndianCheck = {.Word = 0x0100}; - uint32 i; + uint32 i; + CFE_ES_PerfData_t *Perf; /* ** Set the pointer to the data area */ - Perf = (CFE_ES_PerfData_t *)&(CFE_ES_ResetDataPtr->Perf); + Perf = &CFE_ES_Global.ResetDataPtr->Perf; if (ResetType == CFE_PSP_RST_TYPE_PROCESSOR) { @@ -110,9 +106,15 @@ void CFE_ES_SetupPerfVariables(uint32 ResetType) /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ uint32 CFE_ES_GetPerfLogDumpRemaining(void) { - CFE_ES_PerfDumpGlobal_t *PerfDumpState = &CFE_ES_TaskData.BackgroundPerfDumpState; + CFE_ES_PerfDumpGlobal_t *PerfDumpState = &CFE_ES_Global.BackgroundPerfDumpState; CFE_ES_PerfDumpState_t CurrentState = PerfDumpState->CurrentState; uint32 Result; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; /* note this reads the data "live" without exclusion and as such it * may change even between checking the state and checking the value. @@ -147,7 +149,13 @@ uint32 CFE_ES_GetPerfLogDumpRemaining(void) int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data) { const CFE_ES_StartPerfCmd_Payload_t *CmdPtr = &data->Payload; - CFE_ES_PerfDumpGlobal_t * PerfDumpState = &CFE_ES_TaskData.BackgroundPerfDumpState; + CFE_ES_PerfDumpGlobal_t * PerfDumpState = &CFE_ES_Global.BackgroundPerfDumpState; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; /* Ensure there is no file write in progress before proceeding */ if (PerfDumpState->CurrentState == CFE_ES_PerfDumpState_IDLE && @@ -158,7 +166,7 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data) if ((CmdPtr->TriggerMode >= CFE_ES_PERF_TRIGGER_START) && (CmdPtr->TriggerMode < CFE_ES_PERF_MAX_MODES)) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; /* Taking lock here as this might be changing states from one active mode to another. * In that case, need to make sure that the log is not written to while resetting the counters. */ @@ -178,7 +186,7 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data) } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_PERF_STARTCMD_TRIG_ERR_EID, CFE_EVS_EventType_ERROR, "Cannot start collecting performance data, trigger mode (%d) out of range (%d to %d)", (int)CmdPtr->TriggerMode, (int)CFE_ES_PERF_TRIGGER_START, (int)CFE_ES_PERF_TRIGGER_END); @@ -186,7 +194,7 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data) } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_PERF_STARTCMD_ERR_EID, CFE_EVS_EventType_ERROR, "Cannot start collecting performance data,perf data write in progress"); } /* end if */ @@ -202,7 +210,13 @@ int32 CFE_ES_StartPerfDataCmd(const CFE_ES_StartPerfDataCmd_t *data) int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data) { const CFE_ES_StopPerfCmd_Payload_t *CmdPtr = &data->Payload; - CFE_ES_PerfDumpGlobal_t * PerfDumpState = &CFE_ES_TaskData.BackgroundPerfDumpState; + CFE_ES_PerfDumpGlobal_t * PerfDumpState = &CFE_ES_Global.BackgroundPerfDumpState; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; /* Ensure there is no file write in progress before proceeding */ /* note - also need to check the PendingState here, in case this command @@ -220,7 +234,7 @@ int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data) PerfDumpState->PendingState = CFE_ES_PerfDumpState_INIT; CFE_ES_BackgroundWakeup(); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_PERF_STOPCMD_EID, CFE_EVS_EventType_DEBUG, "Perf Stop Cmd Rcvd, will write %d entries.%dmS dly every %d entries", @@ -231,7 +245,7 @@ int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfDataCmd_t *data) else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_PERF_STOPCMD_ERR2_EID, CFE_EVS_EventType_ERROR, "Stop performance data cmd ignored,perf data write in progress"); } /* end if */ @@ -258,6 +272,12 @@ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg) int32 Status; CFE_FS_Header_t FileHdr; size_t BlockSize; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; /* * each time this background job is re-entered after a time delay, @@ -472,6 +492,12 @@ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg) int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMaskCmd_t *data) { const CFE_ES_SetPerfFilterMaskCmd_Payload_t *cmd = &data->Payload; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; if (cmd->FilterMaskNum < CFE_ES_PERF_32BIT_WORDS_IN_MASK) { @@ -482,7 +508,7 @@ int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMaskCmd_t *data) "Set Performance Filter Mask Cmd rcvd, num %u, val 0x%08X", (unsigned int)cmd->FilterMaskNum, (unsigned int)cmd->FilterMask); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } else { @@ -490,7 +516,7 @@ int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMaskCmd_t *data) "Performance Filter Mask Cmd Error,Index(%u)out of range(%u)", (unsigned int)cmd->FilterMaskNum, (unsigned int)CFE_ES_PERF_32BIT_WORDS_IN_MASK); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } return CFE_SUCCESS; @@ -504,6 +530,12 @@ int32 CFE_ES_SetPerfFilterMaskCmd(const CFE_ES_SetPerfFilterMaskCmd_t *data) int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMaskCmd_t *data) { const CFE_ES_SetPerfTrigMaskCmd_Payload_t *cmd = &data->Payload; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; if (cmd->TriggerMaskNum < CFE_ES_PERF_32BIT_WORDS_IN_MASK) { @@ -514,7 +546,7 @@ int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMaskCmd_t *data) "Set Performance Trigger Mask Cmd rcvd,num %u, val 0x%08X", (unsigned int)cmd->TriggerMaskNum, (unsigned int)cmd->TriggerMask); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } else { @@ -522,7 +554,7 @@ int32 CFE_ES_SetPerfTriggerMaskCmd(const CFE_ES_SetPerfTriggerMaskCmd_t *data) "Performance Trigger Mask Cmd Error,Index(%u)out of range(%u)", (unsigned int)cmd->TriggerMaskNum, (unsigned int)CFE_ES_PERF_32BIT_WORDS_IN_MASK); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } return CFE_SUCCESS; @@ -555,6 +587,12 @@ void CFE_ES_PerfLogAdd(uint32 Marker, uint32 EntryExit) { CFE_ES_PerfDataEntry_t EntryData; uint32 DataEnd; + CFE_ES_PerfData_t * Perf; + + /* + ** Set the pointer to the data area + */ + Perf = &CFE_ES_Global.ResetDataPtr->Perf; /* * If the global state is idle, exit immediately without locking or doing anything diff --git a/modules/es/fsw/src/cfe_es_start.c b/modules/es/fsw/src/cfe_es_start.c index c88b808d8..0d65c3db3 100644 --- a/modules/es/fsw/src/cfe_es_start.c +++ b/modules/es/fsw/src/cfe_es_start.c @@ -60,11 +60,6 @@ static int32 CFE_ES_MainTaskSyncDelay(uint32 AppStateId, uint32 TimeOutMilliseco */ CFE_ES_Global_t CFE_ES_Global; -/* -** Pointer to the Reset data that is preserved on a processor reset -*/ -CFE_ES_ResetData_t *CFE_ES_ResetDataPtr; - /***************************************************************************/ /* ** Code @@ -96,8 +91,9 @@ void CFE_ES_Main(uint32 StartType, uint32 StartSubtype, uint32 ModeId, const cha ReturnCode = OS_MutSemCreate(&(CFE_ES_Global.SharedDataMutex), "ES_DATA_MUTEX", 0); if (ReturnCode != OS_SUCCESS) { - CFE_ES_SysLogWrite_Unsync("ES Startup: Error: ES Shared Data Mutex could not be created. RC=0x%08X\n", - (unsigned int)ReturnCode); + /* Cannot use SysLog here, since that requires the reset area to be set up */ + OS_printf("ES Startup: Error: ES Shared Data Mutex could not be created. RC=0x%08X\n", + (unsigned int)ReturnCode); /* ** Delay to allow the message to be read @@ -309,12 +305,12 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo return; } - CFE_ES_ResetDataPtr = (CFE_ES_ResetData_t *)ResetDataAddr; + CFE_ES_Global.ResetDataPtr = (CFE_ES_ResetData_t *)ResetDataAddr; /* ** Record the BootSource (bank) so it will be valid in the ER log entries. */ - CFE_ES_ResetDataPtr->ResetVars.BootSource = BootSource; + CFE_ES_Global.ResetDataPtr->ResetVars.BootSource = BootSource; /* ** Determine how the system was started. The choices are: @@ -331,8 +327,8 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo /* ** Record the reset type and subtype */ - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = StartSubtype; - CFE_ES_ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_POWERON; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype = StartSubtype; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_POWERON; /* ** Log the power-on reset. @@ -359,9 +355,9 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo /* ** Initialize all reset counters. */ - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = 0; - CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount = CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS; - CFE_ES_Global.DebugVars.DebugFlag = 0; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount = CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS; + CFE_ES_Global.DebugVars.DebugFlag = 0; } else if (StartType == CFE_PSP_RST_TYPE_PROCESSOR) { @@ -369,21 +365,21 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo ** If a Processor reset was not commanded, it must be a watchdog or other non-commanded reset ** Log the reset before updating any reset variables. */ - if (CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset != true) + if (CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset != true) { - CFE_ES_ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_PROCESSOR; - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount++; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_PROCESSOR; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount++; /* ** When coming up from a Processor reset that was not caused by ES, check to see ** if the maximum number has been exceeded */ - if (CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount > - CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount) + if (CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount > + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount) { if (StartSubtype == CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND) { - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND; CFE_ES_SysLogWrite_Unsync("POWER ON RESET due to max proc resets (HW Spec Cmd).\n"); /* @@ -395,7 +391,7 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo } else { - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_WATCHDOG; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_WATCHDOG; CFE_ES_SysLogWrite_Unsync("POWER ON RESET due to max proc resets (Watchdog).\n"); /* @@ -419,7 +415,7 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo { if (StartSubtype == CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND) { - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND; CFE_ES_SysLogWrite_Unsync("PROCESSOR RESET due to Hardware Special Command (HW Spec Cmd).\n"); /* @@ -430,7 +426,7 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo } else { - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_WATCHDOG; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype = CFE_PSP_RST_SUBTYPE_HW_WATCHDOG; CFE_ES_SysLogWrite_Unsync("PROCESSOR RESET due to Watchdog (Watchdog).\n"); /* @@ -450,8 +446,8 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo */ else { - CFE_ES_ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_PROCESSOR; - CFE_ES_ResetDataPtr->ResetVars.ResetSubtype = StartSubtype; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = CFE_PSP_RST_TYPE_PROCESSOR; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype = StartSubtype; } /* @@ -463,7 +459,7 @@ void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, uint32 Bo /* ** Clear the commanded reset flag, in case a watchdog happens. */ - CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset = false; + CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset = false; } /* diff --git a/modules/es/fsw/src/cfe_es_syslog.c b/modules/es/fsw/src/cfe_es_syslog.c index 3d203e9f2..7f0376872 100644 --- a/modules/es/fsw/src/cfe_es_syslog.c +++ b/modules/es/fsw/src/cfe_es_syslog.c @@ -84,9 +84,9 @@ void CFE_ES_SysLogClear_Unsync(void) * by simply zeroing out the indices will cover it. */ - CFE_ES_ResetDataPtr->SystemLogWriteIdx = 0; - CFE_ES_ResetDataPtr->SystemLogEndIdx = 0; - CFE_ES_ResetDataPtr->SystemLogEntryNum = 0; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogEntryNum = 0; } /* End of CFE_ES_SysLogClear_Unsync() */ @@ -102,8 +102,8 @@ void CFE_ES_SysLogReadStart_Unsync(CFE_ES_SysLogReadBuffer_t *Buffer) size_t EndIdx; size_t TotalSize; - ReadIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; - EndIdx = CFE_ES_ResetDataPtr->SystemLogEndIdx; + ReadIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; + EndIdx = CFE_ES_Global.ResetDataPtr->SystemLogEndIdx; TotalSize = EndIdx; /* @@ -114,7 +114,7 @@ void CFE_ES_SysLogReadStart_Unsync(CFE_ES_SysLogReadBuffer_t *Buffer) { ++ReadIdx; --TotalSize; - if (CFE_ES_ResetDataPtr->SystemLog[ReadIdx - 1] == '\n') + if (CFE_ES_Global.ResetDataPtr->SystemLog[ReadIdx - 1] == '\n') { break; } @@ -173,10 +173,10 @@ int32 CFE_ES_SysLogAppend_Unsync(const char *LogString) * EndIdx -> indicates the entire size of the buffer * * Keeping them in local stack variables allows more efficient modification, - * since CFE_ES_ResetDataPtr may point directly into a slower NVRAM space. + * since CFE_ES_Global.ResetDataPtr may point directly into a slower NVRAM space. */ - WriteIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; - EndIdx = CFE_ES_ResetDataPtr->SystemLogEndIdx; + WriteIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; + EndIdx = CFE_ES_Global.ResetDataPtr->SystemLogEndIdx; /* * Check if the log message plus will fit between @@ -189,7 +189,7 @@ int32 CFE_ES_SysLogAppend_Unsync(const char *LogString) */ if ((WriteIdx + MessageLen) > CFE_PLATFORM_ES_SYSTEM_LOG_SIZE) { - if (CFE_ES_ResetDataPtr->SystemLogMode == CFE_ES_LogMode_OVERWRITE) + if (CFE_ES_Global.ResetDataPtr->SystemLogMode == CFE_ES_LogMode_OVERWRITE) { /* In "overwrite" mode, start back at the beginning of the buffer */ EndIdx = WriteIdx; @@ -219,7 +219,7 @@ int32 CFE_ES_SysLogAppend_Unsync(const char *LogString) /* * Copy the message in, EXCEPT for the last char which is probably a newline */ - memcpy(&CFE_ES_ResetDataPtr->SystemLog[WriteIdx], LogString, MessageLen - 1); + memcpy(&CFE_ES_Global.ResetDataPtr->SystemLog[WriteIdx], LogString, MessageLen - 1); WriteIdx += MessageLen; /* @@ -227,7 +227,7 @@ int32 CFE_ES_SysLogAppend_Unsync(const char *LogString) * This would have been enforced already except in cases where * the message got truncated. */ - CFE_ES_ResetDataPtr->SystemLog[WriteIdx - 1] = '\n'; + CFE_ES_Global.ResetDataPtr->SystemLog[WriteIdx - 1] = '\n'; /* * Keep track of the buffer endpoint for future reference @@ -240,9 +240,9 @@ int32 CFE_ES_SysLogAppend_Unsync(const char *LogString) /* * Export updated index values to the reset area for next time. */ - CFE_ES_ResetDataPtr->SystemLogWriteIdx = WriteIdx; - CFE_ES_ResetDataPtr->SystemLogEndIdx = EndIdx; - ++CFE_ES_ResetDataPtr->SystemLogEntryNum; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = WriteIdx; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = EndIdx; + ++CFE_ES_Global.ResetDataPtr->SystemLogEntryNum; } return (ReturnCode); @@ -323,7 +323,7 @@ void CFE_ES_SysLogReadData(CFE_ES_SysLogReadBuffer_t *Buffer) break; } - memcpy(&Buffer->Data[Buffer->BlockSize], &CFE_ES_ResetDataPtr->SystemLog[Buffer->LastOffset], BlockSize); + memcpy(&Buffer->Data[Buffer->BlockSize], &CFE_ES_Global.ResetDataPtr->SystemLog[Buffer->LastOffset], BlockSize); Buffer->BlockSize += BlockSize; Buffer->LastOffset += BlockSize; @@ -343,8 +343,8 @@ int32 CFE_ES_SysLogSetMode(CFE_ES_LogMode_Enum_t Mode) if ((Mode == CFE_ES_LogMode_OVERWRITE) || (Mode == CFE_ES_LogMode_DISCARD)) { - CFE_ES_ResetDataPtr->SystemLogMode = Mode; - Status = CFE_SUCCESS; + CFE_ES_Global.ResetDataPtr->SystemLogMode = Mode; + Status = CFE_SUCCESS; } else { @@ -544,7 +544,8 @@ int32 CFE_ES_SysLogDump(const char *Filename) else { CFE_EVS_SendEvent(CFE_ES_SYSLOG2_EID, CFE_EVS_EventType_DEBUG, "%s written:Size=%lu,Entries=%u", Filename, - (unsigned long)TotalSize, (unsigned int)CFE_ES_TaskData.HkPacket.Payload.SysLogEntries); + (unsigned long)TotalSize, + (unsigned int)CFE_ES_Global.TaskData.HkPacket.Payload.SysLogEntries); Status = CFE_SUCCESS; } diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index c559c6625..c21358f77 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -45,10 +45,13 @@ /* ** Defines */ -#define CFE_ES_PERF_TRIGGERMASK_INT_SIZE (sizeof(CFE_ES_ResetDataPtr->Perf.MetaData.TriggerMask) / sizeof(uint32)) -#define CFE_ES_PERF_TRIGGERMASK_EXT_SIZE (sizeof(CFE_ES_TaskData.HkPacket.Payload.PerfTriggerMask) / sizeof(uint32)) -#define CFE_ES_PERF_FILTERMASK_INT_SIZE (sizeof(CFE_ES_ResetDataPtr->Perf.MetaData.FilterMask) / sizeof(uint32)) -#define CFE_ES_PERF_FILTERMASK_EXT_SIZE (sizeof(CFE_ES_TaskData.HkPacket.Payload.PerfFilterMask) / sizeof(uint32)) +#define CFE_ES_PERF_TRIGGERMASK_INT_SIZE \ + (sizeof(CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask) / sizeof(uint32)) +#define CFE_ES_PERF_TRIGGERMASK_EXT_SIZE \ + (sizeof(CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask) / sizeof(uint32)) +#define CFE_ES_PERF_FILTERMASK_INT_SIZE (sizeof(CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask) / sizeof(uint32)) +#define CFE_ES_PERF_FILTERMASK_EXT_SIZE \ + (sizeof(CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask) / sizeof(uint32)) /* ** This define should be put in the OS API headers -- Right now it matches what the OS API uses @@ -124,7 +127,7 @@ void CFE_ES_TaskMain(void) /* ** Wait for the next Software Bus message. */ - Status = CFE_SB_ReceiveBuffer(&SBBufPtr, CFE_ES_TaskData.CmdPipe, CFE_SB_PEND_FOREVER); + Status = CFE_SB_ReceiveBuffer(&SBBufPtr, CFE_ES_Global.TaskData.CmdPipe, CFE_SB_PEND_FOREVER); /* ** Performance Time Stamp Entry @@ -352,19 +355,19 @@ int32 CFE_ES_TaskInit(void) /* ** Initialize task command execution counters */ - CFE_ES_TaskData.CommandCounter = 0; - CFE_ES_TaskData.CommandErrorCounter = 0; + CFE_ES_Global.TaskData.CommandCounter = 0; + CFE_ES_Global.TaskData.CommandErrorCounter = 0; /* ** Initialize systemlog to default Power On or Processor Reset mode */ if (CFE_ES_GetResetType(NULL) == CFE_PSP_RST_TYPE_POWERON) { - CFE_ES_ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE; + CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_POR_SYSLOG_MODE; } else { - CFE_ES_ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE; + CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_PLATFORM_ES_DEFAULT_PR_SYSLOG_MODE; } /* @@ -380,25 +383,25 @@ int32 CFE_ES_TaskInit(void) /* ** Initialize housekeeping packet (clear user data area) */ - CFE_MSG_Init(&CFE_ES_TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_HK_TLM_MID), - sizeof(CFE_ES_TaskData.HkPacket)); + CFE_MSG_Init(&CFE_ES_Global.TaskData.HkPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_HK_TLM_MID), + sizeof(CFE_ES_Global.TaskData.HkPacket)); /* ** Initialize single application telemetry packet */ - CFE_MSG_Init(&CFE_ES_TaskData.OneAppPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_APP_TLM_MID), - sizeof(CFE_ES_TaskData.OneAppPacket)); + CFE_MSG_Init(&CFE_ES_Global.TaskData.OneAppPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_APP_TLM_MID), + sizeof(CFE_ES_Global.TaskData.OneAppPacket)); /* ** Initialize memory pool statistics telemetry packet */ - CFE_MSG_Init(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_MEMSTATS_TLM_MID), - sizeof(CFE_ES_TaskData.MemStatsPacket)); + CFE_MSG_Init(&CFE_ES_Global.TaskData.MemStatsPacket.TlmHeader.Msg, CFE_SB_ValueToMsgId(CFE_ES_MEMSTATS_TLM_MID), + sizeof(CFE_ES_Global.TaskData.MemStatsPacket)); /* ** Create Software Bus message pipe */ - Status = CFE_SB_CreatePipe(&CFE_ES_TaskData.CmdPipe, CFE_ES_PIPE_DEPTH, CFE_ES_PIPE_NAME); + Status = CFE_SB_CreatePipe(&CFE_ES_Global.TaskData.CmdPipe, CFE_ES_PIPE_DEPTH, CFE_ES_PIPE_NAME); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("ES:Cannot Create SB Pipe, RC = 0x%08X\n", (unsigned int)Status); @@ -408,7 +411,7 @@ int32 CFE_ES_TaskInit(void) /* ** Subscribe to Housekeeping request commands */ - Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_ES_SEND_HK_MID), CFE_ES_TaskData.CmdPipe); + Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_ES_SEND_HK_MID), CFE_ES_Global.TaskData.CmdPipe); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("ES:Cannot Subscribe to HK packet, RC = 0x%08X\n", (unsigned int)Status); @@ -418,7 +421,7 @@ int32 CFE_ES_TaskInit(void) /* ** Subscribe to ES task ground command packets */ - Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_ES_CMD_MID), CFE_ES_TaskData.CmdPipe); + Status = CFE_SB_Subscribe(CFE_SB_ValueToMsgId(CFE_ES_CMD_MID), CFE_ES_Global.TaskData.CmdPipe); if (Status != CFE_SUCCESS) { CFE_ES_WriteToSysLog("ES:Cannot Subscribe to ES ground commands, RC = 0x%08X\n", (unsigned int)Status); @@ -433,25 +436,25 @@ int32 CFE_ES_TaskInit(void) if (Status == CFE_PSP_SUCCESS) { - CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum = + CFE_ES_Global.TaskData.HkPacket.Payload.CFECoreChecksum = CFE_ES_CalculateCRC((void *)(CfeSegmentAddr), SizeofCfeSegment, 0, CFE_MISSION_ES_DEFAULT_CRC); } else { - CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum = 0xFFFF; + CFE_ES_Global.TaskData.HkPacket.Payload.CFECoreChecksum = 0xFFFF; } /* ** Initialize the version numbers in the ES Housekeeping pkt */ - CFE_ES_TaskData.HkPacket.Payload.CFEMajorVersion = CFE_MAJOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.CFEMinorVersion = CFE_MINOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.CFERevision = CFE_REVISION; - CFE_ES_TaskData.HkPacket.Payload.CFEMissionRevision = CFE_MISSION_REV; - CFE_ES_TaskData.HkPacket.Payload.OSALMajorVersion = OS_MAJOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.OSALMinorVersion = OS_MINOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.OSALRevision = OS_REVISION; - CFE_ES_TaskData.HkPacket.Payload.OSALMissionRevision = OS_MISSION_REV; + CFE_ES_Global.TaskData.HkPacket.Payload.CFEMajorVersion = CFE_MAJOR_VERSION; + CFE_ES_Global.TaskData.HkPacket.Payload.CFEMinorVersion = CFE_MINOR_VERSION; + CFE_ES_Global.TaskData.HkPacket.Payload.CFERevision = CFE_REVISION; + CFE_ES_Global.TaskData.HkPacket.Payload.CFEMissionRevision = CFE_MISSION_REV; + CFE_ES_Global.TaskData.HkPacket.Payload.OSALMajorVersion = OS_MAJOR_VERSION; + CFE_ES_Global.TaskData.HkPacket.Payload.OSALMinorVersion = OS_MINOR_VERSION; + CFE_ES_Global.TaskData.HkPacket.Payload.OSALRevision = OS_REVISION; + CFE_ES_Global.TaskData.HkPacket.Payload.OSALMissionRevision = OS_MISSION_REV; /* ** Task startup event message. @@ -466,7 +469,7 @@ int32 CFE_ES_TaskInit(void) Status = CFE_EVS_SendEvent(CFE_ES_INITSTATS_INF_EID, CFE_EVS_EventType_INFORMATION, "cFS Versions: cfe %s, osal %s, psp %s. cFE chksm %d", GLOBAL_CONFIGDATA.CfeVersion, GLOBAL_CONFIGDATA.OsalVersion, CFE_PSP_VERSION, - (int)CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum); + (int)CFE_ES_Global.TaskData.HkPacket.Payload.CFECoreChecksum); if (Status != CFE_SUCCESS) { @@ -697,7 +700,7 @@ void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) CFE_EVS_SendEvent(CFE_ES_CC1_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid ground command code: ID = 0x%X, CC = %d", (unsigned int)CFE_SB_MsgIdToValue(MessageID), (int)CommandCode); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; break; } break; @@ -706,7 +709,7 @@ void CFE_ES_TaskPipe(CFE_SB_Buffer_t *SBBufPtr) CFE_EVS_SendEvent(CFE_ES_MID_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid command pipe message ID: 0x%X", (unsigned int)CFE_SB_MsgIdToValue(MessageID)); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; break; } @@ -727,35 +730,37 @@ int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) /* ** Get command execution counters, system log entry count & bytes used. */ - CFE_ES_TaskData.HkPacket.Payload.CommandCounter = CFE_ES_TaskData.CommandCounter; - CFE_ES_TaskData.HkPacket.Payload.CommandErrorCounter = CFE_ES_TaskData.CommandErrorCounter; - - CFE_ES_TaskData.HkPacket.Payload.SysLogBytesUsed = CFE_ES_MEMOFFSET_C(CFE_ES_ResetDataPtr->SystemLogEndIdx); - CFE_ES_TaskData.HkPacket.Payload.SysLogSize = CFE_ES_MEMOFFSET_C(CFE_PLATFORM_ES_SYSTEM_LOG_SIZE); - CFE_ES_TaskData.HkPacket.Payload.SysLogEntries = CFE_ES_ResetDataPtr->SystemLogEntryNum; - CFE_ES_TaskData.HkPacket.Payload.SysLogMode = CFE_ES_ResetDataPtr->SystemLogMode; - - CFE_ES_TaskData.HkPacket.Payload.ERLogIndex = CFE_ES_ResetDataPtr->ERLogIndex; - CFE_ES_TaskData.HkPacket.Payload.ERLogEntries = CFE_ES_ResetDataPtr->ERLogEntries; - - CFE_ES_TaskData.HkPacket.Payload.RegisteredCoreApps = CFE_ES_Global.RegisteredCoreApps; - CFE_ES_TaskData.HkPacket.Payload.RegisteredExternalApps = CFE_ES_Global.RegisteredExternalApps; - CFE_ES_TaskData.HkPacket.Payload.RegisteredTasks = CFE_ES_Global.RegisteredTasks; - CFE_ES_TaskData.HkPacket.Payload.RegisteredLibs = CFE_ES_Global.RegisteredLibs; - - CFE_ES_TaskData.HkPacket.Payload.ResetType = CFE_ES_ResetDataPtr->ResetVars.ResetType; - CFE_ES_TaskData.HkPacket.Payload.ResetSubtype = CFE_ES_ResetDataPtr->ResetVars.ResetSubtype; - CFE_ES_TaskData.HkPacket.Payload.ProcessorResets = CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount; - CFE_ES_TaskData.HkPacket.Payload.MaxProcessorResets = CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount; - CFE_ES_TaskData.HkPacket.Payload.BootSource = CFE_ES_ResetDataPtr->ResetVars.BootSource; - - CFE_ES_TaskData.HkPacket.Payload.PerfState = CFE_ES_ResetDataPtr->Perf.MetaData.State; - CFE_ES_TaskData.HkPacket.Payload.PerfMode = CFE_ES_ResetDataPtr->Perf.MetaData.Mode; - CFE_ES_TaskData.HkPacket.Payload.PerfTriggerCount = CFE_ES_ResetDataPtr->Perf.MetaData.TriggerCount; - CFE_ES_TaskData.HkPacket.Payload.PerfDataStart = CFE_ES_ResetDataPtr->Perf.MetaData.DataStart; - CFE_ES_TaskData.HkPacket.Payload.PerfDataEnd = CFE_ES_ResetDataPtr->Perf.MetaData.DataEnd; - CFE_ES_TaskData.HkPacket.Payload.PerfDataCount = CFE_ES_ResetDataPtr->Perf.MetaData.DataCount; - CFE_ES_TaskData.HkPacket.Payload.PerfDataToWrite = CFE_ES_GetPerfLogDumpRemaining(); + CFE_ES_Global.TaskData.HkPacket.Payload.CommandCounter = CFE_ES_Global.TaskData.CommandCounter; + CFE_ES_Global.TaskData.HkPacket.Payload.CommandErrorCounter = CFE_ES_Global.TaskData.CommandErrorCounter; + + CFE_ES_Global.TaskData.HkPacket.Payload.SysLogBytesUsed = + CFE_ES_MEMOFFSET_C(CFE_ES_Global.ResetDataPtr->SystemLogEndIdx); + CFE_ES_Global.TaskData.HkPacket.Payload.SysLogSize = CFE_ES_MEMOFFSET_C(CFE_PLATFORM_ES_SYSTEM_LOG_SIZE); + CFE_ES_Global.TaskData.HkPacket.Payload.SysLogEntries = CFE_ES_Global.ResetDataPtr->SystemLogEntryNum; + CFE_ES_Global.TaskData.HkPacket.Payload.SysLogMode = CFE_ES_Global.ResetDataPtr->SystemLogMode; + + CFE_ES_Global.TaskData.HkPacket.Payload.ERLogIndex = CFE_ES_Global.ResetDataPtr->ERLogIndex; + CFE_ES_Global.TaskData.HkPacket.Payload.ERLogEntries = CFE_ES_Global.ResetDataPtr->ERLogEntries; + + CFE_ES_Global.TaskData.HkPacket.Payload.RegisteredCoreApps = CFE_ES_Global.RegisteredCoreApps; + CFE_ES_Global.TaskData.HkPacket.Payload.RegisteredExternalApps = CFE_ES_Global.RegisteredExternalApps; + CFE_ES_Global.TaskData.HkPacket.Payload.RegisteredTasks = CFE_ES_Global.RegisteredTasks; + CFE_ES_Global.TaskData.HkPacket.Payload.RegisteredLibs = CFE_ES_Global.RegisteredLibs; + + CFE_ES_Global.TaskData.HkPacket.Payload.ResetType = CFE_ES_Global.ResetDataPtr->ResetVars.ResetType; + CFE_ES_Global.TaskData.HkPacket.Payload.ResetSubtype = CFE_ES_Global.ResetDataPtr->ResetVars.ResetSubtype; + CFE_ES_Global.TaskData.HkPacket.Payload.ProcessorResets = CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount; + CFE_ES_Global.TaskData.HkPacket.Payload.MaxProcessorResets = + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount; + CFE_ES_Global.TaskData.HkPacket.Payload.BootSource = CFE_ES_Global.ResetDataPtr->ResetVars.BootSource; + + CFE_ES_Global.TaskData.HkPacket.Payload.PerfState = CFE_ES_Global.ResetDataPtr->Perf.MetaData.State; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfMode = CFE_ES_Global.ResetDataPtr->Perf.MetaData.Mode; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerCount = CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerCount; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfDataStart = CFE_ES_Global.ResetDataPtr->Perf.MetaData.DataStart; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfDataEnd = CFE_ES_Global.ResetDataPtr->Perf.MetaData.DataEnd; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfDataCount = CFE_ES_Global.ResetDataPtr->Perf.MetaData.DataCount; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfDataToWrite = CFE_ES_GetPerfLogDumpRemaining(); /* * Fill out the perf trigger/filter mask objects @@ -771,12 +776,12 @@ int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) { if (PerfIdx < CFE_ES_PERF_TRIGGERMASK_INT_SIZE) { - CFE_ES_TaskData.HkPacket.Payload.PerfTriggerMask[PerfIdx] = - CFE_ES_ResetDataPtr->Perf.MetaData.TriggerMask[PerfIdx]; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask[PerfIdx] = + CFE_ES_Global.ResetDataPtr->Perf.MetaData.TriggerMask[PerfIdx]; } else { - CFE_ES_TaskData.HkPacket.Payload.PerfTriggerMask[PerfIdx] = 0; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfTriggerMask[PerfIdx] = 0; } } @@ -784,12 +789,12 @@ int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) { if (PerfIdx < CFE_ES_PERF_FILTERMASK_INT_SIZE) { - CFE_ES_TaskData.HkPacket.Payload.PerfFilterMask[PerfIdx] = - CFE_ES_ResetDataPtr->Perf.MetaData.FilterMask[PerfIdx]; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask[PerfIdx] = + CFE_ES_Global.ResetDataPtr->Perf.MetaData.FilterMask[PerfIdx]; } else { - CFE_ES_TaskData.HkPacket.Payload.PerfFilterMask[PerfIdx] = 0; + CFE_ES_Global.TaskData.HkPacket.Payload.PerfFilterMask[PerfIdx] = 0; } } @@ -805,15 +810,15 @@ int32 CFE_ES_HousekeepingCmd(const CFE_MSG_CommandHeader_t *data) memset(&HeapProp, 0, sizeof(HeapProp)); } - CFE_ES_TaskData.HkPacket.Payload.HeapBytesFree = CFE_ES_MEMOFFSET_C(HeapProp.free_bytes); - CFE_ES_TaskData.HkPacket.Payload.HeapBlocksFree = CFE_ES_MEMOFFSET_C(HeapProp.free_blocks); - CFE_ES_TaskData.HkPacket.Payload.HeapMaxBlockSize = CFE_ES_MEMOFFSET_C(HeapProp.largest_free_block); + CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree = CFE_ES_MEMOFFSET_C(HeapProp.free_bytes); + CFE_ES_Global.TaskData.HkPacket.Payload.HeapBlocksFree = CFE_ES_MEMOFFSET_C(HeapProp.free_blocks); + CFE_ES_Global.TaskData.HkPacket.Payload.HeapMaxBlockSize = CFE_ES_MEMOFFSET_C(HeapProp.largest_free_block); /* ** Send housekeeping telemetry packet. */ - CFE_SB_TimeStampMsg(&CFE_ES_TaskData.HkPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_ES_TaskData.HkPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(&CFE_ES_Global.TaskData.HkPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_ES_Global.TaskData.HkPacket.TlmHeader.Msg, true); /* ** This command does not affect the command execution counter. @@ -840,7 +845,7 @@ int32 CFE_ES_NoopCmd(const CFE_ES_NoopCmd_t *Cmd) /* ** This command will always succeed. */ - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_NOOP_INF_EID, CFE_EVS_EventType_INFORMATION, "No-op command:\n cFS Versions: cfe %s, osal %s, psp %s", GLOBAL_CONFIGDATA.CfeVersion, @@ -857,8 +862,8 @@ int32 CFE_ES_NoopCmd(const CFE_ES_NoopCmd_t *Cmd) int32 CFE_ES_ResetCountersCmd(const CFE_ES_ResetCountersCmd_t *data) { - CFE_ES_TaskData.CommandCounter = 0; - CFE_ES_TaskData.CommandErrorCounter = 0; + CFE_ES_Global.TaskData.CommandCounter = 0; + CFE_ES_Global.TaskData.CommandErrorCounter = 0; /* ** This command will always succeed. @@ -880,7 +885,7 @@ int32 CFE_ES_RestartCmd(const CFE_ES_RestartCmd_t *data) if ((cmd->RestartType != CFE_PSP_RST_TYPE_PROCESSOR) && (cmd->RestartType != CFE_PSP_RST_TYPE_POWERON)) { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_BOOT_ERR_EID, CFE_EVS_EventType_ERROR, "Invalid cFE restart type: %d", (int)cmd->RestartType); } @@ -927,32 +932,32 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data) */ if (FilenameLen < 4) { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_INVALID_FILENAME_ERR_EID, CFE_EVS_EventType_ERROR, "CFE_ES_StartAppCmd: invalid filename: %s", StartParams.BasicInfo.FileName); } else if (AppEntryLen <= 0) { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_INVALID_ENTRY_POINT_ERR_EID, CFE_EVS_EventType_ERROR, "CFE_ES_StartAppCmd: App Entry Point is empty."); } else if (AppNameLen <= 0) { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_NULL_APP_NAME_ERR_EID, CFE_EVS_EventType_ERROR, "CFE_ES_StartAppCmd: App Name is empty."); } else if (cmd->Priority > OS_MAX_PRIORITY) { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_PRIORITY_ERR_EID, CFE_EVS_EventType_ERROR, "CFE_ES_StartAppCmd: Priority is too large: %d.", (int)cmd->Priority); } else if ((cmd->ExceptionAction != CFE_ES_ExceptionAction_RESTART_APP) && (cmd->ExceptionAction != CFE_ES_ExceptionAction_PROC_RESTART)) { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_EXC_ACTION_ERR_EID, CFE_EVS_EventType_ERROR, "CFE_ES_StartAppCmd: Invalid Exception Action: %d.", (int)cmd->ExceptionAction); } @@ -981,13 +986,13 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartAppCmd_t *data) */ if (Result == CFE_SUCCESS) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_START_INF_EID, CFE_EVS_EventType_INFORMATION, "Started %s from %s, AppID = %lu", LocalAppName, StartParams.BasicInfo.FileName, CFE_RESOURCEID_TO_ULONG(AppID)); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_START_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to start %s from %s, RC = 0x%08X", LocalAppName, StartParams.BasicInfo.FileName, (unsigned int)Result); } @@ -1026,19 +1031,19 @@ int32 CFE_ES_StopAppCmd(const CFE_ES_StopAppCmd_t *data) */ if (Result == CFE_SUCCESS) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_STOP_DBG_EID, CFE_EVS_EventType_DEBUG, "Stop Application %s Initiated.", LocalApp); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_STOP_ERR1_EID, CFE_EVS_EventType_ERROR, "Stop Application %s Failed, RC = 0x%08X", LocalApp, (unsigned int)Result); } } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_STOP_ERR2_EID, CFE_EVS_EventType_ERROR, "Stop Application %s, GetAppIDByName failed. RC = 0x%08X.", LocalApp, (unsigned int)Result); } @@ -1072,20 +1077,20 @@ int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartAppCmd_t *data) */ if (Result == CFE_SUCCESS) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_RESTART_APP_DBG_EID, CFE_EVS_EventType_DEBUG, "Restart Application %s Initiated.", LocalApp); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_RESTART_APP_ERR1_EID, CFE_EVS_EventType_ERROR, "Restart Application %s Failed, RC = 0x%08X", LocalApp, (unsigned int)Result); } } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_RESTART_APP_ERR2_EID, CFE_EVS_EventType_ERROR, "Restart Application %s, GetAppIDByName failed. RC = 0x%08X.", LocalApp, (unsigned int)Result); @@ -1123,20 +1128,20 @@ int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadAppCmd_t *data) */ if (Result == CFE_SUCCESS) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_RELOAD_APP_DBG_EID, CFE_EVS_EventType_DEBUG, "Reload Application %s Initiated.", LocalApp); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_RELOAD_APP_ERR1_EID, CFE_EVS_EventType_ERROR, "Reload Application %s Failed, RC = 0x%08X", LocalApp, (unsigned int)Result); } } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_RELOAD_APP_ERR2_EID, CFE_EVS_EventType_ERROR, "Reload Application %s, GetAppIDByName failed. RC = 0x%08X.", LocalApp, (unsigned int)Result); } @@ -1173,7 +1178,7 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOneCmd_t *data) if (Result == CFE_SUCCESS) { - Result = CFE_ES_GetModuleInfo(&(CFE_ES_TaskData.OneAppPacket.Payload.AppInfo), IdBuf.ResourceID); + Result = CFE_ES_GetModuleInfo(&(CFE_ES_Global.TaskData.OneAppPacket.Payload.AppInfo), IdBuf.ResourceID); } /* @@ -1184,23 +1189,23 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOneCmd_t *data) /* ** Send application status telemetry packet. */ - CFE_SB_TimeStampMsg(&CFE_ES_TaskData.OneAppPacket.TlmHeader.Msg); - Result = CFE_SB_TransmitMsg(&CFE_ES_TaskData.OneAppPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(&CFE_ES_Global.TaskData.OneAppPacket.TlmHeader.Msg); + Result = CFE_SB_TransmitMsg(&CFE_ES_Global.TaskData.OneAppPacket.TlmHeader.Msg, true); if (Result == CFE_SUCCESS) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_ONE_APP_EID, CFE_EVS_EventType_DEBUG, "Sent %s application data", LocalApp); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_ONE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to send %s application data, RC = 0x%08X", LocalApp, (unsigned int)Result); } } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_ONE_APPID_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to send %s application data: GetAppIDByName Failed, RC = 0x%08X", LocalApp, (unsigned int)Result); @@ -1297,7 +1302,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) if (Result != sizeof(CFE_FS_Header_t)) { OS_close(FileDescriptor); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_WRHDR_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to write App Info file, WriteHdr RC = 0x%08X, exp %d", (unsigned int)Result, (int)sizeof(CFE_FS_Header_t)); @@ -1331,7 +1336,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) if (Result != sizeof(CFE_ES_AppInfo_t)) { OS_close(FileDescriptor); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_TASKWR_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to write App Info file, Task write RC = 0x%08X, exp %d", (unsigned int)Result, (int)sizeof(CFE_ES_AppInfo_t)); @@ -1349,14 +1354,14 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) } /* end for */ OS_close(FileDescriptor); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_ALL_APPS_EID, CFE_EVS_EventType_DEBUG, "App Info file written to %s, Entries=%d, FileSize=%d", QueryAllFilename, (int)EntryCount, (int)FileSize); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_OSCREATE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to write App Info file, OS_OpenCreate RC = 0x%08X", (unsigned int)Result); } @@ -1441,7 +1446,7 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) if (Result != sizeof(CFE_FS_Header_t)) { OS_close(FileDescriptor); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_TASKINFO_WRHDR_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to write Task Info file, WriteHdr RC = 0x%08X, exp %d", (unsigned int)Result, (int)sizeof(CFE_FS_Header_t)); @@ -1475,7 +1480,7 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) if (Result != sizeof(CFE_ES_TaskInfo_t)) { OS_close(FileDescriptor); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_TASKINFO_WR_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to write Task Info file, Task write RC = 0x%08X, exp %d", (unsigned int)Result, (int)sizeof(CFE_ES_TaskInfo_t)); @@ -1493,14 +1498,14 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) } /* end for */ OS_close(FileDescriptor); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_TASKINFO_EID, CFE_EVS_EventType_DEBUG, "Task Info file written to %s, Entries=%d, FileSize=%d", QueryAllFilename, (int)EntryCount, (int)FileSize); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_TASKINFO_OSCREATE_ERR_EID, CFE_EVS_EventType_ERROR, "Failed to write Task Info file, OS_OpenCreate RC = 0x%08X", (unsigned int)Result); } @@ -1527,7 +1532,7 @@ int32 CFE_ES_ClearSysLogCmd(const CFE_ES_ClearSysLogCmd_t *data) /* ** This command will always succeed... */ - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_SYSLOG1_INF_EID, CFE_EVS_EventType_INFORMATION, "Cleared Executive Services log data"); return CFE_SUCCESS; @@ -1551,14 +1556,14 @@ int32 CFE_ES_OverWriteSysLogCmd(const CFE_ES_OverWriteSysLogCmd_t *data) CFE_EVS_SendEvent(CFE_ES_ERR_SYSLOGMODE_EID, CFE_EVS_EventType_ERROR, "Set OverWriteSysLog Command: Invalid Mode setting = %d", (int)CmdPtr->Mode); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } else { CFE_EVS_SendEvent(CFE_ES_SYSLOGMODE_EID, CFE_EVS_EventType_DEBUG, "Set OverWriteSysLog Command Received with Mode setting = %d", (int)CmdPtr->Mode); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } return CFE_SUCCESS; @@ -1583,11 +1588,11 @@ int32 CFE_ES_WriteSysLogCmd(const CFE_ES_WriteSysLogCmd_t *data) if (Stat == CFE_SUCCESS) { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } /* end if */ return CFE_SUCCESS; @@ -1605,23 +1610,23 @@ int32 CFE_ES_ClearERLogCmd(const CFE_ES_ClearERLogCmd_t *data) ** Clear ER log data buffer */ - memset(CFE_ES_ResetDataPtr->ERLog, 0, sizeof(CFE_ES_ResetDataPtr->ERLog)); + memset(CFE_ES_Global.ResetDataPtr->ERLog, 0, sizeof(CFE_ES_Global.ResetDataPtr->ERLog)); /* ** Reset ER log buffer index */ - CFE_ES_ResetDataPtr->ERLogIndex = 0; + CFE_ES_Global.ResetDataPtr->ERLogIndex = 0; /* ** Set Number of Entries in ER log buffer back to zero */ - CFE_ES_ResetDataPtr->ERLogEntries = 0; + CFE_ES_Global.ResetDataPtr->ERLogEntries = 0; /* ** This command will always succeed */ - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_ERLOG1_INF_EID, CFE_EVS_EventType_INFORMATION, "Cleared ES Exception and Reset Log data"); return CFE_SUCCESS; @@ -1639,7 +1644,7 @@ int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLogCmd_t *data) CFE_ES_BackgroundLogDumpGlobal_t * StatePtr; int32 Status; - StatePtr = &CFE_ES_TaskData.BackgroundERLogDumpState; + StatePtr = &CFE_ES_Global.BackgroundERLogDumpState; /* check if pending before overwriting fields in the structure */ if (CFE_FS_BackgroundFileDumpIsPending(&StatePtr->FileWrite)) @@ -1673,11 +1678,11 @@ int32 CFE_ES_WriteERLogCmd(const CFE_ES_WriteERLogCmd_t *data) "Error log write to file %s already in progress", StatePtr->FileWrite.FileName); /* background dump already running, consider this an error */ - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } else { - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } return CFE_SUCCESS; @@ -1711,7 +1716,7 @@ bool CFE_ES_VerifyCmdLength(CFE_MSG_Message_t *MsgPtr, size_t ExpectedLength) (unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)FcnCode, (unsigned int)ActualLength, (unsigned int)ExpectedLength); result = false; - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } return (result); @@ -1730,14 +1735,14 @@ int32 CFE_ES_ResetPRCountCmd(const CFE_ES_ResetPRCountCmd_t *data) /* ** Reset the processor reset count */ - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = 0; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; /* ** This command will always succeed. */ CFE_EVS_SendEvent(CFE_ES_RESET_PR_COUNT_EID, CFE_EVS_EventType_INFORMATION, "Set Processor Reset Count to Zero"); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; return CFE_SUCCESS; } /* End of CFE_ES_ResetPRCountCmd() */ @@ -1755,7 +1760,7 @@ int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCountCmd_t *data) /* ** Set the MAX Processor reset count */ - CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount = cmd->MaxPRCount; + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount = cmd->MaxPRCount; /* ** This command will always succeed. @@ -1763,7 +1768,7 @@ int32 CFE_ES_SetMaxPRCountCmd(const CFE_ES_SetMaxPRCountCmd_t *data) CFE_EVS_SendEvent(CFE_ES_SET_MAX_PR_COUNT_EID, CFE_EVS_EventType_INFORMATION, "Maximum Processor Reset Count set to: %d", (int)cmd->MaxPRCount); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; return CFE_SUCCESS; } /* End of CFE_ES_RestartCmd() */ @@ -1789,21 +1794,21 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDSCmd_t *data) CFE_EVS_SendEvent(CFE_ES_CDS_DELETE_TBL_ERR_EID, CFE_EVS_EventType_ERROR, "CDS '%s' is a Critical Table CDS. Must be deleted via TBL Command", LocalCdsName); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } else if (Status == CFE_ES_CDS_OWNER_ACTIVE_ERR) { CFE_EVS_SendEvent(CFE_ES_CDS_OWNER_ACTIVE_EID, CFE_EVS_EventType_ERROR, "CDS '%s' not deleted because owning app is active", LocalCdsName); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } else if (Status == CFE_ES_ERR_NAME_NOT_FOUND) { CFE_EVS_SendEvent(CFE_ES_CDS_NAME_ERR_EID, CFE_EVS_EventType_ERROR, "Unable to locate '%s' in CDS Registry", LocalCdsName); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } else if (Status != CFE_SUCCESS) { @@ -1811,14 +1816,14 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDSCmd_t *data) "Error while deleting '%s' from CDS, See SysLog.(Err=0x%08X)", LocalCdsName, (unsigned int)Status); - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } else { CFE_EVS_SendEvent(CFE_ES_CDS_DELETED_INFO_EID, CFE_EVS_EventType_INFORMATION, "Successfully removed '%s' from CDS", LocalCdsName); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } return CFE_SUCCESS; @@ -1848,25 +1853,25 @@ int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStatsCmd_t *data) if (ValidHandle) { /* Extract the memory statistics from the memory pool */ - CFE_ES_GetMemPoolStats(&CFE_ES_TaskData.MemStatsPacket.Payload.PoolStats, MemHandle); + CFE_ES_GetMemPoolStats(&CFE_ES_Global.TaskData.MemStatsPacket.Payload.PoolStats, MemHandle); /* Echo the specified pool handle in the telemetry packet */ - CFE_ES_TaskData.MemStatsPacket.Payload.PoolHandle = MemHandle; + CFE_ES_Global.TaskData.MemStatsPacket.Payload.PoolHandle = MemHandle; /* ** Send memory statistics telemetry packet. */ - CFE_SB_TimeStampMsg(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.Msg); - CFE_SB_TransmitMsg(&CFE_ES_TaskData.MemStatsPacket.TlmHeader.Msg, true); + CFE_SB_TimeStampMsg(&CFE_ES_Global.TaskData.MemStatsPacket.TlmHeader.Msg); + CFE_SB_TransmitMsg(&CFE_ES_Global.TaskData.MemStatsPacket.TlmHeader.Msg, true); - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; CFE_EVS_SendEvent(CFE_ES_TLM_POOL_STATS_INFO_EID, CFE_EVS_EventType_DEBUG, "Successfully telemetered memory pool stats for 0x%08lX", CFE_RESOURCEID_TO_ULONG(Cmd->PoolHandle)); } else { - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; CFE_EVS_SendEvent(CFE_ES_INVALID_POOL_HANDLE_ERR_EID, CFE_EVS_EventType_ERROR, "Cannot telemeter memory pool stats. Illegal Handle (0x%08lX)", CFE_RESOURCEID_TO_ULONG(Cmd->PoolHandle)); @@ -1947,7 +1952,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) (int)FileSize, (int)NumEntries); /* Increment Successful Command Counter */ - CFE_ES_TaskData.CommandCounter++; + CFE_ES_Global.TaskData.CommandCounter++; } else { @@ -1956,7 +1961,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) (unsigned int)Status); /* Increment Command Error Counter */ - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } } else @@ -1966,7 +1971,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) (unsigned int)Status); /* Increment Command Error Counter */ - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } /* We are done outputting data to the dump file. Close it. */ @@ -1978,7 +1983,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) "Error creating CDS dump file '%s', Status=0x%08X", DumpFilename, (unsigned int)Status); /* Increment Command Error Counter */ - CFE_ES_TaskData.CommandErrorCounter++; + CFE_ES_Global.TaskData.CommandErrorCounter++; } return CFE_SUCCESS; diff --git a/modules/es/fsw/src/cfe_es_task.h b/modules/es/fsw/src/cfe_es_task.h index 5a5c8ffdb..dc824f3b8 100644 --- a/modules/es/fsw/src/cfe_es_task.h +++ b/modules/es/fsw/src/cfe_es_task.h @@ -72,81 +72,6 @@ ** Type definitions */ -/* - * Background log dump state structure - * - * This structure is stored in global memory and keeps the state - * of the log dump from one iteration to the next. - * - * NOTE: This is used for log structures which are expected to be small - * enough so such that it is not necessary to throttle the file write or - * spread it over time. - * - * Therefore, the only thing necessary to be stored is whether there - * is a pending write request, and the data file name. - * - * Larger log files, such as the Perf log, must implement a state machine - * with a dedicated state data structure. - */ -typedef struct -{ - CFE_FS_FileWriteMetaData_t FileWrite; /**< FS state data - must be first */ - CFE_ES_ERLog_FileEntry_t EntryBuffer; /**< Temp holding area for record to write */ -} CFE_ES_BackgroundLogDumpGlobal_t; - -/* -** Type definition (ES task global data) -*/ -typedef struct -{ - /* - ** ES Task command interface counters - */ - uint8 CommandCounter; - uint8 CommandErrorCounter; - - /* - ** ES Task housekeeping telemetry - */ - CFE_ES_HousekeepingTlm_t HkPacket; - - /* - ** Single application telemetry - */ - CFE_ES_OneAppTlm_t OneAppPacket; - - /* - ** Memory statistics telemetry - */ - CFE_ES_MemStatsTlm_t MemStatsPacket; - - /* - ** ES Task operational data (not reported in housekeeping) - */ - CFE_SB_PipeId_t CmdPipe; - - /* - ** ES Task initialization data (not reported in housekeeping) - */ - CFE_ES_BackgroundLogDumpGlobal_t BackgroundERLogDumpState; - - /* - * Persistent state data associated with performance log data file writes - */ - CFE_ES_PerfDumpGlobal_t BackgroundPerfDumpState; - - /* - * Persistent state data associated with background app table scans - */ - CFE_ES_AppTableScanState_t BackgroundAppScanState; - -} CFE_ES_TaskData_t; - -/* -** Executive Services (ES) task global data. -*/ -extern CFE_ES_TaskData_t CFE_ES_TaskData; - /*************************************************************************/ /* diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 67e48dc4f..4ce41ba5c 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -54,9 +54,7 @@ */ #define ES_UT_CDS_LARGE_TEST_SIZE (128 * 1024) -extern CFE_ES_PerfData_t *Perf; -extern CFE_ES_Global_t CFE_ES_Global; -extern CFE_ES_TaskData_t CFE_ES_TaskData; +extern CFE_ES_Global_t CFE_ES_Global; extern int32 dummy_function(void); @@ -64,6 +62,11 @@ extern int32 dummy_function(void); ** Global variables */ +/* + * Pointer to reset data that will be re-configured/preserved across calls to ES_ResetUnitTest() + */ +static CFE_ES_ResetData_t *ES_UT_PersistentResetData = NULL; + /* Buffers to support memory pool testing */ typedef union { @@ -581,9 +584,6 @@ void UtTest_Setup(void) UT_Init("es"); UtPrintf("cFE ES Unit Test Output File\n\n"); - /* Set up the performance logging variable */ - Perf = (CFE_ES_PerfData_t *)&CFE_ES_ResetDataPtr->Perf; - UT_ADD_TEST(TestInit); UT_ADD_TEST(TestStartupErrorPaths); UT_ADD_TEST(TestResourceID); @@ -620,6 +620,15 @@ void ES_ResetUnitTest(void) CFE_ES_Global.LastMemPoolId = CFE_ResourceId_FromInteger(CFE_ES_POOLID_BASE); CFE_ES_Global.CDSVars.LastCDSBlockId = CFE_ResourceId_FromInteger(CFE_ES_CDSBLOCKID_BASE); + /* + * (Re-)Initialize the reset data pointer + * This was formerly a separate global, but now part of CFE_ES_Global. + * + * Some unit tests assume/rely on it preserving its value across tests, + * so is must be re-initialized here every time CFE_ES_Global is reset. + */ + CFE_ES_Global.ResetDataPtr = ES_UT_PersistentResetData; + } /* end ES_ResetUnitTest() */ void TestInit(void) @@ -661,6 +670,14 @@ void TestStartupErrorPaths(void) UtPrintf("Begin Test Startup Error Paths"); + /* + * Get the reference to the reset area and save it so it will be preserved + * across calls to ES_ResetUnitTest(). This is required since now the pointer + * is part of CFE_ES_Global which is zeroed out as part of test reset. Formerly + * this was a separate global which was not cleared with the other globals. + */ + UT_GetDataBuffer(UT_KEY(CFE_PSP_GetResetArea), (void **)&ES_UT_PersistentResetData, NULL, NULL); + /* Set up the startup script for reading */ strncpy(StartupScript, "CFE_LIB, /cf/apps/tst_lib.bundle, TST_LIB_Init, TST_LIB, 0, 0, 0x0, 1; " @@ -722,8 +739,8 @@ void TestStartupErrorPaths(void) /* Perform the maximum number of processor resets */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = 0; - CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset = false; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; + CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset = false; for (j = 0; j < CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS; j++) { @@ -731,7 +748,7 @@ void TestStartupErrorPaths(void) } UT_Report(__FILE__, __LINE__, - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount == CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS, + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount == CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS, "CFE_ES_SetupResetVariables", "Maximum processor resets"); /* Attempt another processor reset after the maximum have occurred */ @@ -739,7 +756,7 @@ void TestStartupErrorPaths(void) UT_SetDataBuffer(UT_KEY(CFE_PSP_Restart), &ResetType, sizeof(ResetType), false); CFE_ES_SetupResetVariables(CFE_PSP_RST_TYPE_PROCESSOR, CFE_PSP_RST_SUBTYPE_POWER_CYCLE, 1); UT_Report(__FILE__, __LINE__, - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount == CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS + 1 && + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount == CFE_PLATFORM_ES_MAX_PROCESSOR_RESETS + 1 && ResetType == CFE_PSP_RST_TYPE_POWERON && UT_GetStubCount(UT_KEY(CFE_PSP_Restart)) == 1, "CFE_ES_SetupResetVariables", "Processor reset - power cycle; exceeded maximum " @@ -757,7 +774,7 @@ void TestStartupErrorPaths(void) ES_ResetUnitTest(); UT_SetStatusBSPResetArea(OS_ERROR, 0, CFE_TIME_ToneSignalSelect_PRIMARY); UT_SetDataBuffer(UT_KEY(CFE_PSP_Panic), &PanicStatus, sizeof(PanicStatus), false); - CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset = true; + CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset = true; CFE_ES_SetupResetVariables(CFE_PSP_RST_TYPE_PROCESSOR, CFE_PSP_RST_SUBTYPE_POWER_CYCLE, 1); UT_Report(__FILE__, __LINE__, PanicStatus == CFE_PSP_PANIC_MEMORY_ALLOC && UT_GetStubCount(UT_KEY(CFE_PSP_Panic)) == 1, @@ -766,7 +783,7 @@ void TestStartupErrorPaths(void) /* Perform a processor reset triggered by ES */ /* Added for coverage, as the "panic" case will should not cover this one */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->ResetVars.ES_CausedReset = true; + CFE_ES_Global.ResetDataPtr->ResetVars.ES_CausedReset = true; CFE_ES_SetupResetVariables(CFE_PSP_RST_TYPE_PROCESSOR, CFE_PSP_RST_SUBTYPE_POWER_CYCLE, 1); UT_Report(__FILE__, __LINE__, UT_GetStubCount(UT_KEY(CFE_PSP_Panic)) == 0, "CFE_ES_SetupResetVariables", "Processor Reset caused by ES"); @@ -1203,8 +1220,8 @@ void TestApps(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_WAITING, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_RUN; UtAppRecPtr->ControlReq.AppTimerMsec = 0; - memset(&CFE_ES_TaskData.BackgroundAppScanState, 0, sizeof(CFE_ES_TaskData.BackgroundAppScanState)); - CFE_ES_RunAppTableScan(0, &CFE_ES_TaskData.BackgroundAppScanState); + memset(&CFE_ES_Global.BackgroundAppScanState, 0, sizeof(CFE_ES_Global.BackgroundAppScanState)); + CFE_ES_RunAppTableScan(0, &CFE_ES_Global.BackgroundAppScanState); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PCR_ERR2_EID) && UtAppRecPtr->ControlReq.AppTimerMsec == 0, "CFE_ES_RunAppTableScan", "Waiting; process control request"); @@ -1215,7 +1232,7 @@ void TestApps(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_WAITING, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_EXIT; UtAppRecPtr->ControlReq.AppTimerMsec = 5000; - CFE_ES_RunAppTableScan(1000, &CFE_ES_TaskData.BackgroundAppScanState); + CFE_ES_RunAppTableScan(1000, &CFE_ES_Global.BackgroundAppScanState); UT_Report(__FILE__, __LINE__, UtAppRecPtr->ControlReq.AppTimerMsec == 4000 && UtAppRecPtr->ControlReq.AppControlRequest == CFE_ES_RunStatus_APP_EXIT, @@ -1228,7 +1245,7 @@ void TestApps(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_STOPPED, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_APP_RUN; UtAppRecPtr->ControlReq.AppTimerMsec = 0; - CFE_ES_RunAppTableScan(0, &CFE_ES_TaskData.BackgroundAppScanState); + CFE_ES_RunAppTableScan(0, &CFE_ES_Global.BackgroundAppScanState); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PCR_ERR2_EID) && UtAppRecPtr->ControlReq.AppTimerMsec == 0, "CFE_ES_RunAppTableScan", "Stopped; process control request"); @@ -1238,7 +1255,7 @@ void TestApps(void) ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_EARLY_INIT, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppTimerMsec = 5000; - CFE_ES_RunAppTableScan(0, &CFE_ES_TaskData.BackgroundAppScanState); + CFE_ES_RunAppTableScan(0, &CFE_ES_Global.BackgroundAppScanState); UT_Report(__FILE__, __LINE__, UT_GetNumEventsSent() == 0 && UtAppRecPtr->ControlReq.AppTimerMsec == 5000, "CFE_ES_RunAppTableScan", "Initializing; process control request"); @@ -1600,7 +1617,7 @@ void TestApps(void) ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_WAITING, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppTimerMsec = 0; - CFE_ES_RunAppTableScan(0, &CFE_ES_TaskData.BackgroundAppScanState); + CFE_ES_RunAppTableScan(0, &CFE_ES_Global.BackgroundAppScanState); UT_Report(__FILE__, __LINE__, UT_GetNumEventsSent() == 0 && UtAppRecPtr->ControlReq.AppTimerMsec == 0, "CFE_ES_RunAppTableScan", "Waiting; process control request"); @@ -1610,7 +1627,7 @@ void TestApps(void) ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); UtAppRecPtr->ControlReq.AppTimerMsec = 0; - CFE_ES_RunAppTableScan(0, &CFE_ES_TaskData.BackgroundAppScanState); + CFE_ES_RunAppTableScan(0, &CFE_ES_Global.BackgroundAppScanState); UT_Report(__FILE__, __LINE__, UT_GetNumEventsSent() == 0 && UtAppRecPtr->ControlReq.AppTimerMsec == 0, "CFE_ES_RunAppTableScan", "Running; process control request"); @@ -1876,12 +1893,12 @@ void TestERLog(void) * and non-null context with small size */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->ERLogIndex = CFE_PLATFORM_ES_ER_LOG_ENTRIES + 1; - Return = CFE_ES_WriteToERLog(CFE_ES_LogEntryType_CORE, CFE_PSP_RST_TYPE_POWERON, 1, NULL); + CFE_ES_Global.ResetDataPtr->ERLogIndex = CFE_PLATFORM_ES_ER_LOG_ENTRIES + 1; + Return = CFE_ES_WriteToERLog(CFE_ES_LogEntryType_CORE, CFE_PSP_RST_TYPE_POWERON, 1, NULL); UT_Report(__FILE__, __LINE__, Return == CFE_SUCCESS && - !strcmp(CFE_ES_ResetDataPtr->ERLog[0].BaseInfo.Description, "No Description String Given.") && - CFE_ES_ResetDataPtr->ERLogIndex == 1, + !strcmp(CFE_ES_Global.ResetDataPtr->ERLog[0].BaseInfo.Description, "No Description String Given.") && + CFE_ES_Global.ResetDataPtr->ERLogIndex == 1, "CFE_ES_WriteToERLog", "Log entries exceeded; no description; valid context size"); /* Test non-rolling over log entry, @@ -1889,10 +1906,10 @@ void TestERLog(void) * and null context */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->ERLogIndex = 0; - Return = CFE_ES_WriteToERLog(CFE_ES_LogEntryType_CORE, CFE_PSP_RST_TYPE_POWERON, 1, NULL); - UT_Report(__FILE__, __LINE__, Return == CFE_SUCCESS && CFE_ES_ResetDataPtr->ERLogIndex == 1, "CFE_ES_WriteToERLog", - "No log entry rollover; no description; no context"); + CFE_ES_Global.ResetDataPtr->ERLogIndex = 0; + Return = CFE_ES_WriteToERLog(CFE_ES_LogEntryType_CORE, CFE_PSP_RST_TYPE_POWERON, 1, NULL); + UT_Report(__FILE__, __LINE__, Return == CFE_SUCCESS && CFE_ES_Global.ResetDataPtr->ERLogIndex == 1, + "CFE_ES_WriteToERLog", "No log entry rollover; no description; no context"); /* Test ER log background write functions */ memset(&State, 0, sizeof(State)); @@ -2185,8 +2202,8 @@ void TestTask(void) * depending on the value that the index has reached from previous tests */ memset(&CmdBuf, 0, sizeof(CmdBuf)); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = 0; - CFE_ES_ResetDataPtr->SystemLogEndIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; /* Test task main process loop with a command pipe error */ ES_ResetUnitTest(); @@ -2215,25 +2232,25 @@ void TestTask(void) ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, NULL, NULL, NULL); UT_Report(__FILE__, __LINE__, CFE_ES_TaskInit() == CFE_SUCCESS, "CFE_ES_TaskInit", "Checksum fail, task init result"); - UT_Report(__FILE__, __LINE__, CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum == 0xFFFF, "CFE_ES_TaskInit", + UT_Report(__FILE__, __LINE__, CFE_ES_Global.TaskData.HkPacket.Payload.CFECoreChecksum == 0xFFFF, "CFE_ES_TaskInit", "Checksum fail, checksum value"); /* Test successful task main process loop - Power On Reset Path */ ES_ResetUnitTest(); /* this is needed so CFE_ES_GetAppId works */ ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, NULL, NULL, NULL); - CFE_ES_ResetDataPtr->ResetVars.ResetType = 2; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = 2; UT_Report(__FILE__, __LINE__, - CFE_ES_TaskInit() == CFE_SUCCESS && CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF, + CFE_ES_TaskInit() == CFE_SUCCESS && CFE_ES_Global.TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF, "CFE_ES_TaskInit", "Checksum success, POR Path"); /* Test successful task main process loop - Processor Reset Path */ ES_ResetUnitTest(); /* this is needed so CFE_ES_GetAppId works */ ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, NULL, NULL, NULL); - CFE_ES_ResetDataPtr->ResetVars.ResetType = 1; + CFE_ES_Global.ResetDataPtr->ResetVars.ResetType = 1; UT_Report(__FILE__, __LINE__, - CFE_ES_TaskInit() == CFE_SUCCESS && CFE_ES_TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF, + CFE_ES_TaskInit() == CFE_SUCCESS && CFE_ES_Global.TaskData.HkPacket.Payload.CFECoreChecksum != 0xFFFF, "CFE_ES_TaskInit", "Checksum success, PR Path"); /* Test task main process loop with a register app failure */ @@ -2281,19 +2298,19 @@ void TestTask(void) * DISCARD, which can result in a log overflow depending on the value that * the index reaches during subsequent tests */ - CFE_ES_ResetDataPtr->SystemLogMode = CFE_ES_LogMode_OVERWRITE; + CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_ES_LogMode_OVERWRITE; /* Test a successful HK request */ ES_ResetUnitTest(); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_SEND_HK); - UT_Report(__FILE__, __LINE__, CFE_ES_TaskData.HkPacket.Payload.HeapBytesFree > 0, "CFE_ES_HousekeepingCmd", + UT_Report(__FILE__, __LINE__, CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree > 0, "CFE_ES_HousekeepingCmd", "HK packet - get heap successful"); /* Test the HK request with a get heap failure */ ES_ResetUnitTest(); UT_SetDeferredRetcode(UT_KEY(OS_HeapGetInfo), 1, -1); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.NoArgsCmd), UT_TPID_CFE_ES_SEND_HK); - UT_Report(__FILE__, __LINE__, CFE_ES_TaskData.HkPacket.Payload.HeapBytesFree == 0, "CFE_ES_HousekeepingCmd", + UT_Report(__FILE__, __LINE__, CFE_ES_Global.TaskData.HkPacket.Payload.HeapBytesFree == 0, "CFE_ES_HousekeepingCmd", "HK packet - get heap fail"); /* Test successful no-op command */ @@ -2309,8 +2326,8 @@ void TestTask(void) /* Test successful cFE restart */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = 0; - CmdBuf.RestartCmd.Payload.RestartType = CFE_PSP_RST_TYPE_PROCESSOR; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; + CmdBuf.RestartCmd.Payload.RestartType = CFE_PSP_RST_TYPE_PROCESSOR; UT_SetDataBuffer(UT_KEY(CFE_PSP_Restart), &ResetType, sizeof(ResetType), false); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.RestartCmd), UT_TPID_CFE_ES_CMD_RESTART_CC); UT_Report(__FILE__, __LINE__, @@ -2721,7 +2738,7 @@ void TestTask(void) memset(&CmdBuf, 0, sizeof(CmdBuf)); strncpy(CmdBuf.WriteSysLogCmd.Payload.FileName, "filename", sizeof(CmdBuf.WriteSysLogCmd.Payload.FileName) - 1); CmdBuf.WriteSysLogCmd.Payload.FileName[sizeof(CmdBuf.WriteSysLogCmd.Payload.FileName) - 1] = '\0'; - CFE_ES_TaskData.HkPacket.Payload.SysLogEntries = 123; + CFE_ES_Global.TaskData.HkPacket.Payload.SysLogEntries = 123; UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_SYSLOG2_EID), "CFE_ES_WriteSysLogCmd", "Write system log; success"); @@ -2747,11 +2764,11 @@ void TestTask(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_SetDefaultReturnValue(UT_KEY(OS_write), OS_ERROR); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = - snprintf(CFE_ES_ResetDataPtr->SystemLog, sizeof(CFE_ES_ResetDataPtr->SystemLog), + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = + snprintf(CFE_ES_Global.ResetDataPtr->SystemLog, sizeof(CFE_ES_Global.ResetDataPtr->SystemLog), "0000-000-00:00:00.00000 Test Message\n"); - CFE_ES_ResetDataPtr->SystemLogEndIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; - CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; + CmdBuf.WriteSysLogCmd.Payload.FileName[0] = '\0'; UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.WriteSysLogCmd), UT_TPID_CFE_ES_CMD_WRITE_SYSLOG_CC); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_FILEWRITE_ERR_EID), "CFE_ES_WriteSysLogCmd", "Write system log; OS write"); @@ -2805,8 +2822,8 @@ void TestTask(void) "Scan for exceptions; processor restart"); ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = 0; - CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount = 1; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = 0; + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount = 1; UT_SetDefaultReturnValue(UT_KEY(CFE_PSP_Exception_GetCount), 1); CFE_ES_RunExceptionScan(0, NULL); /* first time should do a processor restart (limit reached) */ @@ -3199,6 +3216,14 @@ void TestPerf(void) UtPrintf("Begin Test Performance Log"); + CFE_ES_PerfData_t *Perf; + + /* + ** Set the pointer to the data area + */ + UT_GetDataBuffer(UT_KEY(CFE_PSP_GetResetArea), (void **)&ES_UT_PersistentResetData, NULL, NULL); + Perf = &ES_UT_PersistentResetData->Perf; + /* Test successful performance mask and value initialization */ ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_CORE, CFE_ES_AppState_RUNNING, "CFE_ES", NULL, NULL); @@ -3261,9 +3286,9 @@ void TestPerf(void) ES_ResetUnitTest(); memset(&CmdBuf, 0, sizeof(CmdBuf)); /* clearing the BackgroundPerfDumpState will fully reset to initial state */ - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; - CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); + CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; + CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PERF_STARTCMD_ERR_EID), "CFE_ES_StartPerfDataCmd", "Cannot collect performance data; write in progress"); @@ -3272,7 +3297,7 @@ void TestPerf(void) * start command */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); CmdBuf.PerfStartCmd.Payload.TriggerMode = CFE_ES_PERF_TRIGGER_START; UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStartCmd), UT_TPID_CFE_ES_CMD_START_PERF_DATA_CC); @@ -3281,7 +3306,7 @@ void TestPerf(void) /* Test successful performance data collection stop */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); memset(&CmdBuf, 0, sizeof(CmdBuf)); UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PERF_STOPCMD_EID), "CFE_ES_StopPerfDataCmd", @@ -3292,7 +3317,7 @@ void TestPerf(void) ES_ResetUnitTest(); /* clearing the BackgroundPerfDumpState will fully reset to initial state */ - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); strncpy(CmdBuf.PerfStopCmd.Payload.DataFileName, "filename", sizeof(CmdBuf.PerfStopCmd.Payload.DataFileName) - 1); CmdBuf.PerfStopCmd.Payload.DataFileName[sizeof(CmdBuf.PerfStopCmd.Payload.DataFileName) - 1] = '\0'; UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); @@ -3301,7 +3326,7 @@ void TestPerf(void) /* Test performance data collection stop with a file write in progress */ ES_ResetUnitTest(); - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; + CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; UT_CallTaskPipe(CFE_ES_TaskPipe, &CmdBuf.Msg, sizeof(CmdBuf.PerfStopCmd), UT_TPID_CFE_ES_CMD_STOP_PERF_DATA_CC); UT_Report(__FILE__, __LINE__, UT_EventIsInHistory(CFE_ES_PERF_STOPCMD_ERR2_EID), "CFE_ES_StopPerfDataCmd", "Stop performance data command ignored"); @@ -3505,52 +3530,52 @@ void TestPerf(void) /* Test perf log dump state machine */ /* Nominal call 1 - should go through up to the DELAY state */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); - CFE_ES_TaskData.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; - CFE_ES_RunPerfLogDump(1000, &CFE_ES_TaskData.BackgroundPerfDumpState); - UtAssert_True(CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_DELAY, - "CFE_ES_RunPerfLogDump - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState (%d) == DELAY (%d)", - (int)CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_DELAY); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); + CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; + CFE_ES_RunPerfLogDump(1000, &CFE_ES_Global.BackgroundPerfDumpState); + UtAssert_True(CFE_ES_Global.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_DELAY, + "CFE_ES_RunPerfLogDump - CFE_ES_Global.BackgroundPerfDumpState.CurrentState (%d) == DELAY (%d)", + (int)CFE_ES_Global.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_DELAY); UtAssert_True(UT_GetStubCount(UT_KEY(OS_OpenCreate)) == 1, "CFE_ES_RunPerfLogDump - OS_OpenCreate() called"); /* Nominal call 2 - should go through up to the remainder of states, back to IDLE */ - CFE_ES_RunPerfLogDump(1000, &CFE_ES_TaskData.BackgroundPerfDumpState); - UtAssert_True(CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_IDLE, - "CFE_ES_RunPerfLogDump - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState (%d) == IDLE (%d)", - (int)CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_IDLE); + CFE_ES_RunPerfLogDump(1000, &CFE_ES_Global.BackgroundPerfDumpState); + UtAssert_True(CFE_ES_Global.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_IDLE, + "CFE_ES_RunPerfLogDump - CFE_ES_Global.BackgroundPerfDumpState.CurrentState (%d) == IDLE (%d)", + (int)CFE_ES_Global.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_IDLE); UtAssert_True(UT_GetStubCount(UT_KEY(OS_close)) == 1, "CFE_ES_RunPerfLogDump - OS_close() called"); /* Test a failure to open the output file */ /* This should go immediately back to idle, and generate CFE_ES_PERF_LOG_ERR_EID */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); - CFE_ES_TaskData.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); + CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; UT_SetDefaultReturnValue(UT_KEY(OS_OpenCreate), -10); - CFE_ES_RunPerfLogDump(1000, &CFE_ES_TaskData.BackgroundPerfDumpState); - UtAssert_True(CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_IDLE, - "CFE_ES_RunPerfLogDump - OS create fail, CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState (%d) " + CFE_ES_RunPerfLogDump(1000, &CFE_ES_Global.BackgroundPerfDumpState); + UtAssert_True(CFE_ES_Global.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_IDLE, + "CFE_ES_RunPerfLogDump - OS create fail, CFE_ES_Global.BackgroundPerfDumpState.CurrentState (%d) " "== IDLE (%d)", - (int)CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_IDLE); + (int)CFE_ES_Global.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_IDLE); UtAssert_True(UT_EventIsInHistory(CFE_ES_PERF_LOG_ERR_EID), "CFE_ES_RunPerfLogDump - OS create fail, generated CFE_ES_PERF_LOG_ERR_EID"); /* Test a failure to write to the output file */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); UT_SetDefaultReturnValue(UT_KEY(OS_write), -10); - CFE_ES_TaskData.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; - CFE_ES_RunPerfLogDump(1000, &CFE_ES_TaskData.BackgroundPerfDumpState); - UtAssert_True(CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_DELAY, - "CFE_ES_RunPerfLogDump - OS_write fail, CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState (%d) == " + CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_INIT; + CFE_ES_RunPerfLogDump(1000, &CFE_ES_Global.BackgroundPerfDumpState); + UtAssert_True(CFE_ES_Global.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_DELAY, + "CFE_ES_RunPerfLogDump - OS_write fail, CFE_ES_Global.BackgroundPerfDumpState.CurrentState (%d) == " "DELAY (%d)", - (int)CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_DELAY); + (int)CFE_ES_Global.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_DELAY); /* This will trigger the OS_write() failure, which should go through up to the remainder of states, back to IDLE */ - CFE_ES_RunPerfLogDump(1000, &CFE_ES_TaskData.BackgroundPerfDumpState); + CFE_ES_RunPerfLogDump(1000, &CFE_ES_Global.BackgroundPerfDumpState); UtAssert_True( - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_IDLE, - "CFE_ES_RunPerfLogDump - OS_write fail, CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState (%d) == IDLE (%d)", - (int)CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_IDLE); + CFE_ES_Global.BackgroundPerfDumpState.CurrentState == CFE_ES_PerfDumpState_IDLE, + "CFE_ES_RunPerfLogDump - OS_write fail, CFE_ES_Global.BackgroundPerfDumpState.CurrentState (%d) == IDLE (%d)", + (int)CFE_ES_Global.BackgroundPerfDumpState.CurrentState, (int)CFE_ES_PerfDumpState_IDLE); UtAssert_True(UT_EventIsInHistory(CFE_ES_FILEWRITE_ERR_EID), "CFE_ES_RunPerfLogDump - OS_write fail, generated CFE_ES_FILEWRITE_ERR_EID"); @@ -3559,35 +3584,35 @@ void TestPerf(void) * so that the writing position is toward the end of the buffer. */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); - OS_OpenCreate(&CFE_ES_TaskData.BackgroundPerfDumpState.FileDesc, "UT", 0, OS_WRITE_ONLY); - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES; - CFE_ES_TaskData.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES; - CFE_ES_TaskData.BackgroundPerfDumpState.DataPos = CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE - 2; - CFE_ES_TaskData.BackgroundPerfDumpState.StateCounter = 4; - CFE_ES_RunPerfLogDump(1000, &CFE_ES_TaskData.BackgroundPerfDumpState); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); + OS_OpenCreate(&CFE_ES_Global.BackgroundPerfDumpState.FileDesc, "UT", 0, OS_WRITE_ONLY); + CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES; + CFE_ES_Global.BackgroundPerfDumpState.PendingState = CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES; + CFE_ES_Global.BackgroundPerfDumpState.DataPos = CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE - 2; + CFE_ES_Global.BackgroundPerfDumpState.StateCounter = 4; + CFE_ES_RunPerfLogDump(1000, &CFE_ES_Global.BackgroundPerfDumpState); /* check that the wraparound occurred */ - UtAssert_True(CFE_ES_TaskData.BackgroundPerfDumpState.DataPos == 2, + UtAssert_True(CFE_ES_Global.BackgroundPerfDumpState.DataPos == 2, "CFE_ES_RunPerfLogDump - wraparound, DataPos (%u) == 2", - (unsigned int)CFE_ES_TaskData.BackgroundPerfDumpState.DataPos); + (unsigned int)CFE_ES_Global.BackgroundPerfDumpState.DataPos); /* should have written 4 entries to the log */ - UtAssert_True(CFE_ES_TaskData.BackgroundPerfDumpState.FileSize == sizeof(CFE_ES_PerfDataEntry_t) * 4, + UtAssert_True(CFE_ES_Global.BackgroundPerfDumpState.FileSize == sizeof(CFE_ES_PerfDataEntry_t) * 4, "CFE_ES_RunPerfLogDump - wraparound, FileSize (%u) == sizeof(CFE_ES_PerfDataEntry_t) * 4", - (unsigned int)CFE_ES_TaskData.BackgroundPerfDumpState.FileSize); + (unsigned int)CFE_ES_Global.BackgroundPerfDumpState.FileSize); /* Confirm that the "CFE_ES_GetPerfLogDumpRemaining" function works. * This requires that the state is not idle, in order to get nonzero results. */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); - OS_OpenCreate(&CFE_ES_TaskData.BackgroundPerfDumpState.FileDesc, "UT", 0, OS_WRITE_ONLY); - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_WRITE_PERF_METADATA; - CFE_ES_TaskData.BackgroundPerfDumpState.StateCounter = 10; - Perf->MetaData.DataCount = 100; + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); + OS_OpenCreate(&CFE_ES_Global.BackgroundPerfDumpState.FileDesc, "UT", 0, OS_WRITE_ONLY); + CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_WRITE_PERF_METADATA; + CFE_ES_Global.BackgroundPerfDumpState.StateCounter = 10; + Perf->MetaData.DataCount = 100; /* in states other than WRITE_PERF_ENTRIES, it should report the full size of the log */ UtAssert_True(CFE_ES_GetPerfLogDumpRemaining() == 100, " CFE_ES_GetPerfLogDumpRemaining - Setup Phase"); /* in WRITE_PERF_ENTRIES, it should report the StateCounter */ - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES; + CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_WRITE_PERF_ENTRIES; UtAssert_True(CFE_ES_GetPerfLogDumpRemaining() == 10, " CFE_ES_GetPerfLogDumpRemaining - Active Phase"); } @@ -3612,10 +3637,12 @@ void TestAPI(void) /* Test resetting the cFE with a processor reset */ ES_ResetUnitTest(); - ResetType = CFE_PSP_RST_TYPE_PROCESSOR; - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount - 1; + ResetType = CFE_PSP_RST_TYPE_PROCESSOR; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount - 1; CFE_ES_ResetCFE(ResetType); - CFE_ES_ResetDataPtr->ResetVars.ProcessorResetCount = CFE_ES_ResetDataPtr->ResetVars.MaxProcessorResetCount; + CFE_ES_Global.ResetDataPtr->ResetVars.ProcessorResetCount = + CFE_ES_Global.ResetDataPtr->ResetVars.MaxProcessorResetCount; UT_Report(__FILE__, __LINE__, CFE_ES_ResetCFE(ResetType) == CFE_ES_NOT_IMPLEMENTED && UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_POR_MAX_PROC_RESETS]) && @@ -3996,16 +4023,16 @@ void TestAPI(void) * must be truncated */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = CFE_PLATFORM_ES_SYSTEM_LOG_SIZE - CFE_TIME_PRINTED_STRING_SIZE - 4; - CFE_ES_ResetDataPtr->SystemLogEndIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; - CFE_ES_ResetDataPtr->SystemLogMode = CFE_ES_LogMode_DISCARD; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = CFE_PLATFORM_ES_SYSTEM_LOG_SIZE - CFE_TIME_PRINTED_STRING_SIZE - 4; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; + CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_ES_LogMode_DISCARD; UT_Report(__FILE__, __LINE__, CFE_ES_SysLogWrite_Unsync("SysLogText This message should be truncated") == CFE_ES_ERR_SYS_LOG_TRUNCATED, "CFE_ES_SysLogWrite_Internal", "Add message to log that must be truncated"); /* Reset the system log index to prevent an overflow in later tests */ - CFE_ES_ResetDataPtr->SystemLogWriteIdx = 0; - CFE_ES_ResetDataPtr->SystemLogEndIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = 0; /* Test calculating a CRC on a range of memory using CRC type 8 * NOTE: This capability is not currently implemented in cFE @@ -4101,9 +4128,9 @@ void TestAPI(void) * causes the log index to be reset */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = CFE_PLATFORM_ES_SYSTEM_LOG_SIZE; - CFE_ES_ResetDataPtr->SystemLogEndIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; - CFE_ES_ResetDataPtr->SystemLogMode = CFE_ES_LogMode_DISCARD; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = CFE_PLATFORM_ES_SYSTEM_LOG_SIZE; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; + CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_ES_LogMode_DISCARD; UT_Report(__FILE__, __LINE__, CFE_ES_WriteToSysLog("SysLogText") == CFE_ES_ERR_SYS_LOG_FULL, "CFE_ES_WriteToSysLog", "Add message to log that resets the log index"); @@ -4111,12 +4138,12 @@ void TestAPI(void) * causes the log index to be reset */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = CFE_PLATFORM_ES_SYSTEM_LOG_SIZE; - CFE_ES_ResetDataPtr->SystemLogEndIdx = CFE_ES_ResetDataPtr->SystemLogWriteIdx; - CFE_ES_ResetDataPtr->SystemLogMode = CFE_ES_LogMode_OVERWRITE; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = CFE_PLATFORM_ES_SYSTEM_LOG_SIZE; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx; + CFE_ES_Global.ResetDataPtr->SystemLogMode = CFE_ES_LogMode_OVERWRITE; UT_Report(__FILE__, __LINE__, CFE_ES_WriteToSysLog("SysLogText") == CFE_SUCCESS && - CFE_ES_ResetDataPtr->SystemLogWriteIdx < CFE_PLATFORM_ES_SYSTEM_LOG_SIZE, + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx < CFE_PLATFORM_ES_SYSTEM_LOG_SIZE, "CFE_ES_WriteToSysLog", "Add message to log that resets the log index"); /* Test run loop with an application error status */ @@ -5204,17 +5231,17 @@ void TestSysLog(void) /* Test loop in CFE_ES_SysLogReadStart_Unsync that ensures * reading at the start of a message */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = 0; - CFE_ES_ResetDataPtr->SystemLogEndIdx = sizeof(CFE_ES_ResetDataPtr->SystemLog) - 1; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1; - memset(CFE_ES_ResetDataPtr->SystemLog, 'a', CFE_ES_ResetDataPtr->SystemLogEndIdx); - CFE_ES_ResetDataPtr->SystemLog[CFE_ES_ResetDataPtr->SystemLogEndIdx - 1] = '\n'; + memset(CFE_ES_Global.ResetDataPtr->SystemLog, 'a', CFE_ES_Global.ResetDataPtr->SystemLogEndIdx); + CFE_ES_Global.ResetDataPtr->SystemLog[CFE_ES_Global.ResetDataPtr->SystemLogEndIdx - 1] = '\n'; CFE_ES_SysLogReadStart_Unsync(&SysLogBuffer); UT_Report(__FILE__, __LINE__, - SysLogBuffer.EndIdx == sizeof(CFE_ES_ResetDataPtr->SystemLog) - 1 && - SysLogBuffer.LastOffset == sizeof(CFE_ES_ResetDataPtr->SystemLog) - 1 && + SysLogBuffer.EndIdx == sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1 && + SysLogBuffer.LastOffset == sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1 && SysLogBuffer.BlockSize == 0 && SysLogBuffer.SizeLeft == 0, "CFE_ES_SysLogReadStart_Unsync(SysLogBuffer)", "ResetDataPtr pointing to an old fragment of a message"); @@ -5250,8 +5277,8 @@ void TestSysLog(void) /* Test nominal flow through CFE_ES_SysLogDump * with multiple reads and writes */ ES_ResetUnitTest(); - CFE_ES_ResetDataPtr->SystemLogWriteIdx = 0; - CFE_ES_ResetDataPtr->SystemLogEndIdx = sizeof(CFE_ES_ResetDataPtr->SystemLog) - 1; + CFE_ES_Global.ResetDataPtr->SystemLogWriteIdx = 0; + CFE_ES_Global.ResetDataPtr->SystemLogEndIdx = sizeof(CFE_ES_Global.ResetDataPtr->SystemLog) - 1; CFE_ES_SysLogDump("fakefilename"); @@ -5304,9 +5331,9 @@ void TestBackground(void) * execute the code which counts the number of active jobs. */ ES_ResetUnitTest(); - memset(&CFE_ES_TaskData.BackgroundPerfDumpState, 0, sizeof(CFE_ES_TaskData.BackgroundPerfDumpState)); + memset(&CFE_ES_Global.BackgroundPerfDumpState, 0, sizeof(CFE_ES_Global.BackgroundPerfDumpState)); UT_SetDefaultReturnValue(UT_KEY(OS_write), -10); - CFE_ES_TaskData.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; + CFE_ES_Global.BackgroundPerfDumpState.CurrentState = CFE_ES_PerfDumpState_INIT; UT_SetDeferredRetcode(UT_KEY(OS_BinSemTimedWait), 3, -4); CFE_ES_BackgroundTask(); UT_Report(__FILE__, __LINE__, UT_PrintfIsInHistory(UT_OSP_MESSAGES[UT_OSP_BACKGROUND_TAKE]), From 10dbf4af5bdf5d9919718acac2cb9f881ca92c40 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 23 Mar 2021 12:23:34 -0400 Subject: [PATCH 12/27] Fix #1206, report PSP version in ES HK TLM Add PSP version info to ES Housekeeping TLM messages. This is equivalent to OSAL version info. Changes both to use the proper version API. --- docs/src/mnem_maps/cfe_es_tlm_mnem_map | 4 ++ modules/es/eds/cfe_es.xml | 66 +++++++++++++++++--------- modules/es/fsw/inc/cfe_es_msg.h | 9 ++++ modules/es/fsw/src/cfe_es_task.c | 25 ++++++---- 4 files changed, 73 insertions(+), 31 deletions(-) diff --git a/docs/src/mnem_maps/cfe_es_tlm_mnem_map b/docs/src/mnem_maps/cfe_es_tlm_mnem_map index 63a21c636..e76b8701d 100644 --- a/docs/src/mnem_maps/cfe_es_tlm_mnem_map +++ b/docs/src/mnem_maps/cfe_es_tlm_mnem_map @@ -26,6 +26,10 @@ ES_OSMAJORVER=$sc_$cpu_ES_OSMAJORVER \ ES_OSMINORVER=$sc_$cpu_ES_OSMINORVER \ ES_OSREVISION=$sc_$cpu_ES_OSREVISION \ ES_OSMISSIONREV=$sc_$cpu_ES_OSMISSIONREV \ +ES_PSPMAJORVER=$sc_$cpu_ES_PSPMAJORVER \ +ES_PSPMINORVER=$sc_$cpu_ES_PSPMINORVER \ +ES_PSPREVISION=$sc_$cpu_ES_PSPREVISION \ +ES_PSPMISSIONREV=$sc_$cpu_ES_PSPMISSIONREV \ ES_PAD1=$sc_$cpu_ES_PAD1 \ ES_PAD2=$sc_$cpu_ES_PAD2 \ ES_PAD3=$sc_$cpu_ES_PAD3 \ diff --git a/modules/es/eds/cfe_es.xml b/modules/es/eds/cfe_es.xml index 517e1e778..5e2f2077b 100644 --- a/modules/es/eds/cfe_es.xml +++ b/modules/es/eds/cfe_es.xml @@ -512,6 +512,26 @@ \cfetlmmnemonic \ES_OSMISSIONREV + + + \cfetlmmnemonic \ES_PSPMAJORVER + + + + + \cfetlmmnemonic \ES_PSPMINORVER + + + + + \cfetlmmnemonic \ES_PSPREVISION + + + + + \cfetlmmnemonic \ES_PSPMISSIONREV + + \cfetlmmnemonic \ES_SYSLOGBYTEUSED @@ -746,7 +766,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -857,7 +877,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -909,7 +929,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -970,7 +990,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1028,7 +1048,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1085,7 +1105,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1138,7 +1158,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1186,7 +1206,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1238,7 +1258,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1285,7 +1305,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1339,7 +1359,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1384,7 +1404,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1436,7 +1456,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1493,7 +1513,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1547,7 +1567,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1595,7 +1615,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1646,7 +1666,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1699,7 +1719,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1745,7 +1765,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1797,7 +1817,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1851,7 +1871,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1902,7 +1922,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment @@ -1954,7 +1974,7 @@ \par Command Verification - Successful execution of this command may be verified with + Successful execution of this command may be verified with the following telemetry: - \b \c \ES_CMDPC - command execution counter will increment diff --git a/modules/es/fsw/inc/cfe_es_msg.h b/modules/es/fsw/inc/cfe_es_msg.h index 623651255..c6b0b61bb 100644 --- a/modules/es/fsw/inc/cfe_es_msg.h +++ b/modules/es/fsw/inc/cfe_es_msg.h @@ -1489,6 +1489,15 @@ typedef struct CFE_ES_HousekeepingTlm_Payload uint8 OSALMissionRevision; /**< \cfetlmmnemonic \ES_OSMISSIONREV \brief OS Abstraction Layer MissionRevision Number */ + uint8 PSPMajorVersion; /**< \cfetlmmnemonic \ES_PSPMAJORVER + \brief Platform Support Package Major Version Number */ + uint8 PSPMinorVersion; /**< \cfetlmmnemonic \ES_PSPMINORVER + \brief Platform Support Package Minor Version Number */ + uint8 PSPRevision; /**< \cfetlmmnemonic \ES_PSPREVISION + \brief Platform Support Package Revision Number */ + uint8 PSPMissionRevision; /**< \cfetlmmnemonic \ES_PSPMISSIONREV + \brief Platform Support Package MissionRevision Number */ + CFE_ES_MemOffset_t SysLogBytesUsed; /**< \cfetlmmnemonic \ES_SYSLOGBYTEUSED \brief Total number of bytes used in system log */ CFE_ES_MemOffset_t SysLogSize; /**< \cfetlmmnemonic \ES_SYSLOGSIZE diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index c559c6625..73f4e98a7 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -338,6 +338,7 @@ int32 CFE_ES_TaskInit(void) int32 Status; uint32 SizeofCfeSegment; cpuaddr CfeSegmentAddr; + uint8 VersionNumber[4]; /* ** Register the Application @@ -444,14 +445,22 @@ int32 CFE_ES_TaskInit(void) /* ** Initialize the version numbers in the ES Housekeeping pkt */ - CFE_ES_TaskData.HkPacket.Payload.CFEMajorVersion = CFE_MAJOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.CFEMinorVersion = CFE_MINOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.CFERevision = CFE_REVISION; - CFE_ES_TaskData.HkPacket.Payload.CFEMissionRevision = CFE_MISSION_REV; - CFE_ES_TaskData.HkPacket.Payload.OSALMajorVersion = OS_MAJOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.OSALMinorVersion = OS_MINOR_VERSION; - CFE_ES_TaskData.HkPacket.Payload.OSALRevision = OS_REVISION; - CFE_ES_TaskData.HkPacket.Payload.OSALMissionRevision = OS_MISSION_REV; + CFE_ES_TaskData.HkPacket.Payload.CFEMajorVersion = CFE_MAJOR_VERSION; + CFE_ES_TaskData.HkPacket.Payload.CFEMinorVersion = CFE_MINOR_VERSION; + CFE_ES_TaskData.HkPacket.Payload.CFERevision = CFE_REVISION; + CFE_ES_TaskData.HkPacket.Payload.CFEMissionRevision = CFE_MISSION_REV; + + OS_GetVersionNumber(VersionNumber); + CFE_ES_TaskData.HkPacket.Payload.OSALMajorVersion = VersionNumber[0]; + CFE_ES_TaskData.HkPacket.Payload.OSALMinorVersion = VersionNumber[1]; + CFE_ES_TaskData.HkPacket.Payload.OSALRevision = VersionNumber[2]; + CFE_ES_TaskData.HkPacket.Payload.OSALMissionRevision = VersionNumber[3]; + + CFE_PSP_GetVersionNumber(VersionNumber); + CFE_ES_TaskData.HkPacket.Payload.PSPMajorVersion = VersionNumber[0]; + CFE_ES_TaskData.HkPacket.Payload.PSPMinorVersion = VersionNumber[1]; + CFE_ES_TaskData.HkPacket.Payload.PSPRevision = VersionNumber[2]; + CFE_ES_TaskData.HkPacket.Payload.PSPMissionRevision = VersionNumber[3]; /* ** Task startup event message. From 739bceacf5eaa245ee930d16c3a81e2b6ff2f238 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 23 Mar 2021 13:01:37 -0400 Subject: [PATCH 13/27] Fix #1194, check for NULL in SlotUsed helpers These are internal helper functions that determine if a table slot corresponding to a given ID is in use or free/available. This updates the function to handle NULL pointers even though in context they are used the lookup should always work. --- modules/es/fsw/src/cfe_es_cds.c | 9 ++++++++- modules/es/fsw/src/cfe_es_mempool.c | 9 ++++++++- modules/es/fsw/src/cfe_es_resource.c | 27 ++++++++++++++++++++++++--- modules/sb/fsw/src/cfe_sb_priv.c | 9 ++++++++- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_cds.c b/modules/es/fsw/src/cfe_es_cds.c index 9999d86eb..9e6d58603 100644 --- a/modules/es/fsw/src/cfe_es_cds.c +++ b/modules/es/fsw/src/cfe_es_cds.c @@ -170,7 +170,14 @@ int32 CFE_ES_CDSHandle_ToIndex(CFE_ES_CDSHandle_t BlockID, uint32 *Idx) */ bool CFE_ES_CheckCDSHandleSlotUsed(CFE_ResourceId_t CheckId) { - return CFE_ES_CDSBlockRecordIsUsed(CFE_ES_LocateCDSBlockRecordByID(CFE_ES_CDSHANDLE_C(CheckId))); + CFE_ES_CDS_RegRec_t *CDSRegRecPtr; + /* + * Note - The pointer here should never be NULL because the ID should always be + * within the expected range, but if it ever is NULL, this should return true + * such that the caller will _not_ attempt to use the record. + */ + CDSRegRecPtr = CFE_ES_LocateCDSBlockRecordByID(CFE_ES_CDSHANDLE_C(CheckId)); + return (CDSRegRecPtr == NULL || CFE_ES_CDSBlockRecordIsUsed(CDSRegRecPtr)); } /*******************************************************************/ diff --git a/modules/es/fsw/src/cfe_es_mempool.c b/modules/es/fsw/src/cfe_es_mempool.c index 7a084f695..1fcae67d2 100644 --- a/modules/es/fsw/src/cfe_es_mempool.c +++ b/modules/es/fsw/src/cfe_es_mempool.c @@ -104,7 +104,14 @@ int32 CFE_ES_MemPoolID_ToIndex(CFE_ES_MemHandle_t PoolID, uint32 *Idx) */ bool CFE_ES_CheckMemPoolSlotUsed(CFE_ResourceId_t CheckId) { - return CFE_ES_MemPoolRecordIsUsed(CFE_ES_LocateMemPoolRecordByID(CFE_ES_MEMHANDLE_C(CheckId))); + CFE_ES_MemPoolRecord_t *MemPoolRecPtr; + /* + * Note - The pointer here should never be NULL because the ID should always be + * within the expected range, but if it ever is NULL, this should return true + * such that the caller will _not_ attempt to use the record. + */ + MemPoolRecPtr = CFE_ES_LocateMemPoolRecordByID(CFE_ES_MEMHANDLE_C(CheckId)); + return (MemPoolRecPtr == NULL || CFE_ES_MemPoolRecordIsUsed(MemPoolRecPtr)); } CFE_ES_MemPoolRecord_t *CFE_ES_LocateMemPoolRecordByID(CFE_ES_MemHandle_t PoolID) diff --git a/modules/es/fsw/src/cfe_es_resource.c b/modules/es/fsw/src/cfe_es_resource.c index aab570a9c..4ea57e553 100644 --- a/modules/es/fsw/src/cfe_es_resource.c +++ b/modules/es/fsw/src/cfe_es_resource.c @@ -357,7 +357,14 @@ CFE_ES_AppRecord_t *CFE_ES_GetAppRecordByContext(void) */ bool CFE_ES_CheckCounterIdSlotUsed(CFE_ResourceId_t CheckId) { - return CFE_ES_CounterRecordIsUsed(CFE_ES_LocateCounterRecordByID(CFE_ES_COUNTERID_C(CheckId))); + CFE_ES_GenCounterRecord_t *GenCounterRecPtr; + /* + * Note - The pointer here should never be NULL because the ID should always be + * within the expected range, but if it ever is NULL, this should return true + * such that the caller will _not_ attempt to use the record. + */ + GenCounterRecPtr = CFE_ES_LocateCounterRecordByID(CFE_ES_COUNTERID_C(CheckId)); + return (GenCounterRecPtr == NULL || CFE_ES_CounterRecordIsUsed(GenCounterRecPtr)); } /* @@ -370,7 +377,14 @@ bool CFE_ES_CheckCounterIdSlotUsed(CFE_ResourceId_t CheckId) */ bool CFE_ES_CheckAppIdSlotUsed(CFE_ResourceId_t CheckId) { - return CFE_ES_AppRecordIsUsed(CFE_ES_LocateAppRecordByID(CFE_ES_APPID_C(CheckId))); + CFE_ES_AppRecord_t *AppRecPtr; + /* + * Note - The pointer here should never be NULL because the ID should always be + * within the expected range, but if it ever is NULL, this should return true + * such that the caller will _not_ attempt to use the record. + */ + AppRecPtr = CFE_ES_LocateAppRecordByID(CFE_ES_APPID_C(CheckId)); + return (AppRecPtr == NULL || CFE_ES_AppRecordIsUsed(AppRecPtr)); } /* @@ -383,5 +397,12 @@ bool CFE_ES_CheckAppIdSlotUsed(CFE_ResourceId_t CheckId) */ bool CFE_ES_CheckLibIdSlotUsed(CFE_ResourceId_t CheckId) { - return CFE_ES_LibRecordIsUsed(CFE_ES_LocateLibRecordByID(CFE_ES_LIBID_C(CheckId))); + CFE_ES_LibRecord_t *LibRecPtr; + /* + * Note - The pointer here should never be NULL because the ID should always be + * within the expected range, but if it ever is NULL, this should return true + * such that the caller will _not_ attempt to use the record. + */ + LibRecPtr = CFE_ES_LocateLibRecordByID(CFE_ES_LIBID_C(CheckId)); + return (LibRecPtr == NULL || CFE_ES_LibRecordIsUsed(LibRecPtr)); } diff --git a/modules/sb/fsw/src/cfe_sb_priv.c b/modules/sb/fsw/src/cfe_sb_priv.c index 5c4e9a766..c3cf3f258 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.c +++ b/modules/sb/fsw/src/cfe_sb_priv.c @@ -298,7 +298,14 @@ CFE_SB_PipeD_t *CFE_SB_LocatePipeDescByID(CFE_SB_PipeId_t PipeId) */ bool CFE_SB_CheckPipeDescSlotUsed(CFE_ResourceId_t CheckId) { - return CFE_SB_PipeDescIsUsed(CFE_SB_LocatePipeDescByID(CFE_SB_PIPEID_C(CheckId))); + CFE_SB_PipeD_t *PipeDscPtr; + /* + * Note - The pointer here should never be NULL because the ID should always be + * within the expected range, but if it ever is NULL, this should return true + * such that the caller will _not_ attempt to use the record. + */ + PipeDscPtr = CFE_SB_LocatePipeDescByID(CFE_SB_PIPEID_C(CheckId)); + return (PipeDscPtr == NULL || CFE_SB_PipeDescIsUsed(PipeDscPtr)); } /****************************************************************************** From 410447edbed78004d6c6e762bedd9fcc7c8a32a7 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 23 Mar 2021 15:12:36 -0400 Subject: [PATCH 14/27] Fix #1155, clean up zero copy API The separate zero copy handle type is removed. Adds two new simplified functions CFE_SB_AllocateMessageBuffer and CFE_SB_ReleaseMessageBuffer to replace CFE_SB_ZeroCopyGetPtr and CFE_SB_ZeroCopyGetPtr. These new functions do not use a separate Handle. Updates the CFE_SB_TransmitBuffer() API to also remove the handle. --- modules/core_api/fsw/inc/cfe_sb.h | 134 +++--------------- .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 13 -- modules/core_api/ut-stubs/src/ut_sb_stubs.c | 50 ++----- modules/sb/fsw/src/cfe_sb_api.c | 89 ++++-------- modules/sb/fsw/src/cfe_sb_priv.h | 6 +- modules/sb/ut-coverage/sb_UT.c | 124 +++++++--------- modules/sb/ut-coverage/sb_UT.h | 6 +- 7 files changed, 118 insertions(+), 304 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index c673e5329..4f1bb8dab 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -552,31 +552,26 @@ CFE_Status_t CFE_SB_RcvMsg(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int ** This routine can be used to get a pointer to one of the software bus' ** internal memory buffers that are used for sending messages. The caller ** can use this memory buffer to build an SB message, then send it using -** the #CFE_SB_TransmitBuffer function. This interface is more complicated -** than the normal #CFE_SB_TransmitMsg interface, but it avoids an extra +** the CFE_SB_TransmitBuffer() function. This interface avoids an extra ** copy of the message from the user's memory buffer to the software bus -** internal buffer. The "zero copy" interface can be used to improve -** performance in high-rate, high-volume software bus traffic. +** internal buffer. ** ** \par Assumptions, External Events, and Notes: -** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for one -** call to #CFE_SB_TransmitBuffer. -** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_TransmitBuffer is equivalent to -** a \c free(). +** -# The pointer returned by CFE_SB_AllocateMessageBuffer() is only good for one +** call to CFE_SB_TransmitBuffer(). +** -# Once a buffer has been successfully transmitted (as indicated by a successful +** return from CFE_SB_TransmitBuffer()) the buffer becomes owned by the SB application. +** It will automatically be freed by SB once all recipients have finished reading it. ** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_TransmitBuffer. +** or writing) after the call to CFE_SB_TransmitBuffer(). ** ** \param[in] MsgSize The size of the SB message buffer the caller wants ** (including the SB message header). ** -** \param[out] BufferHandle A handle that must be supplied when sending or releasing -** in zero copy mode. -** ** \return A pointer to a memory buffer that message data can be written to -** for use with #CFE_SB_TransmitBuffer. +** for use with CFE_SB_TransmitBuffer(). **/ -CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t *BufferHandle); +CFE_SB_Buffer_t *CFE_SB_AllocateMessageBuffer(size_t MsgSize); /*****************************************************************************/ /** @@ -589,21 +584,18 @@ CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t * ** \par Assumptions, External Events, and Notes: ** -# This function is not needed for normal "zero copy" transfers. It ** is needed only for cleanup when an application gets a pointer using -** #CFE_SB_ZeroCopyGetPtr, but (due to some error condition) never uses -** that pointer for a #CFE_SB_TransmitBuffer -** -** \param[in] Ptr2Release A pointer to the SB internal buffer. This must be a -** pointer returned by a call to #CFE_SB_ZeroCopyGetPtr, -** but never used in a call to #CFE_SB_TransmitBuffer. +** CFE_SB_AllocateMessageBuffer(), but (due to some error condition) never +** uses that pointer in a call to CFE_SB_TransmitBuffer(). ** -** \param[in] ZeroCopyHandle This must be the handle supplied with the pointer -** when #CFE_SB_ZeroCopyGetPtr was called. +** \param[in] BufPtr A pointer to the SB internal buffer. This must be a +** pointer returned by a call to CFE_SB_AllocateMessageBuffer(), +** but never used in a call to CFE_SB_TransmitBuffer(). ** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID **/ -CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle); +CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr); /*****************************************************************************/ /** @@ -612,14 +604,14 @@ CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_Zero ** \par Description ** This routine sends a message that has been created directly in an ** internal SB message buffer by an application (after a call to -** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than +** #CFE_SB_AllocateMessageBuffer). This interface is more complicated than ** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of ** the message from the user's memory buffer to the software bus ** internal buffer. The "zero copy" interface can be used to improve ** performance in high-rate, high-volume software bus traffic. ** ** \par Assumptions, External Events, and Notes: -** -# A handle returned by #CFE_SB_ZeroCopyGetPtr is "consumed" by +** -# A handle returned by #CFE_SB_AllocateMessageBuffer is "consumed" by ** a _successful_ call to #CFE_SB_TransmitBuffer. ** -# If this function returns CFE_SUCCESS, this indicates the zero copy handle is ** now owned by software bus, and is no longer owned by the calling application, @@ -627,7 +619,7 @@ CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_Zero ** -# Howver if this function fails (returns any error status) it does not change ** the state of the buffer at all, meaning the calling application still owns it. ** (a failure means the buffer is left in the same state it was before the call). -** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is +** -# Applications should be written as if #CFE_SB_AllocateMessageBuffer is ** equivalent to a \c malloc() and a successful call to #CFE_SB_TransmitBuffer ** is equivalent to a \c free(). ** -# Applications must not de-reference the message pointer (for reading @@ -636,7 +628,6 @@ CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_Zero ** sequence counter if set to do so. ** ** \param[in] BufPtr A pointer to the buffer to be sent. -** \param[in] ZeroCopyHandle The handle supplied by the #CFE_SB_ZeroCopyGetPtr call ** \param[in] IncrementSequenceCount Boolean to increment the internally tracked ** sequence count and update the message if the ** buffer contains a telemetry message @@ -645,93 +636,8 @@ CFE_Status_t CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_Zero ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT ** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR **/ -CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle, - bool IncrementSequenceCount); - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/*****************************************************************************/ -/** -** \brief DEPRECATED: Send an SB message in "zero copy" mode. -** \deprecated use CFE_SB_TransmitBuffer -** -** \par Description -** This routine sends a message that has been created directly in an -** internal SB message buffer by an application (after a call to -** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than -** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of -** the message from the user's memory buffer to the software bus -** internal buffer. The "zero copy" interface can be used to improve -** performance in high-rate, high-volume software bus traffic. -** -** \par Assumptions, External Events, and Notes: -** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for -** one call to #CFE_SB_TransmitBuffer. -** -# Callers must not use the same SB message buffer for multiple sends. -** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_TransmitBuffer is equivalent -** to a \c free(). -** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_TransmitBuffer. -** -# This function tracks and increments the source sequence counter -** of a telemetry message. -** -** \param[in] BufPtr A pointer to the SB buffer to be sent. -** -** \param[in] BufferHandle The handle supplied with the #CFE_SB_ZeroCopyGetPtr call. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT -** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID -**/ -CFE_Status_t CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); - -/*****************************************************************************/ -/** -** \brief DEPRECATED: Pass an SB message in "zero copy" mode. -** \deprecated use CFE_SB_TransmitBuffer -** -** \par Description -** This routine sends a message that has been created directly in an -** internal SB message buffer by an application (after a call to -** #CFE_SB_ZeroCopyGetPtr). This interface is more complicated than -** the normal #CFE_SB_TransmitMsg interface, but it avoids an extra copy of -** the message from the user's memory buffer to the software bus -** internal buffer. The "zero copy" interface can be used to improve -** performance in high-rate, high-volume software bus traffic. This -** version is intended to pass messages not generated by the caller -** (to preserve the source sequence count). -** -** \par Assumptions, External Events, and Notes: -** -# The pointer returned by #CFE_SB_ZeroCopyGetPtr is only good for -** one call to #CFE_SB_TransmitBuffer or #CFE_SB_ZeroCopyPass. -** -# Callers must not use the same SB message buffer for multiple sends. -** -# Applications should be written as if #CFE_SB_ZeroCopyGetPtr is -** equivalent to a \c malloc() and #CFE_SB_ZeroCopyPass is equivalent -** to a \c free(). -** -# Applications must not de-reference the message pointer (for reading -** or writing) after the call to #CFE_SB_ZeroCopyPass. -** -# This routine will not modify the sequence counter in a telemetry -** message -** -** \param[in] BufPtr A pointer to the SB buffer to be sent. -** -** \param[in] BufferHandle The handle supplied with the #CFE_SB_ZeroCopyGetPtr call. -** -** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_SB_BAD_ARGUMENT \copybrief CFE_SB_BAD_ARGUMENT -** \retval #CFE_SB_MSG_TOO_BIG \copybrief CFE_SB_MSG_TOO_BIG -** \retval #CFE_SB_BUF_ALOC_ERR \copybrief CFE_SB_BUF_ALOC_ERR -** \retval #CFE_SB_BUFFER_INVALID \copybrief CFE_SB_BUFFER_INVALID -**/ -CFE_Status_t CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle); -/**@}*/ -#endif +CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount); /** @defgroup CFEAPISBSetMessage cFE Setting Message Characteristics APIs * @{ diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h index 3aca7caaf..04b967311 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -162,19 +162,6 @@ typedef CFE_MSG_Message_t *CFE_SB_MsgPtr_t; /** \brief CFE_SB_MsgPayloadPtr_t defined as an opaque pointer to a message Payload portion */ typedef uint8 *CFE_SB_MsgPayloadPtr_t; -#endif /* CFE_OMIT_DEPRECATED_6_8 */ - -/** \brief CFE_SB_ZeroCopyHandle_t to primitive type definition -** -** Software Zero Copy handle used in many SB APIs -*/ -typedef struct -{ - struct CFE_SB_BufferD *BufDscPtr; /* abstract descriptor reference (internal use) */ -} CFE_SB_ZeroCopyHandle_t; - -#ifndef CFE_OMIT_DEPRECATED_6_8 - #define CFE_SB_Default_Qos CFE_SB_DEFAULT_QOS /**< \deprecated use CFE_SB_DEFAULT_QOS */ #define CFE_SB_CMD_HDR_SIZE (sizeof(CFE_MSG_CommandHeader_t)) /**< \brief Size of command header */ diff --git a/modules/core_api/ut-stubs/src/ut_sb_stubs.c b/modules/core_api/ut-stubs/src/ut_sb_stubs.c index 296c18ed6..d9fd7a866 100644 --- a/modules/core_api/ut-stubs/src/ut_sb_stubs.c +++ b/modules/core_api/ut-stubs/src/ut_sb_stubs.c @@ -510,11 +510,9 @@ int32 CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenceCount) ** Returns CFE_SUCCESS or overridden unit test value ** ******************************************************************************/ -int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle, - bool IncrementSequenceCount) +int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount) { - UT_Stub_RegisterContext(UT_KEY(CFE_SB_TransmitBuffer), BufPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_TransmitBuffer), ZeroCopyHandle); + UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_TransmitBuffer), BufPtr); UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_TransmitBuffer), IncrementSequenceCount); int32 status = CFE_SUCCESS; @@ -1159,60 +1157,30 @@ int32 CFE_SB_UnsubscribeLocal(CFE_SB_MsgId_t MsgId, CFE_SB_PipeId_t PipeId) return status; } -CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t *BufferHandle) +CFE_SB_Buffer_t *CFE_SB_AllocateMessageBuffer(size_t MsgSize) { - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ZeroCopyGetPtr), MsgSize); - UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopyGetPtr), BufferHandle); + UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_AllocateMessageBuffer), MsgSize); int32 status; CFE_SB_Buffer_t *SBBufPtr = NULL; - status = UT_DEFAULT_IMPL(CFE_SB_ZeroCopyGetPtr); + status = UT_DEFAULT_IMPL(CFE_SB_AllocateMessageBuffer); if (status == CFE_SUCCESS) { - UT_Stub_CopyToLocal(UT_KEY(CFE_SB_ZeroCopyGetPtr), &SBBufPtr, sizeof(SBBufPtr)); + UT_Stub_CopyToLocal(UT_KEY(CFE_SB_AllocateMessageBuffer), &SBBufPtr, sizeof(SBBufPtr)); } return SBBufPtr; } -#ifndef CFE_OMIT_DEPRECATED_6_8 -int32 CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopyPass), BufPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ZeroCopyPass), BufferHandle); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_ZeroCopyPass); - - return status; -} -#endif - -int32 CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopyReleasePtr), Ptr2Release); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ZeroCopyReleasePtr), BufferHandle); - - int32 status; - - status = UT_DEFAULT_IMPL(CFE_SB_ZeroCopyReleasePtr); - - return status; -} - -#ifndef CFE_OMIT_DEPRECATED_6_8 -int32 CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) +int32 CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr) { - UT_Stub_RegisterContext(UT_KEY(CFE_SB_ZeroCopySend), BufPtr); - UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ZeroCopySend), BufferHandle); + UT_Stub_RegisterContextGenericArg(UT_KEY(CFE_SB_ReleaseMessageBuffer), BufPtr); int32 status; - status = UT_DEFAULT_IMPL(CFE_SB_ZeroCopySend); + status = UT_DEFAULT_IMPL(CFE_SB_ReleaseMessageBuffer); return status; } -#endif diff --git a/modules/sb/fsw/src/cfe_sb_api.c b/modules/sb/fsw/src/cfe_sb_api.c index f96ba031d..3e0d0717a 100644 --- a/modules/sb/fsw/src/cfe_sb_api.c +++ b/modules/sb/fsw/src/cfe_sb_api.c @@ -2072,9 +2072,9 @@ int32 CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int } /* - * Function: CFE_SB_ZeroCopyGetPtr - See API and header file for details + * Function: CFE_SB_AllocateMessageBuffer - See API and header file for details */ -CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t *BufferHandle) +CFE_SB_Buffer_t *CFE_SB_AllocateMessageBuffer(size_t MsgSize) { CFE_ES_AppId_t AppId; CFE_SB_BufferD_t *BufDscPtr; @@ -2083,18 +2083,13 @@ CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t * AppId = CFE_ES_APPID_UNDEFINED; BufDscPtr = NULL; BufPtr = NULL; + if (MsgSize > CFE_MISSION_SB_MAX_SB_MSG_SIZE) { CFE_ES_WriteToSysLog(" CFE_SB:ZeroCopyGetPtr-Failed, MsgSize is too large\n"); return NULL; } - if (BufferHandle == NULL) - { - CFE_ES_WriteToSysLog(" CFE_SB:ZeroCopyGetPtr-BufferHandle is NULL\n"); - return NULL; - } - /* get callers AppId */ if (CFE_ES_GetAppID(&AppId) == CFE_SUCCESS) { @@ -2128,34 +2123,37 @@ CFE_SB_Buffer_t *CFE_SB_ZeroCopyGetPtr(size_t MsgSize, CFE_SB_ZeroCopyHandle_t * memset(BufPtr, 0, MsgSize); } - /* Export both items (descriptor + msg buffer) to caller */ - BufferHandle->BufDscPtr = BufDscPtr; return BufPtr; -} /* CFE_SB_ZeroCopyGetPtr */ +} /* CFE_SB_AllocateMessageBuffer */ /* - * Helper functions to do sanity checks on the Zero Copy handle + Buffer combo. - * - * Note in a future CFE version the API can be simplified - - * only one of these pointers is strictly needed, since they - * should refer to the same buffer descriptor object. + * Helper function to do sanity checks on the Zero Copy Buffer and + * outputs the encapsulating descriptor if successful */ -int32 CFE_SB_ZeroCopyHandleValidate(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle) +int32 CFE_SB_ZeroCopyBufferValidate(CFE_SB_Buffer_t *BufPtr, CFE_SB_BufferD_t **BufDscPtr) { + cpuaddr BufDscAddr; + /* * Sanity Check that the pointers are not NULL */ - if (BufPtr == NULL || ZeroCopyHandle.BufDscPtr == NULL) + if (BufPtr == NULL) { return CFE_SB_BAD_ARGUMENT; } + /* + * Calculate descriptor pointer from buffer pointer - + * The buffer is just a member (offset) in the descriptor + */ + BufDscAddr = (cpuaddr)BufPtr - offsetof(CFE_SB_BufferD_t, Content); + *BufDscPtr = (CFE_SB_BufferD_t *)BufDscAddr; + /* * Check that the descriptor is actually a "zero copy" type, - * and that it refers to same actual message buffer. */ - if (!CFE_RESOURCEID_TEST_DEFINED(ZeroCopyHandle.BufDscPtr->AppId) || (&ZeroCopyHandle.BufDscPtr->Content != BufPtr)) + if (!CFE_RESOURCEID_TEST_DEFINED((*BufDscPtr)->AppId)) { return CFE_SB_BUFFER_INVALID; } @@ -2165,46 +2163,43 @@ int32 CFE_SB_ZeroCopyHandleValidate(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHand } /* - * Function: CFE_SB_ZeroCopyReleasePtr - See API and header file for details + * Function: CFE_SB_ReleaseMessageBuffer - See API and header file for details */ -int32 CFE_SB_ZeroCopyReleasePtr(CFE_SB_Buffer_t *Ptr2Release, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle) +CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr) { - int32 Status; + CFE_SB_BufferD_t *BufDscPtr; + int32 Status; - Status = CFE_SB_ZeroCopyHandleValidate(Ptr2Release, ZeroCopyHandle); + Status = CFE_SB_ZeroCopyBufferValidate(BufPtr, &BufDscPtr); CFE_SB_LockSharedData(__func__, __LINE__); if (Status == CFE_SUCCESS) { /* Clear the ownership app ID and decrement use count (may also free) */ - ZeroCopyHandle.BufDscPtr->AppId = CFE_ES_APPID_UNDEFINED; - CFE_SB_DecrBufUseCnt(ZeroCopyHandle.BufDscPtr); + BufDscPtr->AppId = CFE_ES_APPID_UNDEFINED; + CFE_SB_DecrBufUseCnt(BufDscPtr); } CFE_SB_UnlockSharedData(__func__, __LINE__); return Status; -} /* end CFE_SB_ZeroCopyReleasePtr */ +} /* end CFE_SB_ReleaseMessageBuffer */ /* * Function CFE_SB_TransmitBuffer - See API and header file for details */ -int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle, - bool IncrementSequenceCount) +int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount) { int32 Status; CFE_SB_BufferD_t *BufDscPtr; CFE_SBR_RouteId_t RouteId; - Status = CFE_SB_ZeroCopyHandleValidate(BufPtr, ZeroCopyHandle); + Status = CFE_SB_ZeroCopyBufferValidate(BufPtr, &BufDscPtr); if (Status == CFE_SUCCESS) { - /* Get actual buffer descriptor pointer from zero copy handle */ - BufDscPtr = ZeroCopyHandle.BufDscPtr; - /* Validate the content and get the MsgId, store it in the descriptor */ Status = CFE_SB_TransmitMsgValidate(&BufPtr->Msg, &BufDscPtr->MsgId, &BufDscPtr->ContentSize, &RouteId); @@ -2244,31 +2239,3 @@ int32 CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t Zer return Status; } - -#ifndef CFE_OMIT_DEPRECATED_6_8 -/* - * Function: CFE_SB_ZeroCopySend - See API and header file for details - */ -int32 CFE_SB_ZeroCopySend(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - int32 Status = 0; - - Status = CFE_SB_TransmitBuffer(BufPtr, BufferHandle, true); - - return Status; - -} /* end CFE_SB_ZeroCopySend */ - -/* - * Function: CFE_SB_ZeroCopyPass - See API and header file for details - */ -int32 CFE_SB_ZeroCopyPass(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t BufferHandle) -{ - int32 Status = 0; - - Status = CFE_SB_TransmitBuffer(BufPtr, BufferHandle, false); - - return Status; - -} /* end CFE_SB_ZeroCopyPass */ -#endif diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index cb596fe25..e1533fd03 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -423,12 +423,12 @@ void CFE_SB_BroadcastBufferToRoute(CFE_SB_BufferD_t *BufDscPtr, CFE_SBR_RouteId_ /** * \brief Perform basic sanity check on the Zero Copy handle * - * \param[in] BufPtr pointer to the content buffer - * \param[in] ZeroCopyHandle Zero copy handle to check + * \param[in] BufPtr pointer to the content buffer + * \param[out] BufDscPtr Will be set to actual buffer descriptor * * \returns CFE_SUCCESS if validation passed, or error code. */ -int32 CFE_SB_ZeroCopyHandleValidate(CFE_SB_Buffer_t *BufPtr, CFE_SB_ZeroCopyHandle_t ZeroCopyHandle); +int32 CFE_SB_ZeroCopyBufferValidate(CFE_SB_Buffer_t *BufPtr, CFE_SB_BufferD_t **BufDscPtr); /** * \brief Add a destination node diff --git a/modules/sb/ut-coverage/sb_UT.c b/modules/sb/ut-coverage/sb_UT.c index 76d530570..85d2ea7cf 100644 --- a/modules/sb/ut-coverage/sb_UT.c +++ b/modules/sb/ut-coverage/sb_UT.c @@ -2720,15 +2720,15 @@ void Test_TransmitMsg_API(void) SB_UT_ADD_SUBTEST(Test_TransmitMsg_PipeFull); SB_UT_ADD_SUBTEST(Test_TransmitMsg_MsgLimitExceeded); SB_UT_ADD_SUBTEST(Test_TransmitMsg_GetPoolBufErr); - SB_UT_ADD_SUBTEST(Test_TransmitMsg_ZeroCopyGetPtr); SB_UT_ADD_SUBTEST(Test_TransmitBuffer_IncrementSeqCnt); SB_UT_ADD_SUBTEST(Test_TransmitBuffer_NoIncrement); - SB_UT_ADD_SUBTEST(Test_TransmitMsg_ZeroCopyHandleValidate); - SB_UT_ADD_SUBTEST(Test_TransmitMsg_ZeroCopyReleasePtr); + SB_UT_ADD_SUBTEST(Test_TransmitMsg_ZeroCopyBufferValidate); SB_UT_ADD_SUBTEST(Test_TransmitMsg_DisabledDestination); SB_UT_ADD_SUBTEST(Test_BroadcastBufferToRoute); SB_UT_ADD_SUBTEST(Test_TransmitMsgValidate_MaxMsgSizePlusOne); SB_UT_ADD_SUBTEST(Test_TransmitMsgValidate_NoSubscribers); + SB_UT_ADD_SUBTEST(Test_AllocateMessageBuffer); + SB_UT_ADD_SUBTEST(Test_ReleaseMessageBuffer); } /* end Test_TransmitMsg_API */ /* @@ -3030,17 +3030,16 @@ void Test_TransmitMsg_GetPoolBufErr(void) ** Test getting a pointer to a buffer for zero copy mode with buffer ** allocation failures */ -void Test_TransmitMsg_ZeroCopyGetPtr(void) +void Test_AllocateMessageBuffer(void) { - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl; - uint16 MsgSize = 10; - uint32 MemUse; + uint16 MsgSize = 10; + uint32 MemUse; /* Have GetPoolBuf stub return error on its next call (buf descriptor * allocation failed) */ UT_SetDeferredRetcode(UT_KEY(CFE_ES_GetPoolBuf), 1, CFE_ES_ERR_MEM_BLOCK_SIZE); - ASSERT_TRUE(CFE_SB_ZeroCopyGetPtr(MsgSize, &ZeroCpyBufHndl) == NULL); + ASSERT_TRUE(CFE_SB_AllocateMessageBuffer(MsgSize) == NULL); EVTCNT(0); @@ -3053,7 +3052,7 @@ void Test_TransmitMsg_ZeroCopyGetPtr(void) CFE_SB_Global.StatTlmMsg.Payload.MemInUse = 0; CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse = MemUse + 10; CFE_SB_Global.StatTlmMsg.Payload.PeakSBBuffersInUse = CFE_SB_Global.StatTlmMsg.Payload.SBBuffersInUse + 2; - ASSERT_TRUE(CFE_SB_ZeroCopyGetPtr(MsgSize, &ZeroCpyBufHndl) != NULL); + ASSERT_TRUE(CFE_SB_AllocateMessageBuffer(MsgSize) != NULL); ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.PeakMemInUse, MemUse + 10); /* unchanged */ ASSERT_EQ(CFE_SB_Global.StatTlmMsg.Payload.MemInUse, MemUse); /* predicted value */ @@ -3064,46 +3063,37 @@ void Test_TransmitMsg_ZeroCopyGetPtr(void) } /* end Test_TransmitMsg_ZeroCopyGetPtr */ -void Test_TransmitMsg_ZeroCopyHandleValidate(void) +void Test_TransmitMsg_ZeroCopyBufferValidate(void) { - CFE_SB_Buffer_t * SendPtr; - CFE_SB_ZeroCopyHandle_t GoodZeroCpyBufHndl; - CFE_SB_ZeroCopyHandle_t BadZeroCpyBufHndl; - CFE_SB_ZeroCopyHandle_t NullZeroCpyBufHndl; - CFE_SB_BufferD_t TestBufDsc; + CFE_SB_Buffer_t * SendPtr; + CFE_SB_BufferD_t BadZeroCpyBuf; + CFE_SB_BufferD_t *BufDscPtr; /* Create a real/valid Zero Copy handle via the API */ - SendPtr = CFE_SB_ZeroCopyGetPtr(sizeof(SB_UT_Test_Tlm_t), &GoodZeroCpyBufHndl); + SendPtr = CFE_SB_AllocateMessageBuffer(sizeof(SB_UT_Test_Tlm_t)); if (SendPtr == NULL) { UtAssert_Failed("Unexpected NULL pointer returned from ZeroCopyGetPtr"); } - /* The NULL handle is just zero */ - NullZeroCpyBufHndl = (CFE_SB_ZeroCopyHandle_t) {0}; - /* Create an invalid Zero Copy handle that is not NULL but refers to a - * descriptor which is NOT from CFE_SB_ZeroCopyGetPtr(). */ - memset(&TestBufDsc, 0, sizeof(TestBufDsc)); - BadZeroCpyBufHndl = (CFE_SB_ZeroCopyHandle_t) {&TestBufDsc}; - - /* Good buffer pointer + Null Handle => BAD_ARGUMENT */ - ASSERT_EQ(CFE_SB_ZeroCopyHandleValidate(SendPtr, NullZeroCpyBufHndl), CFE_SB_BAD_ARGUMENT); - - /* Bad buffer pointer + Good Handle => BAD_ARGUMENT */ - ASSERT_EQ(CFE_SB_ZeroCopyHandleValidate(NULL, GoodZeroCpyBufHndl), CFE_SB_BAD_ARGUMENT); + * descriptor which is NOT from CFE_SB_AllocateMessageBuffer(). */ + memset(&BadZeroCpyBuf, 0, sizeof(BadZeroCpyBuf)); - /* Good buffer pointer + Non Zero-Copy Handle => CFE_SB_BUFFER_INVALID */ - ASSERT_EQ(CFE_SB_ZeroCopyHandleValidate(SendPtr, BadZeroCpyBufHndl), CFE_SB_BUFFER_INVALID); + /* Null Buffer => BAD_ARGUMENT */ + ASSERT_EQ(CFE_SB_ZeroCopyBufferValidate(NULL, &BufDscPtr), CFE_SB_BAD_ARGUMENT); - /* Mismatched buffer pointer + Good Handle => CFE_SB_BUFFER_INVALID */ - ASSERT_EQ(CFE_SB_ZeroCopyHandleValidate(SendPtr + 1, GoodZeroCpyBufHndl), CFE_SB_BUFFER_INVALID); + /* Non-null buffer pointer but Non Zero-Copy => CFE_SB_BUFFER_INVALID */ + ASSERT_EQ(CFE_SB_ZeroCopyBufferValidate(&BadZeroCpyBuf.Content, &BufDscPtr), CFE_SB_BUFFER_INVALID); /* Good buffer pointer + Good Handle => SUCCESS */ - ASSERT_EQ(CFE_SB_ZeroCopyHandleValidate(SendPtr, GoodZeroCpyBufHndl), CFE_SUCCESS); + ASSERT_EQ(CFE_SB_ZeroCopyBufferValidate(SendPtr, &BufDscPtr), CFE_SUCCESS); + + /* Confirm that the computed pointer was correct */ + ASSERT_TRUE(&BufDscPtr->Content == SendPtr); /* Clean-up */ - CFE_SB_ZeroCopyReleasePtr(SendPtr, GoodZeroCpyBufHndl); + CFE_SB_ReleaseMessageBuffer(SendPtr); } /* @@ -3117,7 +3107,6 @@ void Test_TransmitBuffer_IncrementSeqCnt(void) CFE_SB_PipeId_t PipeId; CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; uint32 PipeDepth = 10; - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl; CFE_MSG_SequenceCount_t SeqCnt; CFE_MSG_Size_t Size = sizeof(SB_UT_Test_Tlm_t); CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; @@ -3130,7 +3119,7 @@ void Test_TransmitBuffer_IncrementSeqCnt(void) SETUP(CFE_SB_Subscribe(MsgId, PipeId)); /* Create a real/valid Zero Copy handle via the API */ - SendPtr = CFE_SB_ZeroCopyGetPtr(sizeof(SB_UT_Test_Tlm_t), &ZeroCpyBufHndl); + SendPtr = CFE_SB_AllocateMessageBuffer(sizeof(SB_UT_Test_Tlm_t)); if (SendPtr == NULL) { UtAssert_Failed("Unexpected NULL pointer returned from ZeroCopyGetPtr"); @@ -3141,7 +3130,7 @@ void Test_TransmitBuffer_IncrementSeqCnt(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Test a successful zero copy send */ - ASSERT(CFE_SB_TransmitBuffer(SendPtr, ZeroCpyBufHndl, true)); + ASSERT(CFE_SB_TransmitBuffer(SendPtr, true)); ASSERT(CFE_SB_ReceiveBuffer(&ReceivePtr, PipeId, CFE_SB_PEND_FOREVER)); @@ -3167,10 +3156,9 @@ void Test_TransmitBuffer_NoIncrement(void) CFE_SB_PipeId_t PipeId; CFE_SB_MsgId_t MsgId = SB_UT_TLM_MID; uint32 PipeDepth = 10; - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl; - CFE_MSG_SequenceCount_t SeqCnt = 22; - CFE_MSG_Size_t Size = sizeof(SB_UT_Test_Tlm_t); - CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; + CFE_MSG_SequenceCount_t SeqCnt = 22; + CFE_MSG_Size_t Size = sizeof(SB_UT_Test_Tlm_t); + CFE_MSG_Type_t Type = CFE_MSG_Type_Tlm; /* Set up hook for checking CFE_MSG_SetSequenceCount calls */ UT_SetHookFunction(UT_KEY(CFE_MSG_SetSequenceCount), UT_CheckSetSequenceCount, &SeqCnt); @@ -3178,7 +3166,7 @@ void Test_TransmitBuffer_NoIncrement(void) SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "ZeroCpyPassTestPipe")); SETUP(CFE_SB_Subscribe(MsgId, PipeId)); - SendPtr = CFE_SB_ZeroCopyGetPtr(sizeof(SB_UT_Test_Tlm_t), &ZeroCpyBufHndl); + SendPtr = CFE_SB_AllocateMessageBuffer(sizeof(SB_UT_Test_Tlm_t)); if (SendPtr == NULL) { @@ -3190,7 +3178,7 @@ void Test_TransmitBuffer_NoIncrement(void) UT_SetDataBuffer(UT_KEY(CFE_MSG_GetType), &Type, sizeof(Type), false); /* Test a successful zero copy pass */ - ASSERT(CFE_SB_TransmitBuffer(SendPtr, ZeroCpyBufHndl, false)); + ASSERT(CFE_SB_TransmitBuffer(SendPtr, false)); ASSERT(CFE_SB_ReceiveBuffer(&ReceivePtr, PipeId, CFE_SB_PEND_FOREVER)); ASSERT_TRUE(SendPtr == ReceivePtr); @@ -3206,35 +3194,34 @@ void Test_TransmitBuffer_NoIncrement(void) /* ** Test releasing a pointer to a buffer for zero copy mode */ -void Test_TransmitMsg_ZeroCopyReleasePtr(void) +void Test_ReleaseMessageBuffer(void) { - CFE_SB_Buffer_t * ZeroCpyMsgPtr1 = NULL; - CFE_SB_Buffer_t * ZeroCpyMsgPtr2 = NULL; - CFE_SB_Buffer_t * ZeroCpyMsgPtr3 = NULL; - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl1; - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl2; - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl3; - uint16 MsgSize = 10; + CFE_SB_Buffer_t *ZeroCpyMsgPtr1 = NULL; + CFE_SB_Buffer_t *ZeroCpyMsgPtr2 = NULL; + CFE_SB_Buffer_t *ZeroCpyMsgPtr3 = NULL; + CFE_SB_BufferD_t BadBufferDesc; + uint16 MsgSize = 10; - ZeroCpyMsgPtr1 = CFE_SB_ZeroCopyGetPtr(MsgSize, &ZeroCpyBufHndl1); - ZeroCpyMsgPtr2 = CFE_SB_ZeroCopyGetPtr(MsgSize, &ZeroCpyBufHndl2); - ZeroCpyMsgPtr3 = CFE_SB_ZeroCopyGetPtr(MsgSize, &ZeroCpyBufHndl3); - SETUP(CFE_SB_ZeroCopyReleasePtr(ZeroCpyMsgPtr2, ZeroCpyBufHndl2)); + ZeroCpyMsgPtr1 = CFE_SB_AllocateMessageBuffer(MsgSize); + ZeroCpyMsgPtr2 = CFE_SB_AllocateMessageBuffer(MsgSize); + ZeroCpyMsgPtr3 = CFE_SB_AllocateMessageBuffer(MsgSize); + SETUP(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr2)); - /* Test response to an invalid buffer */ - ASSERT_EQ(CFE_SB_ZeroCopyReleasePtr(ZeroCpyMsgPtr2, ZeroCpyBufHndl2), CFE_SB_BUFFER_INVALID); + /* Test response to an invalid buffer (has been released already) */ + ASSERT_EQ(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr2), CFE_SB_BUFFER_INVALID); /* Test response to a null message pointer */ - ASSERT_EQ(CFE_SB_ZeroCopyReleasePtr(NULL, ZeroCpyBufHndl3), CFE_SB_BAD_ARGUMENT); + ASSERT_EQ(CFE_SB_ReleaseMessageBuffer(NULL), CFE_SB_BAD_ARGUMENT); /* Test response to an invalid message pointer */ - ASSERT_EQ(CFE_SB_ZeroCopyReleasePtr(ZeroCpyMsgPtr1, ZeroCpyBufHndl3), CFE_SB_BUFFER_INVALID); + memset(&BadBufferDesc, 0, sizeof(BadBufferDesc)); + ASSERT_EQ(CFE_SB_ReleaseMessageBuffer(&BadBufferDesc.Content), CFE_SB_BUFFER_INVALID); /* Test successful release of the second buffer */ - ASSERT(CFE_SB_ZeroCopyReleasePtr(ZeroCpyMsgPtr3, ZeroCpyBufHndl3)); + ASSERT(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr3)); /* Test successful release of the third buffer */ - ASSERT(CFE_SB_ZeroCopyReleasePtr(ZeroCpyMsgPtr1, ZeroCpyBufHndl1)); + ASSERT(CFE_SB_ReleaseMessageBuffer(ZeroCpyMsgPtr1)); EVTCNT(0); @@ -3510,11 +3497,10 @@ void Test_ReceiveBuffer_PendForever(void) */ void Test_CleanupApp_API(void) { - CFE_SB_PipeId_t PipeId; - CFE_SB_ZeroCopyHandle_t ZeroCpyBufHndl; - uint16 PipeDepth = 10; - CFE_ES_AppId_t AppID; - CFE_ES_AppId_t AppID2; + CFE_SB_PipeId_t PipeId; + uint16 PipeDepth = 10; + CFE_ES_AppId_t AppID; + CFE_ES_AppId_t AppID2; /* * Reset global descriptor list @@ -3525,15 +3511,15 @@ void Test_CleanupApp_API(void) AppID2 = CFE_ES_APPID_C(CFE_ResourceId_FromInteger(2)); SETUP(CFE_SB_CreatePipe(&PipeId, PipeDepth, "TestPipe")); - CFE_SB_ZeroCopyGetPtr(10, &ZeroCpyBufHndl); + CFE_SB_AllocateMessageBuffer(10); /* Mimic a different app ID getting a buffer */ UT_SetAppID(AppID2); - CFE_SB_ZeroCopyGetPtr(10, &ZeroCpyBufHndl); + CFE_SB_AllocateMessageBuffer(10); /* Original app gets a second buffer */ UT_SetAppID(AppID); - CFE_SB_ZeroCopyGetPtr(10, &ZeroCpyBufHndl); + CFE_SB_AllocateMessageBuffer(10); /* Set second application ID to provide complete branch path coverage */ CFE_SB_Global.PipeTbl[1].PipeId = SB_UT_PIPEID_1; diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index f7f08f63a..a61af0004 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -1916,7 +1916,7 @@ void Test_TransmitMsg_GetPoolBufErr(void); ** \returns ** This function does not return a value. ******************************************************************************/ -void Test_TransmitMsg_ZeroCopyGetPtr(void); +void Test_AllocateMessageBuffer(void); /*****************************************************************************/ /** @@ -1948,7 +1948,7 @@ void Test_TransmitBuffer_IncrementSeqCnt(void); ** \returns ** This function does not return a value. ******************************************************************************/ -void Test_TransmitMsg_ZeroCopyHandleValidate(void); +void Test_TransmitMsg_ZeroCopyBufferValidate(void); /*****************************************************************************/ /** @@ -1981,7 +1981,7 @@ void Test_TransmitBuffer_NoIncrement(void); ** \returns ** This function does not return a value. ******************************************************************************/ -void Test_TransmitMsg_ZeroCopyReleasePtr(void); +void Test_ReleaseMessageBuffer(void); /*****************************************************************************/ /** From d71366ffee2bf6467b4151ba45f562a22c26bc76 Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Tue, 23 Mar 2021 11:44:32 -0400 Subject: [PATCH 15/27] Fix #1252, Squash potentially uninitialized variable warnings --- modules/es/fsw/src/cfe_es_apps.c | 2 +- modules/es/fsw/src/cfe_es_task.c | 6 +++--- modules/evs/fsw/src/cfe_evs_log.c | 2 +- modules/evs/fsw/src/cfe_evs_task.c | 2 +- modules/msg/fsw/src/cfe_msg_msgid_shared.c | 3 +++ modules/sb/fsw/src/cfe_sb_task.c | 6 +----- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/es/fsw/src/cfe_es_apps.c b/modules/es/fsw/src/cfe_es_apps.c index 1944e7153..03870064b 100644 --- a/modules/es/fsw/src/cfe_es_apps.c +++ b/modules/es/fsw/src/cfe_es_apps.c @@ -79,7 +79,7 @@ void CFE_ES_StartApplications(uint32 ResetType, const char *StartFilePath) const char *TokenList[CFE_ES_STARTSCRIPT_MAX_TOKENS_PER_LINE]; uint32 NumTokens; uint32 BuffLen; /* Length of the current buffer */ - osal_id_t AppFile; + osal_id_t AppFile = OS_OBJECT_ID_UNDEFINED; int32 Status; char c; bool LineTooLong = false; diff --git a/modules/es/fsw/src/cfe_es_task.c b/modules/es/fsw/src/cfe_es_task.c index c559c6625..4f12b123c 100644 --- a/modules/es/fsw/src/cfe_es_task.c +++ b/modules/es/fsw/src/cfe_es_task.c @@ -1218,7 +1218,7 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOneCmd_t *data) int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) { CFE_FS_Header_t FileHeader; - osal_id_t FileDescriptor; + osal_id_t FileDescriptor = OS_OBJECT_ID_UNDEFINED; uint32 i; uint32 EntryCount = 0; uint32 FileSize = 0; @@ -1373,7 +1373,7 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAllCmd_t *data) int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasksCmd_t *data) { CFE_FS_Header_t FileHeader; - osal_id_t FileDescriptor; + osal_id_t FileDescriptor = OS_OBJECT_ID_UNDEFINED; uint32 i; uint32 EntryCount = 0; uint32 FileSize = 0; @@ -1884,7 +1884,7 @@ int32 CFE_ES_SendMemPoolStatsCmd(const CFE_ES_SendMemPoolStatsCmd_t *data) int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistryCmd_t *data) { CFE_FS_Header_t StdFileHeader; - osal_id_t FileDescriptor; + osal_id_t FileDescriptor = OS_OBJECT_ID_UNDEFINED; int32 Status; int16 RegIndex = 0; const CFE_ES_DumpCDSRegistryCmd_Payload_t *CmdPtr = &data->Payload; diff --git a/modules/evs/fsw/src/cfe_evs_log.c b/modules/evs/fsw/src/cfe_evs_log.c index bd665e005..1118eb158 100644 --- a/modules/evs/fsw/src/cfe_evs_log.c +++ b/modules/evs/fsw/src/cfe_evs_log.c @@ -139,7 +139,7 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data) int32 Result; int32 LogIndex; int32 BytesWritten; - osal_id_t LogFileHandle; + osal_id_t LogFileHandle = OS_OBJECT_ID_UNDEFINED; uint32 i; CFE_FS_Header_t LogFileHdr; char LogFilename[OS_MAX_PATH_LEN]; diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index e225fc0e7..40237bf8f 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -1683,7 +1683,7 @@ int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilterCmd_t *data) int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFileCmd_t *data) { int32 Result; - osal_id_t FileHandle; + osal_id_t FileHandle = OS_OBJECT_ID_UNDEFINED; int32 BytesWritten; uint32 EntryCount = 0; uint32 i; diff --git a/modules/msg/fsw/src/cfe_msg_msgid_shared.c b/modules/msg/fsw/src/cfe_msg_msgid_shared.c index 8cb31a322..5f721d677 100644 --- a/modules/msg/fsw/src/cfe_msg_msgid_shared.c +++ b/modules/msg/fsw/src/cfe_msg_msgid_shared.c @@ -34,6 +34,9 @@ int32 CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type) CFE_MSG_Message_t msg; + /* Memset to initialize avoids possible GCC bug 53119 */ + memset(&msg, 0, sizeof(msg)); + if (Type == NULL) { return CFE_MSG_BAD_ARGUMENT; diff --git a/modules/sb/fsw/src/cfe_sb_task.c b/modules/sb/fsw/src/cfe_sb_task.c index 28dbcd3fe..cccd017eb 100644 --- a/modules/sb/fsw/src/cfe_sb_task.c +++ b/modules/sb/fsw/src/cfe_sb_task.c @@ -1060,7 +1060,7 @@ bool CFE_SB_WritePipeInfoDataGetter(void *Meta, uint32 RecordNum, void **Buffer, CFE_SB_BackgroundFileStateInfo_t *BgFilePtr; CFE_SB_PipeInfoEntry_t * PipeBufferPtr; CFE_SB_PipeD_t * PipeDscPtr; - osal_id_t SysQueueId; + osal_id_t SysQueueId = OS_OBJECT_ID_UNDEFINED; bool PipeIsValid; BgFilePtr = (CFE_SB_BackgroundFileStateInfo_t *)Meta; @@ -1099,10 +1099,6 @@ bool CFE_SB_WritePipeInfoDataGetter(void *Meta, uint32 RecordNum, void **Buffer, SysQueueId = PipeDscPtr->SysQueueId; } - else - { - SysQueueId = OS_OBJECT_ID_UNDEFINED; - } CFE_SB_UnlockSharedData(__FILE__, __LINE__); } From 89f5a089f33f959565be8dde0218e6b379a8da7e Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 24 Mar 2021 14:06:17 -0400 Subject: [PATCH 16/27] Fix #1259, Add branch coverage option to genhtml --- cmake/Makefile.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Makefile.sample b/cmake/Makefile.sample index c1466e7d3..db232e35c 100644 --- a/cmake/Makefile.sample +++ b/cmake/Makefile.sample @@ -141,7 +141,7 @@ test: lcov: lcov --capture --rc lcov_branch_coverage=1 --directory $(O)/$(ARCH) --output-file $(O)/$(ARCH)/coverage_test.info lcov --rc lcov_branch_coverage=1 --add-tracefile $(O)/$(ARCH)/coverage_base.info --add-tracefile $(O)/$(ARCH)/coverage_test.info --output-file $(O)/$(ARCH)/coverage_total.info - genhtml $(O)/$(ARCH)/coverage_total.info --output-directory $(O)/$(ARCH)/lcov + genhtml $(O)/$(ARCH)/coverage_total.info --branch-coverage --output-directory $(O)/$(ARCH)/lcov @/bin/echo -e "\n\nCoverage Report Link: file:$(CURDIR)/$(O)/$(ARCH)/lcov/index.html\n" doc: From f034054fa4a832427aee1ee35b06d31d686768a7 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:27:25 -0400 Subject: [PATCH 17/27] IC:2021-03-30, Remove deprecated API doxygen references Fixes users guide error caused by Deprecated MSG API removal in nasa/cfe#1240 --- docs/src/cfe_api.dox | 5 ----- modules/core_api/fsw/inc/cfe_es.h | 1 - 2 files changed, 6 deletions(-) diff --git a/docs/src/cfe_api.dox b/docs/src/cfe_api.dox index cfeafb50b..6d0cd4bdc 100644 --- a/docs/src/cfe_api.dox +++ b/docs/src/cfe_api.dox @@ -165,11 +165,6 @@
    • #CFE_MSG_GetTypeFromMsgId - \copybrief CFE_MSG_GetTypeFromMsgId
    • #CFE_SB_MessageStringGet - \copybrief CFE_SB_MessageStringGet
    -
  • \ref CFEAPISBChecksum -
      -
    • #CFE_MSG_GenerateChecksum - \copybrief CFE_MSG_GenerateChecksum -
    • #CFE_MSG_ValidateChecksum - \copybrief CFE_MSG_ValidateChecksum -
  • \ref CFEAPISBMessageID
    • #CFE_SB_MsgId_Equal - \copybrief CFE_SB_MsgId_Equal diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 0a9ed536e..1387c1b28 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -1087,7 +1087,6 @@ void CFE_ES_ProcessAsyncEvent(void); ** \retval #CFE_ES_CDS_ALREADY_EXISTS \copybrief CFE_ES_CDS_ALREADY_EXISTS ** \retval #CFE_ES_CDS_INVALID_SIZE \copybrief CFE_ES_CDS_INVALID_SIZE ** \retval #CFE_ES_CDS_INVALID_NAME \copybrief CFE_ES_CDS_INVALID_NAME -** \retval #CFE_ES_CDS_REGISTRY_FULL \copybrief CFE_ES_CDS_REGISTRY_FULL ** ** \sa #CFE_ES_CopyToCDS, #CFE_ES_RestoreFromCDS ** From 3ab6a53ba4e65b5bce265915215962d14cd6270d Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 24 Mar 2021 15:59:33 -0400 Subject: [PATCH 18/27] Fix #1239, scrub include header guards All C header files should have a header guard matching the file name of the header, in ALL_CAPS, with no extra leading/trailing underscores. This also takes a first pass at converting the file-scope block comments to a doxygen format to include a summary of the file. --- cmake/sample_defs/cpu1_msgids.h | 36 ++++++----- cmake/sample_defs/cpu1_platform_cfg.h | 37 +++++------ cmake/sample_defs/sample_mission_cfg.h | 39 ++++++------ cmake/sample_defs/sample_perfids.h | 39 ++++++------ cmake/target/inc/target_config.h | 11 ++-- modules/cfe_assert/inc/cfe_assert.h | 17 ++--- modules/cfe_testcase/src/cfe_test.h | 7 ++- modules/cfe_testrunner/inc/cfe_testrunner.h | 17 ++--- modules/core_api/fsw/inc/cfe.h | 30 ++++----- modules/core_api/fsw/inc/cfe_endian.h | 15 ++--- modules/core_api/fsw/inc/cfe_error.h | 39 ++++++------ modules/core_api/fsw/inc/cfe_es.h | 33 +++++----- .../core_api/fsw/inc/cfe_es_api_typedefs.h | 33 +++++----- .../core_api/fsw/inc/cfe_es_core_internal.h | 27 ++++---- .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 12 +++- modules/core_api/fsw/inc/cfe_evs.h | 33 +++++----- .../core_api/fsw/inc/cfe_evs_api_typedefs.h | 33 +++++----- .../core_api/fsw/inc/cfe_evs_core_internal.h | 27 ++++---- .../fsw/inc/cfe_evs_extern_typedefs.h | 12 +++- modules/core_api/fsw/inc/cfe_fs.h | 30 ++++----- .../core_api/fsw/inc/cfe_fs_api_typedefs.h | 30 ++++----- .../core_api/fsw/inc/cfe_fs_core_internal.h | 24 +++---- .../core_api/fsw/inc/cfe_fs_extern_typedefs.h | 12 +++- modules/core_api/fsw/inc/cfe_msg.h | 10 +-- .../core_api/fsw/inc/cfe_msg_api_typedefs.h | 12 ++-- modules/core_api/fsw/inc/cfe_resourceid.h | 7 ++- .../fsw/inc/cfe_resourceid_api_typedefs.h | 2 +- modules/core_api/fsw/inc/cfe_sb.h | 28 ++++----- .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 22 +++---- .../core_api/fsw/inc/cfe_sb_core_internal.h | 22 +++---- .../core_api/fsw/inc/cfe_sb_extern_typedefs.h | 12 +++- modules/core_api/fsw/inc/cfe_tbl.h | 39 ++++++------ .../core_api/fsw/inc/cfe_tbl_api_typedefs.h | 39 ++++++------ .../core_api/fsw/inc/cfe_tbl_core_internal.h | 33 +++++----- .../fsw/inc/cfe_tbl_extern_typedefs.h | 12 +++- modules/core_api/fsw/inc/cfe_tbl_filedef.h | 62 +++++++++---------- modules/core_api/fsw/inc/cfe_time.h | 34 +++++----- .../core_api/fsw/inc/cfe_time_api_typedefs.h | 34 +++++----- .../core_api/fsw/inc/cfe_time_core_internal.h | 28 ++++----- .../fsw/inc/cfe_time_extern_typedefs.h | 12 +++- modules/core_api/fsw/inc/cfe_version.h | 18 +++--- .../fsw/inc/cfe_core_resourceid_basevalues.h | 2 +- .../fsw/inc/cfe_es_erlog_typedef.h | 11 ++-- .../fsw/inc/cfe_es_perfdata_typedef.h | 13 ++-- .../fsw/inc/cfe_es_resetdata_typedef.h | 11 ++-- .../fsw/inc/cfe_evs_log_typedef.h | 11 ++-- .../fsw/inc/cfe_sb_destination_typedef.h | 10 +-- modules/core_private/fsw/inc/cfe_sbr.h | 6 +- .../fsw/inc/cfe_sbr_api_typedefs.h | 6 +- .../fsw/inc/cfe_time_resetvars_typedef.h | 22 ++----- .../ut-stubs/inc/ut_osprintf_stubs.h | 39 ++++++------ .../core_private/ut-stubs/inc/ut_support.h | 30 ++++----- modules/es/fsw/inc/cfe_es_events.h | 39 ++++++------ modules/es/fsw/inc/cfe_es_msg.h | 39 ++++++------ modules/es/fsw/src/cfe_es_apps.h | 31 +++++----- modules/es/fsw/src/cfe_es_cds.h | 36 +++++------ modules/es/fsw/src/cfe_es_cds_mempool.h | 36 +++++------ modules/es/fsw/src/cfe_es_generic_pool.h | 36 +++++------ modules/es/fsw/src/cfe_es_global.h | 30 ++++----- modules/es/fsw/src/cfe_es_log.h | 38 ++++++------ modules/es/fsw/src/cfe_es_mempool.h | 9 +-- modules/es/fsw/src/cfe_es_module_all.h | 5 +- modules/es/fsw/src/cfe_es_perf.h | 27 ++++---- modules/es/fsw/src/cfe_es_resource.h | 3 +- modules/es/fsw/src/cfe_es_start.h | 35 +++++------ modules/es/fsw/src/cfe_es_task.h | 39 ++++++------ modules/es/fsw/src/cfe_es_verify.h | 42 ++++++------- modules/es/ut-coverage/es_UT.h | 38 ++++++------ modules/evs/fsw/inc/cfe_evs_events.h | 33 +++++----- modules/evs/fsw/inc/cfe_evs_msg.h | 36 ++++++----- modules/evs/fsw/src/cfe_evs_log.h | 49 +++++++-------- modules/evs/fsw/src/cfe_evs_module_all.h | 2 +- modules/evs/fsw/src/cfe_evs_task.h | 45 +++++++------- modules/evs/fsw/src/cfe_evs_utils.h | 45 +++++++------- modules/evs/fsw/src/cfe_evs_verify.h | 34 +++++----- modules/evs/ut-coverage/evs_UT.h | 39 ++++++------ modules/fs/fsw/src/cfe_fs_module_all.h | 3 +- modules/fs/fsw/src/cfe_fs_priv.h | 30 ++++----- modules/fs/ut-coverage/fs_UT.h | 39 ++++++------ modules/msg/fsw/inc/ccsds_hdr.h | 10 +-- modules/msg/fsw/src/cfe_msg_defaults.h | 10 +-- modules/msg/fsw/src/cfe_msg_priv.h | 10 +-- .../msg/option_inc/default_cfe_msg_hdr_pri.h | 10 +-- .../option_inc/default_cfe_msg_hdr_priext.h | 10 +-- .../msg/option_inc/default_cfe_msg_sechdr.h | 10 +-- .../msg/ut-coverage/test_cfe_msg_ccsdsext.h | 10 +-- .../msg/ut-coverage/test_cfe_msg_ccsdspri.h | 11 ++-- .../msg/ut-coverage/test_cfe_msg_checksum.h | 10 +-- modules/msg/ut-coverage/test_cfe_msg_fc.h | 10 +-- modules/msg/ut-coverage/test_cfe_msg_init.h | 10 +-- modules/msg/ut-coverage/test_cfe_msg_msgid.h | 10 +-- .../ut-coverage/test_cfe_msg_msgid_shared.h | 10 +-- modules/msg/ut-coverage/test_cfe_msg_time.h | 10 +-- modules/msg/ut-coverage/test_msg_not.h | 11 ++-- modules/msg/ut-coverage/test_msg_utils.h | 11 ++-- .../cfe_resourceid_osal_compatible.h | 2 +- .../option_inc/cfe_resourceid_simple.h | 6 ++ .../option_inc/cfe_resourceid_strict.h | 6 ++ modules/sb/fsw/inc/cfe_sb_events.h | 34 +++++----- modules/sb/fsw/inc/cfe_sb_msg.h | 28 ++++----- modules/sb/fsw/src/cfe_sb_module_all.h | 2 +- modules/sb/fsw/src/cfe_sb_priv.h | 28 ++++----- modules/sb/fsw/src/cfe_sb_verify.h | 28 ++++----- modules/sb/ut-coverage/sb_UT.h | 39 ++++++------ modules/sbr/fsw/src/cfe_sbr_priv.h | 12 ++-- modules/tbl/fsw/inc/cfe_tbl_events.h | 45 +++++++------- modules/tbl/fsw/inc/cfe_tbl_msg.h | 34 +++++----- modules/tbl/fsw/src/cfe_tbl_internal.h | 21 ++++--- modules/tbl/fsw/src/cfe_tbl_module_all.h | 2 +- modules/tbl/fsw/src/cfe_tbl_task.h | 34 +++++----- modules/tbl/fsw/src/cfe_tbl_task_cmds.h | 27 ++++---- modules/tbl/fsw/src/cfe_tbl_verify.h | 28 ++++----- modules/tbl/ut-coverage/tbl_UT.h | 39 ++++++------ modules/time/fsw/inc/cfe_time_events.h | 33 +++++----- modules/time/fsw/inc/cfe_time_msg.h | 34 +++++----- modules/time/fsw/src/cfe_time_module_all.h | 2 +- modules/time/fsw/src/cfe_time_utils.h | 34 +++++----- modules/time/fsw/src/cfe_time_verify.h | 38 +++++------- modules/time/ut-coverage/time_UT.h | 39 ++++++------ 119 files changed, 1392 insertions(+), 1384 deletions(-) diff --git a/cmake/sample_defs/cpu1_msgids.h b/cmake/sample_defs/cpu1_msgids.h index aa9a52098..8cb4c8748 100644 --- a/cmake/sample_defs/cpu1_msgids.h +++ b/cmake/sample_defs/cpu1_msgids.h @@ -18,22 +18,24 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_msgids.h -** -** Purpose: -** This header file contains the Message Id's for messages used by the -** cFE core. -** -** Author: R.McGraw/SSI -** -** Notes: -** This file should not contain messages defined by cFE external -** applications. -** -******************************************************************************/ -#ifndef _cfe_msgids_ -#define _cfe_msgids_ +/** + * @file + * + * + * Purpose: + * This header file contains the Message Id's for messages used by the + * cFE core. + * + * Author: R.McGraw/SSI + * + * Notes: + * This file should not contain messages defined by cFE external + * applications. + * + */ + +#ifndef CPU1_MSGIDS_H +#define CPU1_MSGIDS_H /* ** Includes @@ -129,4 +131,4 @@ #define CFE_SB_ONESUB_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_SB_ONESUB_TLM_MSG /* 0x080E */ #define CFE_ES_MEMSTATS_TLM_MID CFE_PLATFORM_TLM_MID_BASE + CFE_MISSION_ES_MEMSTATS_TLM_MSG /* 0x0810 */ -#endif +#endif /* CPU1_MSGIDS_H */ diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h index 49bf9ed4c..9493558bf 100644 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ b/cmake/sample_defs/cpu1_platform_cfg.h @@ -18,23 +18,24 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_platform_cfg.h -** -** Purpose: -** This header file contains the platform configuration parameters. -** -** Notes: -** The impact of changing these configurations from their default value is -** not yet documented. Changing these values may impact the performance -** and functionality of the system. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ - -#ifndef _cfe_platform_cfg_ -#define _cfe_platform_cfg_ +/** + * @file + * + * + * Purpose: + * This header file contains the platform configuration parameters. + * + * Notes: + * The impact of changing these configurations from their default value is + * not yet documented. Changing these values may impact the performance + * and functionality of the system. + * + * Author: R.McGraw/SSI + * + */ + +#ifndef CPU1_PLATFORM_CFG_H +#define CPU1_PLATFORM_CFG_H /** ** \cfeescfg Default virtual path for persistent storage @@ -1708,4 +1709,4 @@ */ #define CFE_PLATFORM_ES_STARTUP_SCRIPT_TIMEOUT_MSEC 1000 -#endif /* _cfe_platform_cfg_ */ +#endif /* CPU1_PLATFORM_CFG_H */ diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index e0ecdca87..a79b8cc75 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_mission_cfg.h -** -** Purpose: -** This header file contains the mission configuration parameters and -** typedefs with mission scope. -** -** Notes: -** The impact of changing these configurations from their default value is -** not yet documented. Changing these values may impact the performance -** and functionality of the system. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ - -#ifndef _cfe_mission_cfg_ -#define _cfe_mission_cfg_ +/** + * @file + * + * + * Purpose: + * This header file contains the mission configuration parameters and + * typedefs with mission scope. + * + * Notes: + * The impact of changing these configurations from their default value is + * not yet documented. Changing these values may impact the performance + * and functionality of the system. + * + * Author: R.McGraw/SSI + * + */ + +#ifndef SAMPLE_MISSION_CFG_H +#define SAMPLE_MISSION_CFG_H /** ** \cfesbcfg Maximum SB Message Size @@ -562,4 +563,4 @@ */ #define CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN (CFE_MISSION_ES_CDS_MAX_NAME_LENGTH + CFE_MISSION_MAX_API_LEN + 4) -#endif /* _cfe_mission_cfg_ */ +#endif /* SAMPLE_MISSION_CFG_H */ diff --git a/cmake/sample_defs/sample_perfids.h b/cmake/sample_defs/sample_perfids.h index 3a99b612c..75c2e4011 100644 --- a/cmake/sample_defs/sample_perfids.h +++ b/cmake/sample_defs/sample_perfids.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: cfe_perfids.h -** -** Purpose: This file contains the cFE performance IDs -** -** Design Notes: -** Each performance id is used to identify something that needs to be -** measured. Performance ids are limited to the range of 0 to -** CFE_MISSION_ES_PERF_MAX_IDS - 1. Any performance ids outside of this range -** will be ignored and will be flagged as an error. Note that -** performance ids 0-31 are reserved for the cFE Core. -** -** References: -** -*/ - -#ifndef _cfe_perfids_ -#define _cfe_perfids_ +/** + * @file + * + * + * Purpose: This file contains the cFE performance IDs + * + * Design Notes: + * Each performance id is used to identify something that needs to be + * measured. Performance ids are limited to the range of 0 to + * CFE_MISSION_ES_PERF_MAX_IDS - 1. Any performance ids outside of this range + * will be ignored and will be flagged as an error. Note that + * performance ids 0-31 are reserved for the cFE Core. + * + * References: + * + */ + +#ifndef SAMPLE_PERFIDS_H +#define SAMPLE_PERFIDS_H #define CFE_MISSION_ES_PERF_EXIT_BIT 31 /**< \brief bit (31) is reserved by the perf utilities */ @@ -58,4 +59,4 @@ /** \} */ -#endif /* _cfe_perfids_ */ +#endif /* SAMPLE_PERFIDS_H */ diff --git a/cmake/target/inc/target_config.h b/cmake/target/inc/target_config.h index 495036318..554b2a2c1 100644 --- a/cmake/target/inc/target_config.h +++ b/cmake/target/inc/target_config.h @@ -19,10 +19,7 @@ */ /** - * \file target_config.h - * - * Created on: Dec 12, 2014 - * Created by: joseph.p.hickey@nasa.gov + * @file * * Defines structures for the global system-wide configuration data. * These structures can be accessed at runtime and are an alternative to @@ -31,8 +28,8 @@ * code becomes more portable. */ -#ifndef TARGET_CONFIG_H_ -#define TARGET_CONFIG_H_ +#ifndef TARGET_CONFIG_H +#define TARGET_CONFIG_H #include "common_types.h" #include "cfe_psp_configdata.h" @@ -213,4 +210,4 @@ typedef const struct */ extern Target_ConfigData GLOBAL_CONFIGDATA; -#endif /* TARGET_CONFIG_H_ */ +#endif /* TARGET_CONFIG_H */ diff --git a/modules/cfe_assert/inc/cfe_assert.h b/modules/cfe_assert/inc/cfe_assert.h index 89f0d3d6c..ce01e0480 100644 --- a/modules/cfe_assert/inc/cfe_assert.h +++ b/modules/cfe_assert/inc/cfe_assert.h @@ -24,8 +24,15 @@ ** Specification for the CFE assert (UT assert wrapper) functions. ** *************************************************************************/ -#ifndef cfe_assert_h_ -#define cfe_assert_h_ + +/** + * @file + * + * Declarations and prototypes for cfe_assert module + */ + +#ifndef CFE_ASSERT_H +#define CFE_ASSERT_H /************************************************************************ ** Includes @@ -56,8 +63,4 @@ *************************************************************************/ void CFE_Assert_AppMain(void); -#endif /* cfe_assert_h_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_ASSERT_H */ diff --git a/modules/cfe_testcase/src/cfe_test.h b/modules/cfe_testcase/src/cfe_test.h index efa2b2c82..1a04607e0 100644 --- a/modules/cfe_testcase/src/cfe_test.h +++ b/modules/cfe_testcase/src/cfe_test.h @@ -26,13 +26,18 @@ ** *************************************************************************/ +/** + * @file + * + * Declarations and prototypes for cfe_test module + */ + #ifndef CFE_TEST_H #define CFE_TEST_H /* * Includes */ - #include "cfe.h" #include "uttest.h" diff --git a/modules/cfe_testrunner/inc/cfe_testrunner.h b/modules/cfe_testrunner/inc/cfe_testrunner.h index cfcaa6b64..c766db082 100644 --- a/modules/cfe_testrunner/inc/cfe_testrunner.h +++ b/modules/cfe_testrunner/inc/cfe_testrunner.h @@ -24,8 +24,15 @@ ** Specification for the CFE testrunner (UT testrunner wrapper) functions. ** *************************************************************************/ -#ifndef cfe_testrunner_h_ -#define cfe_testrunner_h_ + +/** + * @file + * + * Declarations and prototypes for cfe_testrunner module + */ + +#ifndef CFE_TESTRUNNER_H +#define CFE_TESTRUNNER_H /************************************************************************ ** Includes @@ -56,8 +63,4 @@ *************************************************************************/ void CFE_TestRunner_AppMain(void); -#endif /* cfe_testrunner_h_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TESTRUNNER_H */ diff --git a/modules/core_api/fsw/inc/cfe.h b/modules/core_api/fsw/inc/cfe.h index 41a6700ea..2e04037f0 100644 --- a/modules/core_api/fsw/inc/cfe.h +++ b/modules/core_api/fsw/inc/cfe.h @@ -18,24 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe.h -** -** Purpose: cFE header file -** -** Author: David Kobe, the Hammers Company, Inc. -** -** Notes: This header file centralizes the includes for all cFE -** Applications. It includes all header files necessary -** to completely define the cFE interface. -** -*/ - -/*************************************************************************/ +/** + * @file + * + * + * Purpose: cFE header file + * + * Author: David Kobe, the Hammers Company, Inc. + * + * Notes: This header file centralizes the includes for all cFE + * Applications. It includes all header files necessary + * to completely define the cFE interface. + * + */ -/* -** Ensure that header is included only once... -*/ #ifndef CFE_H #define CFE_H diff --git a/modules/core_api/fsw/inc/cfe_endian.h b/modules/core_api/fsw/inc/cfe_endian.h index 6b120dab7..25d013ca3 100644 --- a/modules/core_api/fsw/inc/cfe_endian.h +++ b/modules/core_api/fsw/inc/cfe_endian.h @@ -18,13 +18,14 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_endian.h -** -** Purpose: -** Define macros to enforce big-endian/network byte order for 16 and 32 bit integers -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * Define macros to enforce big-endian/network byte order for 16 and 32 bit integers + * + */ #ifndef CFE_ENDIAN_H #define CFE_ENDIAN_H diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 2e9331e0a..9a6137761 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -18,26 +18,24 @@ ** limitations under the License. */ -/* -** Filename: cfe_error.h -** -** Title: cFE Status Code Definition Header File -** -** Purpose: -** Common source of cFE API return status codes. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -**/ +/** + * @file + * + * + * Title: cFE Status Code Definition Header File + * + * Purpose: + * Common source of cFE API return status codes. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_error_ -#define _cfe_error_ +#ifndef CFE_ERROR_H +#define CFE_ERROR_H /* Include Files */ #include "osapi.h" @@ -45,7 +43,6 @@ /* * Define a type for readability. */ - typedef int32 CFE_Status_t; /* @@ -1381,4 +1378,4 @@ typedef int32 CFE_Status_t; #define CFE_ES_CDS_REGISTRY_FULL CFE_ES_NO_RESOURCE_IDS_AVAILABLE #endif -#endif /* _cfe_error_ */ +#endif /* CFE_ERROR_H */ diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 0a9ed536e..5555f279e 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** File: cfe_es.h -** -** Purpose: -** Unit specification for Executive Services library functions and macros. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * Unit specification for Executive Services library functions and macros. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef CFE_ES_API_H -#define CFE_ES_API_H +#ifndef CFE_ES_H +#define CFE_ES_H /* ** Includes @@ -1676,4 +1677,4 @@ CFE_Status_t CFE_ES_GetGenCounterName(char *CounterName, CFE_ES_CounterId_t Coun /**@}*/ -#endif /* CFE_ES_API_H */ +#endif /* CFE_ES_H */ diff --git a/modules/core_api/fsw/inc/cfe_es_api_typedefs.h b/modules/core_api/fsw/inc/cfe_es_api_typedefs.h index 6c01ddd96..de8b80723 100644 --- a/modules/core_api/fsw/inc/cfe_es_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_api_typedefs.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** File: cfe_es_api_typedefs.h -** -** Purpose: -** Unit specification for Executive Services library functions and macros. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * Unit specification for Executive Services library functions and macros. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef CFE_ES_ABSTRACT_TYPES_H -#define CFE_ES_ABSTRACT_TYPES_H +#ifndef CFE_ES_API_TYPEDEFS_H +#define CFE_ES_API_TYPEDEFS_H /* ** Includes @@ -190,4 +191,4 @@ typedef void *CFE_ES_MemPoolBuf_t; #define CFE_ES_NO_MUTEX false /**< \brief Indicates that the memory pool selection will not use a semaphore */ #define CFE_ES_USE_MUTEX true /**< \brief Indicates that the memory pool selection will use a semaphore */ -#endif /* CFE_ES_ABSTRACT_TYPES_H */ +#endif /* CFE_ES_API_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_es_core_internal.h b/modules/core_api/fsw/inc/cfe_es_core_internal.h index 8c9e5dec0..22bdf1a01 100644 --- a/modules/core_api/fsw/inc/cfe_es_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_es_core_internal.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_es.h -** -** Purpose: -** Unit specification for Executive Services library functions and macros. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * Unit specification for Executive Services library functions and macros. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ #ifndef CFE_ES_CORE_INTERNAL_H #define CFE_ES_CORE_INTERNAL_H diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index a4e2af204..348900fc5 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -18,8 +18,14 @@ ** limitations under the License. */ -#ifndef _CFE_ES_EXTERN_TYPEDEFS_H_ -#define _CFE_ES_EXTERN_TYPEDEFS_H_ +/** + * @file + * + * Declarations and prototypes for cfe_es_extern_typedefs module + */ + +#ifndef CFE_ES_EXTERN_TYPEDEFS_H +#define CFE_ES_EXTERN_TYPEDEFS_H /* This header may be generated from an EDS file, * tools are available and the feature is enabled */ @@ -571,4 +577,4 @@ typedef struct CFE_ES_MemPoolStats #endif /* CFE_EDS_ENABLED_BUILD */ -#endif /* _CFE_ES_EXTERN_TYPEDEFS_H_ */ +#endif /* CFE_ES_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_evs.h b/modules/core_api/fsw/inc/cfe_evs.h index 4c71ad27b..68b7412fd 100644 --- a/modules/core_api/fsw/inc/cfe_evs.h +++ b/modules/core_api/fsw/inc/cfe_evs.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs.h -** -** Title: Event Services API Application Library Header File -** -** Purpose: -** Unit specification for Event services library functions and macros. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -**/ +/** + * @file + * + * + * Title: Event Services API Application Library Header File + * + * Purpose: + * Unit specification for Event services library functions and macros. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + */ -#ifndef CFE_EVS_API_H -#define CFE_EVS_API_H +#ifndef CFE_EVS_H +#define CFE_EVS_H /********************************** Include Files ************************************/ #include "common_types.h" /* Basic data types */ @@ -328,4 +329,4 @@ CFE_Status_t CFE_EVS_ResetFilter(int16 EventID); CFE_Status_t CFE_EVS_ResetAllFilters(void); /**@}*/ -#endif /* CFE_EVS_API_H */ +#endif /* CFE_EVS_H */ diff --git a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h index ef2564caa..d53aeffac 100644 --- a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs.h -** -** Title: Event Services API Application Library Header File -** -** Purpose: -** Unit specification for Event services library functions and macros. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -**/ +/** + * @file + * + * + * Title: Event Services API Application Library Header File + * + * Purpose: + * Unit specification for Event services library functions and macros. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + */ -#ifndef CFE_EVS_ABSTRACT_TYPES_H -#define CFE_EVS_ABSTRACT_TYPES_H +#ifndef CFE_EVS_API_TYPEDEFS_H +#define CFE_EVS_API_TYPEDEFS_H /********************************** Include Files ************************************/ #include "common_types.h" /* Basic data types */ @@ -64,4 +65,4 @@ typedef struct CFE_EVS_BinFilter } CFE_EVS_BinFilter_t; -#endif /* CFE_EVS_ABSTRACT_TYPES_H */ +#endif /* CFE_EVS_API_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_evs_core_internal.h b/modules/core_api/fsw/inc/cfe_evs_core_internal.h index 55cd8f96e..d28d0b07f 100644 --- a/modules/core_api/fsw/inc/cfe_evs_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_evs_core_internal.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs.h -** -** Title: Event Services API Application Library Header File -** -** Purpose: -** Unit specification for Event services library functions and macros. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -**/ +/** + * @file + * + * + * Title: Event Services API Application Library Header File + * + * Purpose: + * Unit specification for Event services library functions and macros. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + */ #ifndef CFE_EVS_CORE_INTERNAL_H #define CFE_EVS_CORE_INTERNAL_H diff --git a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h index 6c12e737d..326cbb0c3 100644 --- a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h @@ -18,8 +18,14 @@ ** limitations under the License. */ -#ifndef _CFE_EVS_EXTERN_TYPEDEFS_H_ -#define _CFE_EVS_EXTERN_TYPEDEFS_H_ +/** + * @file + * + * Declarations and prototypes for cfe_evs_extern_typedefs module + */ + +#ifndef CFE_EVS_EXTERN_TYPEDEFS_H +#define CFE_EVS_EXTERN_TYPEDEFS_H /* This header may be generated from an EDS file, * tools are available and the feature is enabled */ @@ -175,4 +181,4 @@ typedef uint8 CFE_EVS_EventOutput_Enum_t; #endif /* CFE_EDS_ENABLED_BUILD */ -#endif /* _CFE_EVS_EXTERN_TYPEDEFS_H_ */ +#endif /* CFE_EVS_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_fs.h b/modules/core_api/fsw/inc/cfe_fs.h index e0cc06416..36acb9a19 100644 --- a/modules/core_api/fsw/inc/cfe_fs.h +++ b/modules/core_api/fsw/inc/cfe_fs.h @@ -18,20 +18,18 @@ ** limitations under the License. */ -/* -** File: cfe_fs.h -** -** Purpose: cFE File Services (FS) library API header file -** -** Author: S.Walling/Microtel -** -*/ +/** + * @file + * + * + * Purpose: cFE File Services (FS) library API header file + * + * Author: S.Walling/Microtel + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_fs_ -#define _cfe_fs_ +#ifndef CFE_FS_H +#define CFE_FS_H /* ** Required header files... @@ -345,8 +343,4 @@ bool CFE_FS_RunBackgroundFileDump(uint32 ElapsedTime, void *Arg); /**@}*/ -#endif /* _cfe_fs_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_FS_H */ diff --git a/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h index ae5450005..2726afd32 100644 --- a/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h @@ -18,20 +18,18 @@ ** limitations under the License. */ -/* -** File: cfe_fs_api_typedefs.h -** -** Purpose: cFE File Services (FS) library API header file -** -** Author: S.Walling/Microtel -** -*/ +/** + * @file + * + * + * Purpose: cFE File Services (FS) library API header file + * + * Author: S.Walling/Microtel + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef CFE_FS_ABSTRACT_TYPES_H -#define CFE_FS_ABSTRACT_TYPES_H +#ifndef CFE_FS_API_TYPEDEFS_H +#define CFE_FS_API_TYPEDEFS_H /* ** Required header files... @@ -121,8 +119,4 @@ typedef struct CFE_FS_FileWriteMetaData } CFE_FS_FileWriteMetaData_t; -#endif /* CFE_FS_ABSTRACT_TYPES_H */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_FS_API_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_fs_core_internal.h b/modules/core_api/fsw/inc/cfe_fs_core_internal.h index 1a6670e8d..3ca9e5afd 100644 --- a/modules/core_api/fsw/inc/cfe_fs_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_fs_core_internal.h @@ -18,18 +18,16 @@ ** limitations under the License. */ -/* -** File: cfe_fs.h -** -** Purpose: cFE File Services (FS) library API header file -** -** Author: S.Walling/Microtel -** -*/ +/** + * @file + * + * + * Purpose: cFE File Services (FS) library API header file + * + * Author: S.Walling/Microtel + * + */ -/* -** Ensure that header is included only once... -*/ #ifndef CFE_FS_CORE_INTERNAL_H #define CFE_FS_CORE_INTERNAL_H @@ -61,7 +59,3 @@ extern int32 CFE_FS_EarlyInit(void); /**@}*/ #endif /* CFE_FS_CORE_INTERNAL_H */ - -/************************/ -/* End of File Comment */ -/************************/ diff --git a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h index cce90fa7d..02ff09c63 100644 --- a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h @@ -18,8 +18,14 @@ ** limitations under the License. */ -#ifndef _CFE_FS_EXTERN_TYPEDEFS_H_ -#define _CFE_FS_EXTERN_TYPEDEFS_H_ +/** + * @file + * + * Declarations and prototypes for cfe_fs_extern_typedefs module + */ + +#ifndef CFE_FS_EXTERN_TYPEDEFS_H +#define CFE_FS_EXTERN_TYPEDEFS_H /* This header may be generated from an EDS file, * tools are available and the feature is enabled */ @@ -236,4 +242,4 @@ typedef struct CFE_FS_Header #endif /* CFE_EDS_ENABLED_BUILD */ -#endif /* _CFE_FS_EXTERN_TYPEDEFS_H_ */ +#endif /* CFE_FS_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_msg.h b/modules/core_api/fsw/inc/cfe_msg.h index ba84ecaf9..22a40bddc 100644 --- a/modules/core_api/fsw/inc/cfe_msg.h +++ b/modules/core_api/fsw/inc/cfe_msg.h @@ -18,12 +18,14 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Message access APIs */ -#ifndef _cfe_msg_api_ -#define _cfe_msg_api_ +#ifndef CFE_MSG_H +#define CFE_MSG_H /* * Includes @@ -664,4 +666,4 @@ CFE_Status_t CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type /**\}*/ -#endif /* _cfe_msg_api_ */ +#endif /* CFE_MSG_H */ diff --git a/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h b/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h index d444684e6..b91001bd6 100644 --- a/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_msg_api_typedefs.h @@ -18,13 +18,15 @@ ** limitations under the License. */ -/****************************************************************************** - * Message type defines +/** + * @file + * + * Typedefs for Message API * - Separate from API so these can be adjusted for custom implementations */ -#ifndef _cfe_msg_typedefs_ -#define _cfe_msg_typedefs_ +#ifndef CFE_MSG_API_TYPEDEFS_H +#define CFE_MSG_API_TYPEDEFS_H /* * Includes @@ -111,4 +113,4 @@ typedef struct CFE_MSG_CommandHeader CFE_MSG_CommandHeader_t; */ typedef struct CFE_MSG_TelemetryHeader CFE_MSG_TelemetryHeader_t; -#endif /* _cfe_msg_typedefs_ */ +#endif /* CFE_MSG_API_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_resourceid.h b/modules/core_api/fsw/inc/cfe_resourceid.h index b94d27d1d..2b3e48e01 100644 --- a/modules/core_api/fsw/inc/cfe_resourceid.h +++ b/modules/core_api/fsw/inc/cfe_resourceid.h @@ -19,7 +19,8 @@ */ /** - * \file cfe_resourceid.h + * @file + * * * Contains global prototypes and definitions related to resource * management and related CFE resource IDs. @@ -36,8 +37,8 @@ * - Convert simple integer to ID (inverse of above) */ -#ifndef CFE_RESOURCEID_API_H -#define CFE_RESOURCEID_API_H +#ifndef CFE_RESOURCEID_H +#define CFE_RESOURCEID_H /* * The basic resource ID API definitions diff --git a/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h b/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h index 77520b35e..2afdf8dd2 100644 --- a/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_resourceid_api_typedefs.h @@ -19,7 +19,7 @@ */ /** - * \file cfe_resourceid_api_typedefs.h + * @file * * Contains global prototypes and definitions related to resource * management and related CFE resource IDs. diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index c673e5329..2eab32615 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_sb.h -** -** Purpose: -** This header file contains all definitions for the cFE Software Bus -** Application Programmer's Interface. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file contains all definitions for the cFE Software Bus + * Application Programmer's Interface. + * + * Author: R.McGraw/SSI + * + */ -#ifndef CFE_SB_API_H -#define CFE_SB_API_H +#ifndef CFE_SB_H +#define CFE_SB_H /* ** Includes @@ -1309,5 +1310,4 @@ uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId); /**@}*/ -#endif /* CFE_SB_API_H */ -/*****************************************************************************/ +#endif /* CFE_SB_H */ diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h index 3aca7caaf..b21ed499f 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -18,16 +18,17 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_sb.h -** -** Purpose: -** This header file contains all definitions for the cFE Software Bus -** Application Programmer's Interface. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file contains all definitions for the cFE Software Bus + * Application Programmer's Interface. + * + * Author: R.McGraw/SSI + * + */ #ifndef CFE_SB_API_TYPEDEFS_H #define CFE_SB_API_TYPEDEFS_H @@ -183,4 +184,3 @@ typedef struct #endif /* CFE_OMIT_DEPRECATED_6_8 */ #endif /* CFE_SB_API_TYPEDEFS_H */ -/*****************************************************************************/ diff --git a/modules/core_api/fsw/inc/cfe_sb_core_internal.h b/modules/core_api/fsw/inc/cfe_sb_core_internal.h index d1e90d10e..701baaa20 100644 --- a/modules/core_api/fsw/inc/cfe_sb_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_sb_core_internal.h @@ -18,16 +18,17 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_sb.h -** -** Purpose: -** This header file contains all definitions for the cFE Software Bus -** Application Programmer's Interface. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file contains all definitions for the cFE Software Bus + * Application Programmer's Interface. + * + * Author: R.McGraw/SSI + * + */ #ifndef CFE_SB_CORE_INTERNAL_H #define CFE_SB_CORE_INTERNAL_H @@ -87,4 +88,3 @@ extern int32 CFE_SB_CleanUpApp(CFE_ES_AppId_t AppId); /**@}*/ #endif /* CFE_SB_CORE_INTERNAL_H */ -/*****************************************************************************/ diff --git a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h index e1c0795a5..2413f6914 100644 --- a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h @@ -18,8 +18,14 @@ ** limitations under the License. */ -#ifndef _CFE_SB_EXTERN_TYPEDEFS_H_ -#define _CFE_SB_EXTERN_TYPEDEFS_H_ +/** + * @file + * + * Declarations and prototypes for cfe_sb_extern_typedefs module + */ + +#ifndef CFE_SB_EXTERN_TYPEDEFS_H +#define CFE_SB_EXTERN_TYPEDEFS_H /* This header may be generated from an EDS file, * tools are available and the feature is enabled */ @@ -134,4 +140,4 @@ typedef struct #endif /* CFE_EDS_ENABLED_BUILD */ -#endif /* _CFE_SB_EXTERN_TYPEDEFS_H_ */ +#endif /* CFE_SB_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_tbl.h b/modules/core_api/fsw/inc/cfe_tbl.h index 5ea67bae8..a0f945433 100644 --- a/modules/core_api/fsw/inc/cfe_tbl.h +++ b/modules/core_api/fsw/inc/cfe_tbl.h @@ -18,25 +18,26 @@ ** limitations under the License. */ -/* -** File: cfe_tbl.h -** -** Title: Table Services API Application Library Header File -** -** Purpose: -** Unit specification for Table services library functions and macros. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -** Notes: -** -**/ +/** + * @file + * + * + * Title: Table Services API Application Library Header File + * + * Purpose: + * Unit specification for Table services library functions and macros. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + * Notes: + * + */ -#ifndef CFE_TBL_API_H -#define CFE_TBL_API_H +#ifndef CFE_TBL_H +#define CFE_TBL_H /********************* Include Files ************************/ #include "common_types.h" /* Basic Data Types */ @@ -739,4 +740,4 @@ CFE_Status_t CFE_TBL_NotifyByMessage(CFE_TBL_Handle_t TblHandle, CFE_SB_MsgId_t uint32 Parameter); /**@}*/ -#endif /* CFE_TBL_API_H */ +#endif /* CFE_TBL_H */ diff --git a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h index c3c7d7bc6..39e44351b 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h @@ -18,25 +18,26 @@ ** limitations under the License. */ -/* -** File: cfe_tbl.h -** -** Title: Table Services API Application Library Header File -** -** Purpose: -** Unit specification for Table services library functions and macros. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -** Notes: -** -**/ +/** + * @file + * + * + * Title: Table Services API Application Library Header File + * + * Purpose: + * Unit specification for Table services library functions and macros. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + * Notes: + * + */ -#ifndef CFE_TBL_ABSTRACT_TYPES_H -#define CFE_TBL_ABSTRACT_TYPES_H +#ifndef CFE_TBL_API_TYPEDEFS_H +#define CFE_TBL_API_TYPEDEFS_H /********************* Include Files ************************/ #include "common_types.h" /* Basic Data Types */ @@ -123,4 +124,4 @@ typedef struct CFE_TBL_Info char LastFileLoaded[CFE_MISSION_MAX_PATH_LEN]; /**< \brief Filename of last file loaded into table */ } CFE_TBL_Info_t; -#endif /* CFE_TBL_ABSTRACT_TYPES_H */ +#endif /* CFE_TBL_API_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_tbl_core_internal.h b/modules/core_api/fsw/inc/cfe_tbl_core_internal.h index 2566c9376..4692abae9 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_tbl_core_internal.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** File: cfe_tbl.h -** -** Title: Table Services API Application Library Header File -** -** Purpose: -** Unit specification for Table services library functions and macros. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -** Notes: -** -**/ +/** + * @file + * + * + * Title: Table Services API Application Library Header File + * + * Purpose: + * Unit specification for Table services library functions and macros. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + * Notes: + * + */ #ifndef CFE_TBL_CORE_INTERNAL_H #define CFE_TBL_CORE_INTERNAL_H diff --git a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h index 93be4eeda..416c0cfe5 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h @@ -18,8 +18,14 @@ ** limitations under the License. */ -#ifndef _CFE_TBL_EXTERN_TYPEDEFS_H_ -#define _CFE_TBL_EXTERN_TYPEDEFS_H_ +/** + * @file + * + * Declarations and prototypes for cfe_tbl_extern_typedefs module + */ + +#ifndef CFE_TBL_EXTERN_TYPEDEFS_H +#define CFE_TBL_EXTERN_TYPEDEFS_H /* This header may be generated from an EDS file, * tools are available and the feature is enabled */ @@ -75,4 +81,4 @@ typedef struct CFE_TBL_File_Hdr #endif /* CFE_EDS_ENABLED_BUILD */ -#endif /* _CFE_TBL_EXTERN_TYPEDEFS_H_ */ +#endif /* CFE_TBL_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_tbl_filedef.h b/modules/core_api/fsw/inc/cfe_tbl_filedef.h index 1bd32212b..e0933246e 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_filedef.h +++ b/modules/core_api/fsw/inc/cfe_tbl_filedef.h @@ -18,36 +18,34 @@ ** limitations under the License. */ -/* -** File: cfe_tbl_filedef.h -** -** Title: ELF2CFETBL Utility Header File for Table Images -** -** Purpose: -** This header file provides a data structure definition and macro definition -** required in source code that is intended to be compiled into a cFE compatible -** Table Image file. -** -** Design Notes: -** -** Typically, a user would include this file in a ".c" file that contains nothing -** but a desired instantiation of values for a table image along with the macro -** defined below. After compilation, the resultant elf file can be processed using -** the 'elf2cfetbl' utility to generate a file that can be loaded onto a cFE flight -** system and successfully loaded into a table using the cFE Table Services. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -** Notes: -** -*/ +/** + * @file + * + * + * Title: ELF2CFETBL Utility Header File for Table Images + * + * Purpose: + * This header file provides a data structure definition and macro definition + * required in source code that is intended to be compiled into a cFE compatible + * Table Image file. + * + * Design Notes: + * + * Typically, a user would include this file in a ".c" file that contains nothing + * but a desired instantiation of values for a table image along with the macro + * defined below. After compilation, the resultant elf file can be processed using + * the 'elf2cfetbl' utility to generate a file that can be loaded onto a cFE flight + * system and successfully loaded into a table using the cFE Table Services. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_tbl_filedef_ -#define _cfe_tbl_filedef_ +#ifndef CFE_TBL_FILEDEF_H +#define CFE_TBL_FILEDEF_H #include "cfe_mission_cfg.h" #include "common_types.h" @@ -103,8 +101,4 @@ utility. /*************************************************************************/ -#endif /* _cfe_tbl_filedef_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TBL_FILEDEF_H */ diff --git a/modules/core_api/fsw/inc/cfe_time.h b/modules/core_api/fsw/inc/cfe_time.h index 1e885eca5..5d315ce50 100644 --- a/modules/core_api/fsw/inc/cfe_time.h +++ b/modules/core_api/fsw/inc/cfe_time.h @@ -18,22 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_time.h -** -** Purpose: cFE Time Services (TIME) library API header file -** -** Author: S.Walling/Microtel -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Time Services (TIME) library API header file + * + * Author: S.Walling/Microtel + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_time_ -#define _cfe_time_ +#ifndef CFE_TIME_H +#define CFE_TIME_H /* ** Includes @@ -723,8 +721,4 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); void CFE_TIME_Local1HzISR(void); /**@}*/ -#endif /* _cfe_time_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TIME_H */ diff --git a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h index b9cac22d5..8ee72396c 100644 --- a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h @@ -18,22 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_time.h -** -** Purpose: cFE Time Services (TIME) library API header file -** -** Author: S.Walling/Microtel -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Time Services (TIME) library API header file + * + * Author: S.Walling/Microtel + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef CFE_TIME_API_TYPES_H -#define CFE_TIME_API_TYPES_H +#ifndef CFE_TIME_API_TYPEDEFS_H +#define CFE_TIME_API_TYPEDEFS_H /* ** Includes @@ -79,8 +77,4 @@ typedef enum CFE_TIME_Compare */ typedef int32 (*CFE_TIME_SynchCallbackPtr_t)(void); -#endif /* CFE_TIME_API_TYPES_H */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TIME_API_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_time_core_internal.h b/modules/core_api/fsw/inc/cfe_time_core_internal.h index 73ede06e0..752d25cd1 100644 --- a/modules/core_api/fsw/inc/cfe_time_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_time_core_internal.h @@ -18,20 +18,18 @@ ** limitations under the License. */ -/* -** File: cfe_time_core_internal.h -** -** Purpose: cFE Time Services (TIME) library API header file -** -** Author: S.Walling/Microtel -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Time Services (TIME) library API header file + * + * Author: S.Walling/Microtel + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ #ifndef CFE_TIME_CORE_INTERNAL_H #define CFE_TIME_CORE_INTERNAL_H @@ -90,7 +88,3 @@ extern int32 CFE_TIME_CleanUpApp(CFE_ES_AppId_t AppId); /**@}*/ #endif /* CFE_TIME_CORE_INTERNAL_H */ - -/************************/ -/* End of File Comment */ -/************************/ diff --git a/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h index 53e0a1276..b04b6ebc1 100644 --- a/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h @@ -18,8 +18,14 @@ ** limitations under the License. */ -#ifndef _CFE_TIME_EXTERN_TYPEDEFS_H_ -#define _CFE_TIME_EXTERN_TYPEDEFS_H_ +/** + * @file + * + * Declarations and prototypes for cfe_time_extern_typedefs module + */ + +#ifndef CFE_TIME_EXTERN_TYPEDEFS_H +#define CFE_TIME_EXTERN_TYPEDEFS_H /* This header may be generated from an EDS file, * tools are available and the feature is enabled */ @@ -301,4 +307,4 @@ typedef uint8 CFE_TIME_SetState_Enum_t; #endif /* CFE_EDS_ENABLED_BUILD */ -#endif /* _CFE_TIME_EXTERN_TYPEDEFS_H_ */ +#endif /* CFE_TIME_EXTERN_TYPEDEFS_H */ diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index bd9d3fbd8..38e6db2b8 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -18,19 +18,15 @@ ** limitations under the License. */ -#ifndef _cfe_version_ -#define _cfe_version_ - -/*! @file cfe_version.h - * @brief Purpose: - * Provide version identifiers for the cFE core. - * - * target_config.h contains extended version information within it. - * This information is generated automatically by the build using - * git to determine the most recent tag and commit id. +/** + * @file * + * Provide version identifiers for the cFE core. */ +#ifndef CFE_VERSION_H +#define CFE_VERSION_H + /* Development Build Macro Definitions */ #define CFE_BUILD_NUMBER 436 /*!< Development Build: Number of commits since baseline */ #define CFE_BUILD_BASELINE \ @@ -62,4 +58,4 @@ " cFE DEVELOPMENT BUILD " CFE_SRC_VERSION " (Codename: Bootes)" /* Codename for current development */ \ ", Last Official Release: cfe v6.7.0" /* For full support please use this version */ -#endif /* _cfe_version_ */ +#endif /* CFE_VERSION_H */ diff --git a/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h b/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h index e159e958b..a1289b5e0 100644 --- a/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h +++ b/modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h @@ -19,7 +19,7 @@ */ /** - * \file cfe_core_resourceid_basevalues.h + * @file * * Contains CFE internal prototypes and definitions related to resource * management and related CFE resource IDs. diff --git a/modules/core_private/fsw/inc/cfe_es_erlog_typedef.h b/modules/core_private/fsw/inc/cfe_es_erlog_typedef.h index 7d5813812..ee1810e77 100644 --- a/modules/core_private/fsw/inc/cfe_es_erlog_typedef.h +++ b/modules/core_private/fsw/inc/cfe_es_erlog_typedef.h @@ -19,17 +19,14 @@ */ /** - * \file cfe_es_erlog_typedef.h - * - * Created on: Jan 22, 2015 - * Author: joseph.p.hickey@nasa.gov + * @file * * Definition of the CFE_ES_ERLog structure type. * This was moved into its own header file since it is referenced by multiple CFE core apps. */ -#ifndef CFE_ES_ERLOG_TYPEDEF_H_ -#define CFE_ES_ERLOG_TYPEDEF_H_ +#ifndef CFE_ES_ERLOG_TYPEDEF_H +#define CFE_ES_ERLOG_TYPEDEF_H #include "common_types.h" #include "cfe_platform_cfg.h" @@ -98,4 +95,4 @@ typedef struct uint32 PspContextId; /**< Reference to context information stored in PSP */ } CFE_ES_ERLog_MetaData_t; -#endif /* CFE_ES_ERLOG_TYPEDEF_H_ */ +#endif /* CFE_ES_ERLOG_TYPEDEF_H */ diff --git a/modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h b/modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h index 44bf2f5a6..35d635c8f 100644 --- a/modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h +++ b/modules/core_private/fsw/inc/cfe_es_perfdata_typedef.h @@ -19,16 +19,13 @@ */ /** - * \file cfe_es_perfdata_typedef.h + * @file * - * Created on: Jan 22, 2015 - * Author: joseph.p.hickey@nasa.gov - * - * Placeholder for file content description + * Definition of CFE_ES_PerfData_t structure type */ -#ifndef CFE_ES_PERFDATA_TYPEDEF_H_ -#define CFE_ES_PERFDATA_TYPEDEF_H_ +#ifndef CFE_ES_PERFDATA_TYPEDEF_H +#define CFE_ES_PERFDATA_TYPEDEF_H #include "common_types.h" #include "cfe_mission_cfg.h" /* Required for CFE_MISSION_ES_PERF_MAX_IDS */ @@ -75,4 +72,4 @@ typedef struct CFE_ES_PerfDataEntry_t DataBuffer[CFE_PLATFORM_ES_PERF_DATA_BUFFER_SIZE]; } CFE_ES_PerfData_t; -#endif /* CFE_ES_PERFDATA_TYPEDEF_H_ */ +#endif /* CFE_ES_PERFDATA_TYPEDEF_H */ diff --git a/modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h b/modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h index 9bd462adf..5549c2890 100644 --- a/modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h +++ b/modules/core_private/fsw/inc/cfe_es_resetdata_typedef.h @@ -19,17 +19,14 @@ */ /** - * \file cfe_es_resetdata_typedef.h - * - * Created on: Jan 22, 2015 - * Author: joseph.p.hickey@nasa.gov + * @file * * Definition of the CFE_ES_ResetData structure type. * This was moved into its own header file since it is referenced by multiple CFE core apps. */ -#ifndef CFE_ES_RESETDATA_TYPEDEF_H_ -#define CFE_ES_RESETDATA_TYPEDEF_H_ +#ifndef CFE_ES_RESETDATA_TYPEDEF_H +#define CFE_ES_RESETDATA_TYPEDEF_H #include "common_types.h" @@ -99,4 +96,4 @@ typedef struct } CFE_ES_ResetData_t; -#endif /* CFE_ES_RESETDATA_TYPEDEF_H_ */ +#endif /* CFE_ES_RESETDATA_TYPEDEF_H */ diff --git a/modules/core_private/fsw/inc/cfe_evs_log_typedef.h b/modules/core_private/fsw/inc/cfe_evs_log_typedef.h index 76cb28435..66da533b0 100644 --- a/modules/core_private/fsw/inc/cfe_evs_log_typedef.h +++ b/modules/core_private/fsw/inc/cfe_evs_log_typedef.h @@ -19,17 +19,14 @@ */ /** - * \file cfe_evs_log_typedef.h - * - * Created on: Jan 22, 2015 - * Author: joseph.p.hickey@nasa.gov + * @file * * Definition of the CFE_EVS_Log structure type. * This was moved into its own header file since it is referenced by multiple CFE core apps. */ -#ifndef CFE_EVS_LOG_TYPEDEF_H_ -#define CFE_EVS_LOG_TYPEDEF_H_ +#ifndef CFE_EVS_LOG_TYPEDEF_H +#define CFE_EVS_LOG_TYPEDEF_H #include "common_types.h" #include "cfe_platform_cfg.h" @@ -51,4 +48,4 @@ typedef struct } CFE_EVS_Log_t; -#endif /* CFE_EVS_LOG_TYPEDEF_H_ */ +#endif /* CFE_EVS_LOG_TYPEDEF_H */ diff --git a/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h b/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h index 2c5b0ab41..daaf9f95c 100644 --- a/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h +++ b/modules/core_private/fsw/inc/cfe_sb_destination_typedef.h @@ -19,12 +19,14 @@ */ /** - * Definition of the CFE_SB_DestinationD_t type. + * @file + * + * Definition of the CFE_SB_DestinationD_t structure type * This was moved into its own header file since it is referenced by multiple CFE modules. */ -#ifndef CFE_SB_DESTINATION_TYPEDEF_H_ -#define CFE_SB_DESTINATION_TYPEDEF_H_ +#ifndef CFE_SB_DESTINATION_TYPEDEF_H +#define CFE_SB_DESTINATION_TYPEDEF_H #include "common_types.h" #include "cfe_sb_extern_typedefs.h" /* Required for CFE_SB_PipeId_t definition */ @@ -49,4 +51,4 @@ typedef struct void * Next; } CFE_SB_DestinationD_t; -#endif /* CFE_SB_DESTINATION_TYPEDEF_H_ */ +#endif /* CFE_SB_DESTINATION_TYPEDEF_H */ diff --git a/modules/core_private/fsw/inc/cfe_sbr.h b/modules/core_private/fsw/inc/cfe_sbr.h index 0d22a106c..a35d5f4c2 100644 --- a/modules/core_private/fsw/inc/cfe_sbr.h +++ b/modules/core_private/fsw/inc/cfe_sbr.h @@ -18,13 +18,13 @@ ** limitations under the License. */ -/****************************************************************************** - * File: cfe_sbr.h +/** + * @file * * Purpose: * Prototypes for private functions and type definitions for SB * routing internal use. - *****************************************************************************/ + */ #ifndef CFE_SBR_H #define CFE_SBR_H diff --git a/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h b/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h index b326f79c5..8175e14b8 100644 --- a/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h +++ b/modules/core_private/fsw/inc/cfe_sbr_api_typedefs.h @@ -18,13 +18,13 @@ ** limitations under the License. */ -/****************************************************************************** - * File: cfe_sbr.h +/** + * @file * * Purpose: * Prototypes for private functions and type definitions for SB * routing internal use. - *****************************************************************************/ + */ #ifndef CFE_SBR_API_TYPEDEFS_H #define CFE_SBR_API_TYPEDEFS_H diff --git a/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h b/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h index e67509d95..6970b897b 100644 --- a/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h +++ b/modules/core_private/fsw/inc/cfe_time_resetvars_typedef.h @@ -18,20 +18,12 @@ ** limitations under the License. */ -/* -** File: cfe_time.h -** -** Purpose: cFE Time Services (TIME) library API header file -** -** Author: S.Walling/Microtel -** -** Notes: -** -*/ +/** + * @file + * + * Definition of the CFE_TIME_ResetVars_t structure type + */ -/* -** Ensure that header is included only once... -*/ #ifndef CFE_TIME_RESETVARS_TYPEDEF_H #define CFE_TIME_RESETVARS_TYPEDEF_H @@ -63,7 +55,3 @@ typedef struct CFE_TIME_ResetVars } CFE_TIME_ResetVars_t; #endif /* CFE_TIME_RESETVARS_TYPEDEF_H */ - -/************************/ -/* End of File Comment */ -/************************/ diff --git a/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h index a58c3c299..1db3e8cd0 100644 --- a/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h +++ b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: -** ut_osprintf_stubs.h -** -** Purpose: -** OS API unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _UT_OSPRINTF_STUBS_H_ -#define _UT_OSPRINTF_STUBS_H_ +/** + * @file + * + * + * Purpose: + * OS API unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef UT_OSPRINTF_STUBS_H +#define UT_OSPRINTF_STUBS_H #define UT_OSP_CORE_INIT 11 #define UT_OSP_POR_MAX_PROC_RESETS 12 @@ -99,4 +100,4 @@ #define UT_OSP_BACKGROUND_REGISTER 70 #define UT_OSP_BACKGROUND_TAKE 71 -#endif +#endif /* UT_OSPRINTF_STUBS_H */ diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index f0f728d5c..2fa61659e 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -18,19 +18,21 @@ ** limitations under the License. */ -/* -** File: ut_support.h -** -** Purpose: -** Unit specification for Unit Test Stubs -** -** Notes: -** These routines contain a minimum amount of functionality required for -** unit testing full path coverage -** -*/ -#ifndef _UT_CFE_SUPPORT_H_ -#define _UT_CFE_SUPPORT_H_ +/** + * @file + * + * + * Purpose: + * Unit specification for Unit Test Stubs + * + * Notes: + * These routines contain a minimum amount of functionality required for + * unit testing full path coverage + * + */ + +#ifndef UT_SUPPORT_H +#define UT_SUPPORT_H /* ** Includes @@ -736,4 +738,4 @@ void UT_TEARDOWN_impl(const char *FileName, int LineNum, const char *TestName, c ******************************************************************************/ #define TEARDOWN(FN) (UT_TEARDOWN_impl(__FILE__, __LINE__, __func__, (#FN), (FN))) -#endif /* __UT_STUBS_H_ */ +#endif /* UT_SUPPORT_H */ diff --git a/modules/es/fsw/inc/cfe_es_events.h b/modules/es/fsw/inc/cfe_es_events.h index 0266235a9..1b4fa8493 100644 --- a/modules/es/fsw/inc/cfe_es_events.h +++ b/modules/es/fsw/inc/cfe_es_events.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** File: cfe_es_events.h -** -** Purpose: -** cFE Executive Services (ES) Event IDs -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ -/*************************************************************************/ -#ifndef _cfe_es_events_ -#define _cfe_es_events_ +/** + * @file + * + * + * Purpose: + * cFE Executive Services (ES) Event IDs + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ + +#ifndef CFE_ES_EVENTS_H +#define CFE_ES_EVENTS_H /* ************************** ** ****** Maximum EID. ****** @@ -1449,8 +1450,4 @@ **/ #define CFE_ES_ERLOG_PENDING_ERR_EID 93 -#endif /* _cfe_es_events_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_ES_EVENTS_H */ diff --git a/modules/es/fsw/inc/cfe_es_msg.h b/modules/es/fsw/inc/cfe_es_msg.h index 623651255..e76a2df92 100644 --- a/modules/es/fsw/inc/cfe_es_msg.h +++ b/modules/es/fsw/inc/cfe_es_msg.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** File: cfe_es_msg.h -** -** Purpose: -** cFE Executive Services (ES) Command and Telemetry packet definition file. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ -/*************************************************************************/ -#ifndef _cfe_es_msg_ -#define _cfe_es_msg_ +/** + * @file + * + * + * Purpose: + * cFE Executive Services (ES) Command and Telemetry packet definition file. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ + +#ifndef CFE_ES_MSG_H +#define CFE_ES_MSG_H /* ** Includes @@ -1558,8 +1559,4 @@ typedef struct CFE_ES_HousekeepingTlm } CFE_ES_HousekeepingTlm_t; -#endif /* _cfe_es_msg_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_ES_MSG_H */ diff --git a/modules/es/fsw/src/cfe_es_apps.h b/modules/es/fsw/src/cfe_es_apps.h index b51288a39..3b8e3c56f 100644 --- a/modules/es/fsw/src/cfe_es_apps.h +++ b/modules/es/fsw/src/cfe_es_apps.h @@ -18,22 +18,21 @@ ** limitations under the License. */ -/* -** File: -** cfe_es_apps.h -** -** Purpose: -** This file contains the Internal interface for the cFE Application control functions of ES. -** These functions and data structures manage the Applications and Child tasks in the cFE. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -*/ +/** + * @file + * + * Purpose: + * This file contains the Internal interface for the cFE Application control functions of ES. + * These functions and data structures manage the Applications and Child tasks in the cFE. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + */ -#ifndef _cfe_es_apps_ -#define _cfe_es_apps_ +#ifndef CFE_ES_APPS_H +#define CFE_ES_APPS_H /* ** Include Files @@ -301,4 +300,4 @@ void CFE_ES_CopyModuleStatusInfo(const CFE_ES_ModuleLoadStatus_t *StatusPtr, CFE */ void CFE_ES_CopyModuleAddressInfo(osal_id_t ModuleId, CFE_ES_AppInfo_t *AppInfoPtr); -#endif /* _cfe_es_apps_ */ +#endif /* CFE_ES_APPS_H */ diff --git a/modules/es/fsw/src/cfe_es_cds.h b/modules/es/fsw/src/cfe_es_cds.h index c5a45ceb1..8e20a4d65 100644 --- a/modules/es/fsw/src/cfe_es_cds.h +++ b/modules/es/fsw/src/cfe_es_cds.h @@ -18,24 +18,24 @@ ** limitations under the License. */ -/* -** File: -** cfe_es_cds.h -** -** Purpose: -** This file contains the Internal interface for the cFE Critical Data Store functions. -** These functions and data structures manage the Critical Data Store in the cFE. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * This file contains the Internal interface for the cFE Critical Data Store functions. + * These functions and data structures manage the Critical Data Store in the cFE. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef _cfe_es_cds_ -#define _cfe_es_cds_ +#ifndef CFE_ES_CDS_H +#define CFE_ES_CDS_H /* ** Include Files @@ -642,4 +642,4 @@ int32 CFE_ES_ClearCDS(void); ******************************************************************************/ int32 CFE_ES_InitCDSSignatures(void); -#endif /* _cfe_es_cds_ */ +#endif /* CFE_ES_CDS_H */ diff --git a/modules/es/fsw/src/cfe_es_cds_mempool.h b/modules/es/fsw/src/cfe_es_cds_mempool.h index cbe075921..42c1c421a 100644 --- a/modules/es/fsw/src/cfe_es_cds_mempool.h +++ b/modules/es/fsw/src/cfe_es_cds_mempool.h @@ -18,24 +18,24 @@ ** limitations under the License. */ -/* -** File: -** cfe_es_cds_mempool.h -** -** Purpose: -** This file contains the Internal interface for the cFE Critical Data Store -** memory pool functions. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * This file contains the Internal interface for the cFE Critical Data Store + * memory pool functions. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef _cfe_es_cds_mempool_ -#define _cfe_es_cds_mempool_ +#ifndef CFE_ES_CDS_MEMPOOL_H +#define CFE_ES_CDS_MEMPOOL_H /* ** Include Files @@ -76,4 +76,4 @@ int32 CFE_ES_CDSBlockRead(void *DataRead, CFE_ES_CDSHandle_t Handle); size_t CFE_ES_CDSReqdMinSize(uint32 MaxNumBlocksToSupport); -#endif /* _cfe_es_cds_mempool_ */ +#endif /* CFE_ES_CDS_MEMPOOL_H */ diff --git a/modules/es/fsw/src/cfe_es_generic_pool.h b/modules/es/fsw/src/cfe_es_generic_pool.h index 1361a81e1..7f883963c 100644 --- a/modules/es/fsw/src/cfe_es_generic_pool.h +++ b/modules/es/fsw/src/cfe_es_generic_pool.h @@ -18,24 +18,24 @@ ** limitations under the License. */ -/* -** File: -** cfe_es_generic_pool.h -** -** Purpose: -** This file contains the Internal interface for the cFE Critical Data Store -** memory pool functions. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * This file contains the Internal interface for the cFE Critical Data Store + * memory pool functions. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef cfe_es_generic_pool_h -#define cfe_es_generic_pool_h +#ifndef CFE_ES_GENERIC_POOL_H +#define CFE_ES_GENERIC_POOL_H /* ** Include Files @@ -281,4 +281,4 @@ void CFE_ES_GenPoolGetBucketUsage(CFE_ES_GenPoolRecord_t *PoolRecPtr, uint16 Buc */ size_t CFE_ES_GenPoolCalcMinSize(uint16 NumBlockSizes, const size_t *BlockSizeList, uint32 NumBlocks); -#endif /* _cfe_es_generic_pool_ */ +#endif /* CFE_ES_GENERIC_POOL_H */ diff --git a/modules/es/fsw/src/cfe_es_global.h b/modules/es/fsw/src/cfe_es_global.h index bbe4ffb51..ee96fd932 100644 --- a/modules/es/fsw/src/cfe_es_global.h +++ b/modules/es/fsw/src/cfe_es_global.h @@ -18,21 +18,21 @@ ** limitations under the License. */ -/* -** File: -** cfe_es_global.h -** -** Purpose: -** This file contains the ES global data definitions. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -*/ +/** + * @file + * + * + * Purpose: + * This file contains the ES global data definitions. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + */ -#ifndef _cfe_es_global_ -#define _cfe_es_global_ +#ifndef CFE_ES_GLOBAL_H +#define CFE_ES_GLOBAL_H /* ** Includes @@ -161,4 +161,4 @@ extern CFE_ES_ResetData_t *CFE_ES_ResetDataPtr; extern void CFE_ES_LockSharedData(const char *FunctionName, int32 LineNumber); extern void CFE_ES_UnlockSharedData(const char *FunctionName, int32 LineNumber); -#endif +#endif /* CFE_ES_GLOBAL_H */ diff --git a/modules/es/fsw/src/cfe_es_log.h b/modules/es/fsw/src/cfe_es_log.h index 6e4c51524..1f29be821 100644 --- a/modules/es/fsw/src/cfe_es_log.h +++ b/modules/es/fsw/src/cfe_es_log.h @@ -18,25 +18,25 @@ ** limitations under the License. */ -/* -** File: -** cfe_es_log.h -** -** Purpose: -** This file contains definitions needed for the cFE ES Logs. The -** logs include the Mode Transition log, the System Log, and the -** Performance log. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: + * This file contains definitions needed for the cFE ES Logs. The + * logs include the Mode Transition log, the System Log, and the + * Performance log. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef _cfe_es_log_ -#define _cfe_es_log_ +#ifndef CFE_ES_LOG_H +#define CFE_ES_LOG_H /* ** Include Files @@ -359,4 +359,4 @@ int32 CFE_ES_WriteToERLog(CFE_ES_LogEntryType_Enum_t EntryType, uint32 ResetType int32 CFE_ES_WriteToERLogWithContext(CFE_ES_LogEntryType_Enum_t EntryType, uint32 ResetType, uint32 ResetSubtype, const char *Description, CFE_ES_AppId_t AppId, uint32 PspContextId); -#endif /* _cfe_es_log_ */ +#endif /* CFE_ES_LOG_H */ diff --git a/modules/es/fsw/src/cfe_es_mempool.h b/modules/es/fsw/src/cfe_es_mempool.h index 9780a46fb..ae6cbf469 100644 --- a/modules/es/fsw/src/cfe_es_mempool.h +++ b/modules/es/fsw/src/cfe_es_mempool.h @@ -19,7 +19,8 @@ */ /** - * \file cfe_es_mempool.h + * @file + * * * Contains data structure definitions used by the ES mempool implementation. * @@ -27,8 +28,8 @@ * with a layer on top to translate into memory mapped buffer addresses. */ -#ifndef _CFE_ES_MEMPOOL_H_ -#define _CFE_ES_MEMPOOL_H_ +#ifndef CFE_ES_MEMPOOL_H +#define CFE_ES_MEMPOOL_H /* ** Include Files @@ -197,4 +198,4 @@ static inline bool CFE_ES_MemPoolRecordIsMatch(const CFE_ES_MemPoolRecord_t *Poo */ bool CFE_ES_CheckMemPoolSlotUsed(CFE_ResourceId_t CheckId); -#endif /* _CFE_ES_MEMPOOL_H_ */ +#endif /* CFE_ES_MEMPOOL_H */ diff --git a/modules/es/fsw/src/cfe_es_module_all.h b/modules/es/fsw/src/cfe_es_module_all.h index c395518f7..8ae050eef 100644 --- a/modules/es/fsw/src/cfe_es_module_all.h +++ b/modules/es/fsw/src/cfe_es_module_all.h @@ -19,7 +19,8 @@ */ /** - * @file cfe_es_module_all.h + * @file + * * * Encapsulates all ES module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. @@ -54,4 +55,4 @@ #include "cfe_es_resource.h" #include "cfe_es_log.h" -#endif +#endif /* CFE_ES_MODULE_ALL_H */ diff --git a/modules/es/fsw/src/cfe_es_perf.h b/modules/es/fsw/src/cfe_es_perf.h index 4b37d2602..022f2d8a7 100644 --- a/modules/es/fsw/src/cfe_es_perf.h +++ b/modules/es/fsw/src/cfe_es_perf.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_es_perf.h -** -** Purpose: Performance Analyzer data structures -** -** Design Notes: -** -** References: -** -*/ +/** + * @file + * + * + * Purpose: Performance Analyzer data structures + * + * Design Notes: + * + * References: + * + */ -#ifndef _cfe_es_perf_ -#define _cfe_es_perf_ +#ifndef CFE_ES_PERF_H +#define CFE_ES_PERF_H /* ** Include Files @@ -132,4 +133,4 @@ uint32 CFE_ES_GetPerfLogDumpRemaining(void); */ bool CFE_ES_RunPerfLogDump(uint32 ElapsedTime, void *Arg); -#endif /* _cfe_es_perf_ */ +#endif /* CFE_ES_PERF_H */ diff --git a/modules/es/fsw/src/cfe_es_resource.h b/modules/es/fsw/src/cfe_es_resource.h index 67f9bf417..5b57c6f2c 100644 --- a/modules/es/fsw/src/cfe_es_resource.h +++ b/modules/es/fsw/src/cfe_es_resource.h @@ -19,7 +19,8 @@ */ /** - * \file cfe_es_resource.h + * @file + * * * Contains basic prototypes and definitions related to CFE ES resource * management and related resource IDs. diff --git a/modules/es/fsw/src/cfe_es_start.h b/modules/es/fsw/src/cfe_es_start.h index 6df8e3295..e9408d370 100644 --- a/modules/es/fsw/src/cfe_es_start.h +++ b/modules/es/fsw/src/cfe_es_start.h @@ -18,29 +18,26 @@ ** limitations under the License. */ -/* -** -** File: -** cfe_es_start.h -** -** Purpose: -** cFE core startup module defines, data types and prototypes. -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ +/** + * @file + * + * Purpose: + * cFE core startup module defines, data types and prototypes. + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ -#ifndef _cfe_es_start_ -#define _cfe_es_start_ +#ifndef CFE_ES_START_H +#define CFE_ES_START_H /* ** Include Files */ - #include "cfe_es_api_typedefs.h" /* @@ -94,4 +91,4 @@ extern void CFE_ES_SetupResetVariables(uint32 StartType, uint32 StartSubtype, ui extern void CFE_ES_InitializeFileSystems(uint32 StartType); extern void CFE_ES_SetupPerfVariables(uint32 ResetType); -#endif /* _cfe_es_start_ */ +#endif /* CFE_ES_START_H */ diff --git a/modules/es/fsw/src/cfe_es_task.h b/modules/es/fsw/src/cfe_es_task.h index 5a5c8ffdb..2c45c2fc8 100644 --- a/modules/es/fsw/src/cfe_es_task.h +++ b/modules/es/fsw/src/cfe_es_task.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/* -** File: cfe_es_task.h -** -** Purpose: -** cFE Executive Services (ES) task header file -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** -*/ -/*************************************************************************/ -#ifndef _cfe_es_task_ -#define _cfe_es_task_ +/** + * @file + * + * + * Purpose: + * cFE Executive Services (ES) task header file + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * + */ + +#ifndef CFE_ES_TASK_H +#define CFE_ES_TASK_H /* ** Includes @@ -201,8 +202,4 @@ void CFE_ES_FileWriteByteCntErr(const char *Filename, size_t Requested, int32 St /*************************************************************************/ -#endif /* _cfe_es_task_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_ES_TASK_H */ diff --git a/modules/es/fsw/src/cfe_es_verify.h b/modules/es/fsw/src/cfe_es_verify.h index f04976cbb..cf0b97dec 100644 --- a/modules/es/fsw/src/cfe_es_verify.h +++ b/modules/es/fsw/src/cfe_es_verify.h @@ -18,25 +18,26 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_es_verify.h -** -** Purpose: -** This header file performs compile time checking for ES configuration -** parameters. -** -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -** Notes: -** The upper limits are somewhat arbitrary right now. -** -******************************************************************************/ - -#ifndef _cfe_es_verify_ -#define _cfe_es_verify_ +/** + * @file + * + * + * Purpose: + * This header file performs compile time checking for ES configuration + * parameters. + * + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + * Notes: + * The upper limits are somewhat arbitrary right now. + * + */ + +#ifndef CFE_ES_VERIFY_H +#define CFE_ES_VERIFY_H #include @@ -335,5 +336,4 @@ #error CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN must be a multiple of 4 #endif -#endif /* _cfe_es_verify_ */ -/*****************************************************************************/ +#endif /* CFE_ES_VERIFY_H */ diff --git a/modules/es/ut-coverage/es_UT.h b/modules/es/ut-coverage/es_UT.h index d0ef41984..f91b9e398 100644 --- a/modules/es/ut-coverage/es_UT.h +++ b/modules/es/ut-coverage/es_UT.h @@ -18,24 +18,24 @@ ** limitations under the License. */ -/* -** File: -** es_UT.h -** -** Purpose: -** ES unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _es_UT_h_ -#define _es_UT_h_ +/** + * @file + * + * Purpose: + * ES unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef ES_UT_H +#define ES_UT_H /* ** Macro definitions @@ -251,4 +251,4 @@ void TestGenericCounterAPI(void); void TestGenericPool(void); void TestLibs(void); -#endif /* _es_ut_h_ */ +#endif /* ES_UT_H */ diff --git a/modules/evs/fsw/inc/cfe_evs_events.h b/modules/evs/fsw/inc/cfe_evs_events.h index e946a06cc..13e59f4ca 100644 --- a/modules/evs/fsw/inc/cfe_evs_events.h +++ b/modules/evs/fsw/inc/cfe_evs_events.h @@ -18,21 +18,22 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs_events.h -** -** Purpose: -** cFE Event Services (EVS) Event IDs -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -*/ - -#ifndef _cfe_evs_events_ -#define _cfe_evs_events_ +/** + * @file + * + * + * Purpose: + * cFE Event Services (EVS) Event IDs + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ + +#ifndef CFE_EVS_EVENTS_H +#define CFE_EVS_EVENTS_H /* ************************** ** ****** Maximum EID. ****** @@ -639,4 +640,4 @@ **/ #define CFE_EVS_LEN_ERR_EID 43 -#endif /* _cfe_evs_events_ */ +#endif /* CFE_EVS_EVENTS_H */ diff --git a/modules/evs/fsw/inc/cfe_evs_msg.h b/modules/evs/fsw/inc/cfe_evs_msg.h index 5f56e2408..cc2515b3c 100644 --- a/modules/evs/fsw/inc/cfe_evs_msg.h +++ b/modules/evs/fsw/inc/cfe_evs_msg.h @@ -18,22 +18,24 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs_msg.h -** -** Title: Event Services Message definition header file Header File -** -** Purpose: -** Unit specification for Event services command codes and data structures. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -*/ -#ifndef _cfe_evs_msg_ -#define _cfe_evs_msg_ +/** + * @file + * + * + * Title: Event Services Message definition header file Header File + * + * Purpose: + * Unit specification for Event services command codes and data structures. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ + +#ifndef CFE_EVS_MSG_H +#define CFE_EVS_MSG_H /********************************** Include Files ************************************/ #include "common_types.h" /* Basic data types */ @@ -1286,4 +1288,4 @@ typedef struct CFE_EVS_ShortEventTlm } CFE_EVS_ShortEventTlm_t; -#endif +#endif /* CFE_EVS_MSG_H */ diff --git a/modules/evs/fsw/src/cfe_evs_log.h b/modules/evs/fsw/src/cfe_evs_log.h index 12f4a0c28..6ae064abe 100644 --- a/modules/evs/fsw/src/cfe_evs_log.h +++ b/modules/evs/fsw/src/cfe_evs_log.h @@ -18,30 +18,29 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs_log.h -** -** Title: Event Services API Log Control Interfaces. -** -** Purpose: -** Unit specification for the event services log control interfaces. -** -** Contents: -** I. macro and constant type definitions -** II. EVM internal structures -** III. function prototypes -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -** Notes: -** -**/ - -#ifndef _cfe_evs_log_ -#define _cfe_evs_log_ +/** + * @file + * + * Title: Event Services API Log Control Interfaces. + * + * Purpose: + * Unit specification for the event services log control interfaces. + * + * Contents: + * I. macro and constant type definitions + * II. EVM internal structures + * III. function prototypes + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + * Notes: + */ + +#ifndef CFE_EVS_LOG_H +#define CFE_EVS_LOG_H /********************* Include Files ************************/ @@ -58,4 +57,4 @@ void EVS_ClearLog(void); int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFileCmd_t *data); int32 CFE_EVS_SetLogModeCmd(const CFE_EVS_SetLogModeCmd_t *data); -#endif /* _cfe_evs_log_ */ +#endif /* CFE_EVS_LOG_H */ diff --git a/modules/evs/fsw/src/cfe_evs_module_all.h b/modules/evs/fsw/src/cfe_evs_module_all.h index 487d32aa9..24550feaa 100644 --- a/modules/evs/fsw/src/cfe_evs_module_all.h +++ b/modules/evs/fsw/src/cfe_evs_module_all.h @@ -19,7 +19,7 @@ */ /** - * @file cfe_evs_module_all.h + * @file * * Encapsulates all EVS module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index df92fe472..5548c5939 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -18,28 +18,29 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs_task.h -** -** Title: Event Services API - Management Control Interfaces. -** -** Purpose: -** Unit specification for the event services management control interfaces. -** -** Contents: -** I. macro and constant type definitions -** II. EVS internal structures -** III. function prototypes -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -**/ +/** + * @file + * + * + * Title: Event Services API - Management Control Interfaces. + * + * Purpose: + * Unit specification for the event services management control interfaces. + * + * Contents: + * I. macro and constant type definitions + * II. EVS internal structures + * III. function prototypes + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ -#ifndef _cfe_evs_task_ -#define _cfe_evs_task_ +#ifndef CFE_EVS_TASK_H +#define CFE_EVS_TASK_H /********************************** Include Files ************************************/ #include "common_types.h" @@ -159,4 +160,4 @@ int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilterCmd_t *data); int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFileCmd_t *data); int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFiltersCmd_t *data); -#endif /* _cfe_evs_task_ */ +#endif /* CFE_EVS_TASK_H */ diff --git a/modules/evs/fsw/src/cfe_evs_utils.h b/modules/evs/fsw/src/cfe_evs_utils.h index db547bf05..1740fa02e 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.h +++ b/modules/evs/fsw/src/cfe_evs_utils.h @@ -18,28 +18,29 @@ ** limitations under the License. */ -/* -** Filename: cfe_evs_utils.h -** -** Title: Event Services Task and API - Utility functions. -** -** Purpose: -** Unit specification for the event services utility functions. -** -** Contents: -** I. macro and constant type definitions -** II. EVS utility internal structures -** III. function prototypes -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -*/ +/** + * @file + * + * + * Title: Event Services Task and API - Utility functions. + * + * Purpose: + * Unit specification for the event services utility functions. + * + * Contents: + * I. macro and constant type definitions + * II. EVS utility internal structures + * III. function prototypes + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ -#ifndef _cfe_evs_utils_ -#define _cfe_evs_utils_ +#ifndef CFE_EVS_UTILS_H +#define CFE_EVS_UTILS_H /********************* Include Files ************************/ @@ -173,4 +174,4 @@ void EVS_GenerateEventTelemetry(EVS_AppData_t *AppDataPtr, uint16 EventID, uint1 int32 EVS_SendEvent(uint16 EventID, uint16 EventType, const char *Spec, ...); -#endif /* _cfe_evs_utils_ */ +#endif /* CFE_EVS_UTILS_H */ diff --git a/modules/evs/fsw/src/cfe_evs_verify.h b/modules/evs/fsw/src/cfe_evs_verify.h index 46ab29fad..67b7d4dfd 100644 --- a/modules/evs/fsw/src/cfe_evs_verify.h +++ b/modules/evs/fsw/src/cfe_evs_verify.h @@ -18,22 +18,23 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_evs_verify.h -** -** Purpose: -** This header file performs compile time checking for EVS configuration -** parameters. -** -** Author: K.Audra(Microtel) -** -** Notes: -** -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file performs compile time checking for EVS configuration + * parameters. + * + * Author: K.Audra(Microtel) + * + * Notes: + * + * + */ -#ifndef _cfe_evs_verify_ -#define _cfe_evs_verify_ +#ifndef CFE_EVS_VERIFY_H +#define CFE_EVS_VERIFY_H /* NOTE: Besides the checks in this file, there is one more in cfe_evs_task.h. * The check is not here because it is checking a local #define based on a @@ -64,5 +65,4 @@ #error CFE_PLATFORM_EVS_START_TASK_STACK_SIZE must be greater than or equal to 2048 #endif -#endif /* _cfe_evs_verify_ */ -/*****************************************************************************/ +#endif /* CFE_EVS_VERIFY_H */ diff --git a/modules/evs/ut-coverage/evs_UT.h b/modules/evs/ut-coverage/evs_UT.h index ed2c94573..d98f409cc 100644 --- a/modules/evs/ut-coverage/evs_UT.h +++ b/modules/evs/ut-coverage/evs_UT.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: -** evs_UT.h -** -** Purpose: -** EVS unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _evs_UT_h_ -#define _evs_UT_h_ +/** + * @file + * + * + * Purpose: + * EVS unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef EVS_UT_H +#define EVS_UT_H /* ** Includes @@ -265,4 +266,4 @@ void Test_InvalidCmd(void); ******************************************************************************/ void Test_Misc(void); -#endif /* _evs_UT_h_ */ +#endif /* EVS_UT_H */ diff --git a/modules/fs/fsw/src/cfe_fs_module_all.h b/modules/fs/fsw/src/cfe_fs_module_all.h index 751b89f7f..9c2affb85 100644 --- a/modules/fs/fsw/src/cfe_fs_module_all.h +++ b/modules/fs/fsw/src/cfe_fs_module_all.h @@ -19,7 +19,7 @@ */ /** - * @file cfe_fs_module_all.h + * @file * * Encapsulates all FS module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. @@ -39,4 +39,3 @@ #include "cfe_fs_core_internal.h" #endif /* CFE_FS_MODULE_ALL_H */ -/*****************************************************************************/ diff --git a/modules/fs/fsw/src/cfe_fs_priv.h b/modules/fs/fsw/src/cfe_fs_priv.h index 7957a5757..393bd331d 100644 --- a/modules/fs/fsw/src/cfe_fs_priv.h +++ b/modules/fs/fsw/src/cfe_fs_priv.h @@ -18,20 +18,21 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_fs_priv.h -** -** Purpose: -** This header file contains prototypes for private functions and type -** definitions for FS internal use. -** -** Author: A. Cudmore/NASA GSFC -** -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file contains prototypes for private functions and type + * definitions for FS internal use. + * + * Author: A. Cudmore/NASA GSFC + * + * + */ -#ifndef _cfe_fs_priv_ -#define _cfe_fs_priv_ +#ifndef CFE_FS_PRIV_H +#define CFE_FS_PRIV_H /* ** Includes @@ -153,5 +154,4 @@ extern void CFE_FS_UnlockSharedData(const char *FunctionName); extern void CFE_FS_ByteSwapCFEHeader(CFE_FS_Header_t *Hdr); extern void CFE_FS_ByteSwapUint32(uint32 *Uint32ToSwapPtr); -#endif /* _cfe_fs_priv_ */ -/*****************************************************************************/ +#endif /* CFE_FS_PRIV_H */ diff --git a/modules/fs/ut-coverage/fs_UT.h b/modules/fs/ut-coverage/fs_UT.h index bc3cfa642..025044cd0 100644 --- a/modules/fs/ut-coverage/fs_UT.h +++ b/modules/fs/ut-coverage/fs_UT.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: -** fs_UT.h -** -** Purpose: -** FS unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _fs_UT_h_ -#define _fs_UT_h_ +/** + * @file + * + * + * Purpose: + * FS unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef FS_UT_H +#define FS_UT_H /* ** Includes @@ -314,4 +315,4 @@ void Test_CFE_FS_GetUncompressedFile(void); ******************************************************************************/ void Test_CFE_FS_BackgroundFileDump(void); -#endif /* _es_ut_h_ */ +#endif /* FS_UT_H */ diff --git a/modules/msg/fsw/inc/ccsds_hdr.h b/modules/msg/fsw/inc/ccsds_hdr.h index 1ac46bb2f..9aaaa3b01 100644 --- a/modules/msg/fsw/inc/ccsds_hdr.h +++ b/modules/msg/fsw/inc/ccsds_hdr.h @@ -18,14 +18,16 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Define CCSDS packet header types * - Avoid direct access for portability, use APIs * - Used to construct message structures */ -#ifndef _ccsds_hdr_ -#define _ccsds_hdr_ +#ifndef CCSDS_HDR_H +#define CCSDS_HDR_H /* * Include Files @@ -87,4 +89,4 @@ typedef struct CCSDS_ExtendedHeader } CCSDS_ExtendedHeader_t; -#endif /* _ccsds_hdr_ */ +#endif /* CCSDS_HDR_H */ diff --git a/modules/msg/fsw/src/cfe_msg_defaults.h b/modules/msg/fsw/src/cfe_msg_defaults.h index cd25862ba..d667f6e5b 100644 --- a/modules/msg/fsw/src/cfe_msg_defaults.h +++ b/modules/msg/fsw/src/cfe_msg_defaults.h @@ -18,13 +18,15 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Message header defaults, used to initialize messages * - Avoid including outside this module */ -#ifndef _cfe_msg_defaults_ -#define _cfe_msg_defaults_ +#ifndef CFE_MSG_DEFAULTS_H +#define CFE_MSG_DEFAULTS_H /* * Includes @@ -78,4 +80,4 @@ void CFE_MSG_SetDefaultCCSDSPri(CFE_MSG_Message_t *MsgPtr); */ void CFE_MSG_SetDefaultCCSDSExt(CFE_MSG_Message_t *MsgPtr); -#endif /* _cfe_msg_default_ */ +#endif /* CFE_MSG_DEFAULTS_H */ diff --git a/modules/msg/fsw/src/cfe_msg_priv.h b/modules/msg/fsw/src/cfe_msg_priv.h index ddd2c3d14..6f992fa9c 100644 --- a/modules/msg/fsw/src/cfe_msg_priv.h +++ b/modules/msg/fsw/src/cfe_msg_priv.h @@ -18,13 +18,15 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Message private header * - Avoid including outside this module */ -#ifndef _cfe_msg_priv_ -#define _cfe_msg_priv_ +#ifndef CFE_MSG_PRIV_H +#define CFE_MSG_PRIV_H /* * Includes @@ -79,4 +81,4 @@ static inline void CFE_MSG_SetHeaderField(uint8 *Word, uint16 Val, uint16 Mask) */ void CFE_MSG_InitDefaultHdr(CFE_MSG_Message_t *MsgPtr); -#endif /* _cfe_msg_priv_ */ +#endif /* CFE_MSG_PRIV_H */ diff --git a/modules/msg/option_inc/default_cfe_msg_hdr_pri.h b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h index 28958a283..ca27a0cd3 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_pri.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_pri.h @@ -18,14 +18,16 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Define cFS standard full header * - Avoid direct access for portability, use APIs * - Used to construct message structures */ -#ifndef _cfe_msg_hdr_ -#define _cfe_msg_hdr_ +#ifndef DEFAULT_CFE_MSG_HDR_PRI_H +#define DEFAULT_CFE_MSG_HDR_PRI_H /* * Include Files @@ -89,4 +91,4 @@ struct CFE_MSG_TelemetryHeader uint8 Spare[4]; /**< \brief Padding to end on 64 bit boundary */ }; -#endif /* _cfe_msg_hdr_ */ +#endif /* DEFAULT_CFE_MSG_HDR_PRI_H */ diff --git a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h index f756a8a03..233f9c799 100644 --- a/modules/msg/option_inc/default_cfe_msg_hdr_priext.h +++ b/modules/msg/option_inc/default_cfe_msg_hdr_priext.h @@ -18,14 +18,16 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Define cFS standard full header * - Avoid direct access for portability, use APIs * - Used to construct message structures */ -#ifndef _cfe_msg_hdr_ -#define _cfe_msg_hdr_ +#ifndef DEFAULT_CFE_MSG_HDR_PRIEXT_H +#define DEFAULT_CFE_MSG_HDR_PRIEXT_H /* * Include Files @@ -87,4 +89,4 @@ typedef struct } CFE_MSG_TelemetryHeader_t; -#endif /* _cfe_msg_hdr_ */ +#endif /* DEFAULT_CFE_MSG_HDR_PRIEXT_H */ diff --git a/modules/msg/option_inc/default_cfe_msg_sechdr.h b/modules/msg/option_inc/default_cfe_msg_sechdr.h index 92edcea2c..a9356ecac 100644 --- a/modules/msg/option_inc/default_cfe_msg_sechdr.h +++ b/modules/msg/option_inc/default_cfe_msg_sechdr.h @@ -18,14 +18,16 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Define cFS standard secondary header * - Avoid direct access for portability, use APIs * - Used to construct message structures */ -#ifndef _cfe_msg_sechdr_ -#define _cfe_msg_sechdr_ +#ifndef DEFAULT_CFE_MSG_SECHDR_H +#define DEFAULT_CFE_MSG_SECHDR_H /* * Include Files @@ -74,4 +76,4 @@ typedef struct } CFE_MSG_TelemetrySecondaryHeader_t; -#endif /* _cfe_msg_sechdr_ */ +#endif /* DEFAULT_CFE_MSG_SECHDR_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.h b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.h index d1c416432..0ac75a33b 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.h +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdsext.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_ccsdsext test header */ -#ifndef test_cfe_msg_ccsdsext_ -#define test_cfe_msg_ccsdsext_ +#ifndef TEST_CFE_MSG_CCSDSEXT_H +#define TEST_CFE_MSG_CCSDSEXT_H /* * Defines @@ -34,4 +36,4 @@ /* Test CCSDS Extended header accessor functions */ void Test_MSG_CCSDSExt(void); -#endif /* test_cfe_msg_ccsdsext_ */ +#endif /* TEST_CFE_MSG_CCSDSEXT_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.h b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.h index c85e21961..ced7e5367 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.h +++ b/modules/msg/ut-coverage/test_cfe_msg_ccsdspri.h @@ -18,11 +18,14 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_ccsdspri test header */ -#ifndef test_cfe_msg_ccsdspri_ -#define test_cfe_msg_ccsdspri_ + +#ifndef TEST_CFE_MSG_CCSDSPRI_H +#define TEST_CFE_MSG_CCSDSPRI_H /* * Defines @@ -36,4 +39,4 @@ /* Test CCSDS Primary header accessor functions */ void Test_MSG_CCSDSPri(void); -#endif /* test_cfe_msg_ccsdspri_ */ +#endif /* TEST_CFE_MSG_CCSDSPRI_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_checksum.h b/modules/msg/ut-coverage/test_cfe_msg_checksum.h index 5b521fe7f..53563bb83 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_checksum.h +++ b/modules/msg/ut-coverage/test_cfe_msg_checksum.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_checksum test header */ -#ifndef test_cfe_msg_checksum_ -#define test_cfe_msg_checksum_ +#ifndef TEST_CFE_MSG_CHECKSUM_H +#define TEST_CFE_MSG_CHECKSUM_H /* * Functions @@ -30,4 +32,4 @@ /* Test checksum accessor functions */ void Test_MSG_Checksum(void); -#endif /* test_cfe_msg_checksum_ */ +#endif /* TEST_CFE_MSG_CHECKSUM_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_fc.h b/modules/msg/ut-coverage/test_cfe_msg_fc.h index 1dbff0fca..5fb8e67ea 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_fc.h +++ b/modules/msg/ut-coverage/test_cfe_msg_fc.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_fc test header */ -#ifndef test_cfe_msg_fc_ -#define test_cfe_msg_fc_ +#ifndef TEST_CFE_MSG_FC_H +#define TEST_CFE_MSG_FC_H /* * Functions @@ -30,4 +32,4 @@ /* Test function code accessor functions */ void Test_MSG_FcnCode(void); -#endif /* test_cfe_msg_fc_ */ +#endif /* TEST_CFE_MSG_FC_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_init.h b/modules/msg/ut-coverage/test_cfe_msg_init.h index 0ee75f86c..99a872b27 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_init.h +++ b/modules/msg/ut-coverage/test_cfe_msg_init.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_init test header */ -#ifndef test_cfe_msg_init_ -#define test_cfe_msg_init_ +#ifndef TEST_CFE_MSG_INIT_H +#define TEST_CFE_MSG_INIT_H /* * Includes @@ -34,4 +36,4 @@ /* Test extended header mission functionality */ void Test_MSG_Init(void); -#endif /* test_cfe_msg_init_ */ +#endif /* TEST_CFE_MSG_INIT_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid.h b/modules/msg/ut-coverage/test_cfe_msg_msgid.h index 8a3a467e9..fe8225664 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid.h +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * Message ID V2 accessor function test header */ -#ifndef test_cfe_msg_msgid_ -#define test_cfe_msg_msgid_ +#ifndef TEST_CFE_MSG_MSGID_H +#define TEST_CFE_MSG_MSGID_H /* * Functions @@ -30,4 +32,4 @@ /* Test msgid accessor functions */ void Test_MSG_MsgId(void); -#endif /* test_cfe_msg_msgid_ */ +#endif /* TEST_CFE_MSG_MSGID_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.h b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.h index 469f65408..39e803b04 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.h +++ b/modules/msg/ut-coverage/test_cfe_msg_msgid_shared.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_msgid_shared test header */ -#ifndef test_cfe_msg_msgid_shared_ -#define test_cfe_msg_msgid_shared_ +#ifndef TEST_CFE_MSG_MSGID_SHARED_H +#define TEST_CFE_MSG_MSGID_SHARED_H /* * Functions @@ -30,4 +32,4 @@ /* Test msgid shared accessor functions */ void Test_MSG_MsgId_Shared(void); -#endif /* test_cfe_msg_msgid_shared_ */ +#endif /* TEST_CFE_MSG_MSGID_SHARED_H */ diff --git a/modules/msg/ut-coverage/test_cfe_msg_time.h b/modules/msg/ut-coverage/test_cfe_msg_time.h index 2981d8ee5..4b4afb8b9 100644 --- a/modules/msg/ut-coverage/test_cfe_msg_time.h +++ b/modules/msg/ut-coverage/test_cfe_msg_time.h @@ -18,11 +18,13 @@ ** limitations under the License. */ -/* +/** + * @file + * * cfe_msg_time test header */ -#ifndef test_cfe_msg_time_ -#define test_cfe_msg_time_ +#ifndef TEST_CFE_MSG_TIME_H +#define TEST_CFE_MSG_TIME_H /* * Functions @@ -30,4 +32,4 @@ /* Test time accessor functions */ void Test_MSG_Time(void); -#endif /* test_cfe_msg_time_ */ +#endif /* TEST_CFE_MSG_TIME_H */ diff --git a/modules/msg/ut-coverage/test_msg_not.h b/modules/msg/ut-coverage/test_msg_not.h index 10bb706ba..f35e6280f 100644 --- a/modules/msg/ut-coverage/test_msg_not.h +++ b/modules/msg/ut-coverage/test_msg_not.h @@ -18,11 +18,14 @@ ** limitations under the License. */ -/* +/** + * @file + * * Message header fields not (Zero or F's) */ -#ifndef test_msg_not_ -#define test_msg_not_ + +#ifndef TEST_MSG_NOT_H +#define TEST_MSG_NOT_H /* * Defines @@ -64,4 +67,4 @@ unsigned int Test_MSG_NotF(const CFE_MSG_Message_t *MsgPtr); unsigned int Test_MSG_Pri_NotF(const CFE_MSG_Message_t *MsgPtr); unsigned int Test_MSG_Ext_NotF(const CFE_MSG_Message_t *MsgPtr); -#endif /* test_msg_not_ */ +#endif /* TEST_MSG_NOT_H */ diff --git a/modules/msg/ut-coverage/test_msg_utils.h b/modules/msg/ut-coverage/test_msg_utils.h index f95a9c017..0e52773f3 100644 --- a/modules/msg/ut-coverage/test_msg_utils.h +++ b/modules/msg/ut-coverage/test_msg_utils.h @@ -18,11 +18,14 @@ ** limitations under the License. */ -/* +/** + * @file + * * Message header test utilities */ -#ifndef test_msg_utils_ -#define test_msg_utils_ + +#ifndef TEST_MSG_UTILS_H +#define TEST_MSG_UTILS_H /* * Includes @@ -36,4 +39,4 @@ /* Subtest macro */ #define MSG_UT_ADD_SUBTEST(Func) UT_AddSubTest(Func, NULL, NULL, __func__, #Func) -#endif /* test_msg_utils_ */ \ No newline at end of file +#endif /* TEST_MSG_UTILS_H */ diff --git a/modules/resourceid/option_inc/cfe_resourceid_osal_compatible.h b/modules/resourceid/option_inc/cfe_resourceid_osal_compatible.h index 77d7eefee..93bbaffa7 100644 --- a/modules/resourceid/option_inc/cfe_resourceid_osal_compatible.h +++ b/modules/resourceid/option_inc/cfe_resourceid_osal_compatible.h @@ -19,7 +19,7 @@ */ /** - * \file cfe_resourceid_osal_compatible.h + * @file * * An implementation of CFE resource ID base values/limits that will be * compatible with OSAL IDs. This is intended as a transitional tool to diff --git a/modules/resourceid/option_inc/cfe_resourceid_simple.h b/modules/resourceid/option_inc/cfe_resourceid_simple.h index 8a4e05607..fe6348d3a 100644 --- a/modules/resourceid/option_inc/cfe_resourceid_simple.h +++ b/modules/resourceid/option_inc/cfe_resourceid_simple.h @@ -18,6 +18,12 @@ ** limitations under the License. */ +/** + * @file + * + * Declarations and prototypes for simple (uint32 compatible) resource ID implementation + */ + #ifndef CFE_RESOURCEID_SIMPLE_H #define CFE_RESOURCEID_SIMPLE_H diff --git a/modules/resourceid/option_inc/cfe_resourceid_strict.h b/modules/resourceid/option_inc/cfe_resourceid_strict.h index ca2d9bf2b..f71c30727 100644 --- a/modules/resourceid/option_inc/cfe_resourceid_strict.h +++ b/modules/resourceid/option_inc/cfe_resourceid_strict.h @@ -18,6 +18,12 @@ ** limitations under the License. */ +/** + * @file + * + * Declarations and prototypes for strict (type-safe) resource ID implementation + */ + #ifndef CFE_RESOURCEID_STRICT_H #define CFE_RESOURCEID_STRICT_H diff --git a/modules/sb/fsw/inc/cfe_sb_events.h b/modules/sb/fsw/inc/cfe_sb_events.h index dfeaf466f..24c02be34 100644 --- a/modules/sb/fsw/inc/cfe_sb_events.h +++ b/modules/sb/fsw/inc/cfe_sb_events.h @@ -18,19 +18,21 @@ ** limitations under the License. */ -/* -** File: cfe_sb_events.h -** -** Purpose: -** cFE Software Bus (SB) Event IDs -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** cFE Flight Software Application Developers Guide -** -**************************************************************************/ -#ifndef _cfe_sb_events_ -#define _cfe_sb_events_ +/** + * @file + * + * + * Purpose: + * cFE Software Bus (SB) Event IDs + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * cFE Flight Software Application Developers Guide + * + */ + +#ifndef CFE_SB_EVENTS_H +#define CFE_SB_EVENTS_H /* ************************** ** ****** Maximum EID. ****** @@ -902,8 +904,4 @@ **/ #define CFE_SB_CR_PIPE_NO_FREE_EID 63 -#endif /* _cfe_sb_events_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_SB_EVENTS_H */ diff --git a/modules/sb/fsw/inc/cfe_sb_msg.h b/modules/sb/fsw/inc/cfe_sb_msg.h index ca9f5f85b..fc2892f90 100644 --- a/modules/sb/fsw/inc/cfe_sb_msg.h +++ b/modules/sb/fsw/inc/cfe_sb_msg.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_sb_msg.h -** -** Purpose: -** This header file contains structure definitions for all SB command and -** telemetry packets -** -** Author: R.McGraw/SSI -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file contains structure definitions for all SB command and + * telemetry packets + * + * Author: R.McGraw/SSI + * + */ -#ifndef _cfe_sb_msg_ -#define _cfe_sb_msg_ +#ifndef CFE_SB_MSG_H +#define CFE_SB_MSG_H /* ** Includes @@ -784,5 +785,4 @@ typedef struct CFE_SB_AllSubscriptionsTlm CFE_SB_AllSubscriptionsTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_SB_AllSubscriptionsTlm_t; -#endif /* _cfe_sb_msg_ */ -/*****************************************************************************/ +#endif /* CFE_SB_MSG_H */ diff --git a/modules/sb/fsw/src/cfe_sb_module_all.h b/modules/sb/fsw/src/cfe_sb_module_all.h index b3fc6a453..f54ecb67c 100644 --- a/modules/sb/fsw/src/cfe_sb_module_all.h +++ b/modules/sb/fsw/src/cfe_sb_module_all.h @@ -19,7 +19,7 @@ */ /** - * @file cfe_sb_module_all.h + * @file * * Encapsulates all SB module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index cb596fe25..e650e6ddb 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_sb_priv.h -** -** Purpose: -** This header file contains prototypes for private functions and type -** definitions for SB internal use. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file contains prototypes for private functions and type + * definitions for SB internal use. + * + * Author: R.McGraw/SSI + * + */ -#ifndef _cfe_sb_priv_ -#define _cfe_sb_priv_ +#ifndef CFE_SB_PRIV_H +#define CFE_SB_PRIV_H /* ** Includes @@ -632,5 +633,4 @@ void CFE_SB_BackgroundFileEventHandler(void *Meta, CFE_FS_FileWriteEvent_t Event extern CFE_SB_Global_t CFE_SB_Global; -#endif /* _cfe_sb_priv_ */ -/*****************************************************************************/ +#endif /* CFE_SB_PRIV_H */ diff --git a/modules/sb/fsw/src/cfe_sb_verify.h b/modules/sb/fsw/src/cfe_sb_verify.h index 395642196..ec67e50e3 100644 --- a/modules/sb/fsw/src/cfe_sb_verify.h +++ b/modules/sb/fsw/src/cfe_sb_verify.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_sb_verify.h -** -** Purpose: -** This header file performs compile time checking for SB configuration -** parameters. -** -** Author: R.McGraw/SSI -** -******************************************************************************/ +/** + * @file + * + * + * Purpose: + * This header file performs compile time checking for SB configuration + * parameters. + * + * Author: R.McGraw/SSI + * + */ -#ifndef _cfe_sb_verify_ -#define _cfe_sb_verify_ +#ifndef CFE_SB_VERIFY_H +#define CFE_SB_VERIFY_H #include @@ -164,5 +165,4 @@ #error CFE_PLATFORM_SB_START_TASK_STACK_SIZE must be greater than or equal to 2048 #endif -#endif /* _cfe_sb_verify_ */ -/*****************************************************************************/ +#endif /* CFE_SB_VERIFY_H */ diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index f7f08f63a..11c9b5000 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: -** sb_UT.h -** -** Purpose: -** SB unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _sb_UT_h_ -#define _sb_UT_h_ +/** + * @file + * + * + * Purpose: + * SB unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef SB_UT_H +#define SB_UT_H /* ** Includes @@ -2421,4 +2422,4 @@ void Test_SB_CCSDSPriHdr_Macros(void); void Test_SB_CCSDSSecHdr_Macros(void); void Test_SB_IdxPushPop(void); -#endif /* _sb_ut_h_ */ +#endif /* SB_UT_H */ diff --git a/modules/sbr/fsw/src/cfe_sbr_priv.h b/modules/sbr/fsw/src/cfe_sbr_priv.h index 429519d28..6f490fd28 100644 --- a/modules/sbr/fsw/src/cfe_sbr_priv.h +++ b/modules/sbr/fsw/src/cfe_sbr_priv.h @@ -18,13 +18,15 @@ ** limitations under the License. */ -/****************************************************************************** +/** + * @file + * * Prototypes for private functions and type definitions for SB * routing internal use. - *****************************************************************************/ + */ -#ifndef CFE_SBR_PRIV_H_ -#define CFE_SBR_PRIV_H_ +#ifndef CFE_SBR_PRIV_H +#define CFE_SBR_PRIV_H /* * Includes @@ -56,4 +58,4 @@ void CFE_SBR_Init_Map(void); */ uint32 CFE_SBR_SetRouteId(CFE_SB_MsgId_t MsgId, CFE_SBR_RouteId_t RouteId); -#endif /* CFE_SBR_PRIV_H_ */ +#endif /* CFE_SBR_PRIV_H */ diff --git a/modules/tbl/fsw/inc/cfe_tbl_events.h b/modules/tbl/fsw/inc/cfe_tbl_events.h index ab5cfba96..4d1d57b1f 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_events.h +++ b/modules/tbl/fsw/inc/cfe_tbl_events.h @@ -18,25 +18,26 @@ ** limitations under the License. */ -/* -** File: cfe_tbl_events.h -** -** Title: Table Services API Event ID Header File -** -** Purpose: -** Identifies event codes for event messages issued by Table Services. -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -** Notes: -** -**/ - -#ifndef _cfe_tbl_events_ -#define _cfe_tbl_events_ +/** + * @file + * + * + * Title: Table Services API Event ID Header File + * + * Purpose: + * Identifies event codes for event messages issued by Table Services. + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + * Notes: + * + */ + +#ifndef CFE_TBL_EVENTS_H +#define CFE_TBL_EVENTS_H /* ************************** ** ****** Maximum EID. ****** @@ -1097,8 +1098,4 @@ /** \} */ -#endif /* _cfe_tbl_events_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TBL_EVENTS_H */ diff --git a/modules/tbl/fsw/inc/cfe_tbl_msg.h b/modules/tbl/fsw/inc/cfe_tbl_msg.h index 5c05d7563..2e688adab 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_msg.h +++ b/modules/tbl/fsw/inc/cfe_tbl_msg.h @@ -18,22 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_tbl_msg.h -** -** Purpose: cFE Table Services (TBL) SB message definitions header file -** -** Author: D.Kobe/Hammers -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Table Services (TBL) SB message definitions header file + * + * Author: D.Kobe/Hammers + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_tbl_msg_ -#define _cfe_tbl_msg_ +#ifndef CFE_TBL_MSG_H +#define CFE_TBL_MSG_H /* ** Required header files... @@ -839,8 +837,4 @@ typedef struct CFE_TBL_TableRegistryTlm CFE_TBL_TblRegPacket_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TBL_TableRegistryTlm_t; -#endif /* _cfe_tbl_msg_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TBL_MSG_H */ diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.h b/modules/tbl/fsw/src/cfe_tbl_internal.h index 371509a96..5532b034a 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.h +++ b/modules/tbl/fsw/src/cfe_tbl_internal.h @@ -18,16 +18,17 @@ ** limitations under the License. */ -/* -** File: cfe_tbl_internal.h -** -** Purpose: cFE Table Services (TBL) utility function interface file -** -** Author: D. Kobe/the Hammers Company, Inc. -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Table Services (TBL) utility function interface file + * + * Author: D. Kobe/the Hammers Company, Inc. + * + * Notes: + * + */ #ifndef CFE_TBL_INTERNAL_H #define CFE_TBL_INTERNAL_H diff --git a/modules/tbl/fsw/src/cfe_tbl_module_all.h b/modules/tbl/fsw/src/cfe_tbl_module_all.h index 8bd7e7c86..fabd385d6 100644 --- a/modules/tbl/fsw/src/cfe_tbl_module_all.h +++ b/modules/tbl/fsw/src/cfe_tbl_module_all.h @@ -19,7 +19,7 @@ */ /** - * @file cfe_tbl_module_all.h + * @file * * Encapsulates all TBL module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. diff --git a/modules/tbl/fsw/src/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h index d86bb1dd0..c8c3f6738 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -18,22 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_tbl_task.h -** -** Purpose: cFE Table Services (TBL) task header file -** -** Author: David Kobe (the Hammers Company, Inc.) -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Table Services (TBL) task header file + * + * Author: David Kobe (the Hammers Company, Inc.) + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_tbl_task_ -#define _cfe_tbl_task_ +#ifndef CFE_TBL_TASK_H +#define CFE_TBL_TASK_H /* ** Required header files @@ -425,8 +423,4 @@ void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); ******************************************************************************/ void CFE_TBL_InitData(void); -#endif /* _cfe_tbl_task_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TBL_TASK_H */ diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h index df2e6a91e..386f69abd 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_tbl_task_cmds.h -** -** Subsystem: cFE TBL Task Command Handler Interface Definition File -** -** Author: David Kobe (the Hammers Company, Inc.) -** -** Notes: -** -*/ +/** + * @file + * + * + * Subsystem: cFE TBL Task Command Handler Interface Definition File + * + * Author: David Kobe (the Hammers Company, Inc.) + * + * Notes: + * + */ -#ifndef _cfe_tbl_task_cmds_ -#define _cfe_tbl_task_cmds_ +#ifndef CFE_TBL_TASK_CMDS_H +#define CFE_TBL_TASK_CMDS_H /* ** Required header files @@ -354,4 +355,4 @@ extern CFE_TBL_CmdProcRet_t CFE_TBL_DumpToFile(const char *DumpFilename, const c ******************************************************************************/ void CFE_TBL_AbortLoad(CFE_TBL_RegistryRec_t *RegRecPtr); -#endif /* _cfe_tbl_task_cmds_ */ +#endif /* CFE_TBL_TASK_CMDS_H */ diff --git a/modules/tbl/fsw/src/cfe_tbl_verify.h b/modules/tbl/fsw/src/cfe_tbl_verify.h index 5cf91134d..d16fe0811 100644 --- a/modules/tbl/fsw/src/cfe_tbl_verify.h +++ b/modules/tbl/fsw/src/cfe_tbl_verify.h @@ -18,19 +18,20 @@ ** limitations under the License. */ -/****************************************************************************** -** File: cfe_tbl_verify.h -** -** File: cfe_tbl_verify.h -** -** Purpose: -** This header file performs compile time checking for TBL configuration -** parameters. -** -******************************************************************************/ +/** + * @file + * + * + * + * Purpose: + * This header file performs compile time checking for TBL configuration + * parameters. + * + */ + +#ifndef CFE_TBL_VERIFY_H +#define CFE_TBL_VERIFY_H -#ifndef _cfe_tbl_verify_ -#define _cfe_tbl_verify_ #include "cfe_platform_cfg.h" #if (2 * CFE_PLATFORM_TBL_MAX_DBL_TABLE_SIZE) > CFE_PLATFORM_TBL_BUF_MEMORY_BYTES @@ -92,5 +93,4 @@ OS_MAX_PATH_LEN #endif #error CFE_MISSION_TBL_MAX_FULL_NAME_LEN must be a multiple of 4 #endif -#endif /* _cfe_tbl_verify_ */ -/*****************************************************************************/ +#endif /* CFE_TBL_VERIFY_H */ diff --git a/modules/tbl/ut-coverage/tbl_UT.h b/modules/tbl/ut-coverage/tbl_UT.h index d5c4fbd1c..531a441f8 100644 --- a/modules/tbl/ut-coverage/tbl_UT.h +++ b/modules/tbl/ut-coverage/tbl_UT.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: -** tbl_UT.h -** -** Purpose: -** TBL unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _tbl_UT_h_ -#define _tbl_UT_h_ +/** + * @file + * + * + * Purpose: + * TBL unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef TBL_UT_H +#define TBL_UT_H /* ** Includes @@ -667,4 +668,4 @@ void Test_CFE_TBL_Internal(void); ******************************************************************************/ int32 Test_CFE_TBL_ValidationFunc(void *TblPtr); -#endif /* _tbl_ut_h_ */ +#endif /* TBL_UT_H */ diff --git a/modules/time/fsw/inc/cfe_time_events.h b/modules/time/fsw/inc/cfe_time_events.h index 20c3c5f20..1e5e46722 100644 --- a/modules/time/fsw/inc/cfe_time_events.h +++ b/modules/time/fsw/inc/cfe_time_events.h @@ -18,21 +18,22 @@ ** limitations under the License. */ -/* -** Filename: cfe_time_events.h -** -** Purpose: -** cFE Time Services (Time) Event IDs -** -** Design Notes: -** -** References: -** Flight Software Branch C Coding Standard Version 1.0a -** -*/ - -#ifndef _cfe_time_events_ -#define _cfe_time_events_ +/** + * @file + * + * + * Purpose: + * cFE Time Services (Time) Event IDs + * + * Design Notes: + * + * References: + * Flight Software Branch C Coding Standard Version 1.0a + * + */ + +#ifndef CFE_TIME_EVENTS_H +#define CFE_TIME_EVENTS_H /* ************************** ** ****** Maximum EID. ****** @@ -619,4 +620,4 @@ **/ #define CFE_TIME_LEN_ERR_EID 49 -#endif /* _cfe_time_events_ */ +#endif /* CFE_TIME_EVENTS_H */ diff --git a/modules/time/fsw/inc/cfe_time_msg.h b/modules/time/fsw/inc/cfe_time_msg.h index 2890c5abe..c5f2194a3 100644 --- a/modules/time/fsw/inc/cfe_time_msg.h +++ b/modules/time/fsw/inc/cfe_time_msg.h @@ -18,22 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_time_msg.h -** -** Purpose: cFE Time Services (TIME) SB message definitions header file -** -** Author: S.Walling/Microtel -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Time Services (TIME) SB message definitions header file + * + * Author: S.Walling/Microtel + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_time_msg_ -#define _cfe_time_msg_ +#ifndef CFE_TIME_MSG_H +#define CFE_TIME_MSG_H /* ** Required header files... @@ -1126,8 +1124,4 @@ typedef struct CFE_TIME_DiagnosticTlm CFE_TIME_DiagnosticTlm_Payload_t Payload; /**< \brief Telemetry payload */ } CFE_TIME_DiagnosticTlm_t; -#endif /* _cfe_time_msg_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TIME_MSG_H */ diff --git a/modules/time/fsw/src/cfe_time_module_all.h b/modules/time/fsw/src/cfe_time_module_all.h index c7aab6da7..3fcf23d66 100644 --- a/modules/time/fsw/src/cfe_time_module_all.h +++ b/modules/time/fsw/src/cfe_time_module_all.h @@ -19,7 +19,7 @@ */ /** - * @file cfe_time_module_all.h + * @file * * Encapsulates all TIME module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. diff --git a/modules/time/fsw/src/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h index 1d991b9d6..7f5f0f44c 100644 --- a/modules/time/fsw/src/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -18,22 +18,20 @@ ** limitations under the License. */ -/* -** File: cfe_time_utils.h -** -** Purpose: cFE Time Services (TIME) library utilities header file -** -** Author: S.Walling/Microtel -** -** Notes: -** -*/ +/** + * @file + * + * + * Purpose: cFE Time Services (TIME) library utilities header file + * + * Author: S.Walling/Microtel + * + * Notes: + * + */ -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_time_utils_ -#define _cfe_time_utils_ +#ifndef CFE_TIME_UTILS_H +#define CFE_TIME_UTILS_H /* ** Required header files... @@ -451,8 +449,4 @@ void CFE_TIME_Local1HzTask(void); void CFE_TIME_Local1HzStateMachine(void); void CFE_TIME_Local1HzTimerCallback(osal_id_t TimerId, void *Arg); -#endif /* _cfe_time_utils_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TIME_UTILS_H */ diff --git a/modules/time/fsw/src/cfe_time_verify.h b/modules/time/fsw/src/cfe_time_verify.h index e58bbe8c0..36c8b4c15 100644 --- a/modules/time/fsw/src/cfe_time_verify.h +++ b/modules/time/fsw/src/cfe_time_verify.h @@ -18,23 +18,21 @@ ** limitations under the License. */ -/* -** File: cfe_time_verify.h -** -** Purpose: cFE Time Services (TIME) configuration verification -** -** Author: S.Walling/Microtel -** -** Notes: -** -** -*/ - -/* -** Ensure that header is included only once... -*/ -#ifndef _cfe_time_verify_ -#define _cfe_time_verify_ +/** + * @file + * + * + * Purpose: cFE Time Services (TIME) configuration verification + * + * Author: S.Walling/Microtel + * + * Notes: + * + * + */ + +#ifndef CFE_TIME_VERIFY_H +#define CFE_TIME_VERIFY_H #include "cfe_mission_cfg.h" #include "cfe_platform_cfg.h" @@ -188,8 +186,4 @@ /*************************************************************************/ -#endif /* _cfe_time_verify_ */ - -/************************/ -/* End of File Comment */ -/************************/ +#endif /* CFE_TIME_VERIFY_H */ diff --git a/modules/time/ut-coverage/time_UT.h b/modules/time/ut-coverage/time_UT.h index 279feffe7..25787d079 100644 --- a/modules/time/ut-coverage/time_UT.h +++ b/modules/time/ut-coverage/time_UT.h @@ -18,24 +18,25 @@ ** limitations under the License. */ -/* -** File: -** time_UT.h -** -** Purpose: -** TIME unit test header -** -** References: -** 1. cFE Application Developers Guide -** 2. unit test standard 092503 -** 3. C Coding Standard 102904 -** -** Notes: -** 1. This is unit test code only, not for use in flight -** -*/ -#ifndef _time_UT_h_ -#define _time_UT_h_ +/** + * @file + * + * + * Purpose: + * TIME unit test header + * + * References: + * 1. cFE Application Developers Guide + * 2. unit test standard 092503 + * 3. C Coding Standard 102904 + * + * Notes: + * 1. This is unit test code only, not for use in flight + * + */ + +#ifndef TIME_UT_H +#define TIME_UT_H /* ** Includes @@ -351,4 +352,4 @@ void Test_UnregisterSynchCallback(void); ******************************************************************************/ void Test_CleanUpApp(void); -#endif /* _time_ut_h_ */ +#endif /* TIME_UT_H */ From 0905f87e2cee23ee894a4e90d79abfbe2479b64e Mon Sep 17 00:00:00 2001 From: Jacob Hageman Date: Wed, 24 Mar 2021 15:24:36 -0400 Subject: [PATCH 19/27] Fix #1261, Remove redundant checks in CFE_EVS_EarlyInit --- modules/evs/fsw/src/cfe_evs_task.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/modules/evs/fsw/src/cfe_evs_task.c b/modules/evs/fsw/src/cfe_evs_task.c index e225fc0e7..39e5dc34a 100644 --- a/modules/evs/fsw/src/cfe_evs_task.c +++ b/modules/evs/fsw/src/cfe_evs_task.c @@ -110,11 +110,6 @@ int32 CFE_EVS_EarlyInit(void) CFE_PSP_Panic(CFE_PSP_PANIC_MEMORY_ALLOC); } else - { - Status = CFE_SUCCESS; - } - - if (Status == CFE_SUCCESS) { CFE_EVS_ResetDataPtr = (CFE_ES_ResetData_t *)resetAreaAddr; /* Save pointer to the EVS portion of the CFE reset area */ @@ -134,12 +129,9 @@ int32 CFE_EVS_EarlyInit(void) } else { + /* Convert to CFE success type */ Status = CFE_SUCCESS; } - } - - if (Status == CFE_SUCCESS) - { /* Report log as enabled */ CFE_EVS_Global.EVS_TlmPkt.Payload.LogEnabled = true; From 0780d12fea2bd42203c7c7bc66fc30d656d8ae0e Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 24 Mar 2021 16:53:14 -0400 Subject: [PATCH 20/27] Fix #1239, apply "uniq" filer to files This removes cases where extra blank lines in comments were present. This affects both the newly added blocks as well as some existing cases where extra blank lines were inside block comments. --- cmake/sample_defs/cpu1_msgids.h | 1 - cmake/sample_defs/cpu1_platform_cfg.h | 1 - cmake/sample_defs/sample_mission_cfg.h | 5 ---- cmake/sample_defs/sample_perfids.h | 1 - modules/cfe_assert/inc/cfe_assert.h | 1 - modules/cfe_testrunner/inc/cfe_testrunner.h | 1 - modules/core_api/fsw/inc/cfe.h | 1 - modules/core_api/fsw/inc/cfe_endian.h | 1 - modules/core_api/fsw/inc/cfe_error.h | 2 -- modules/core_api/fsw/inc/cfe_es.h | 23 ------------------- .../core_api/fsw/inc/cfe_es_api_typedefs.h | 1 - .../core_api/fsw/inc/cfe_es_core_internal.h | 3 --- .../core_api/fsw/inc/cfe_es_extern_typedefs.h | 7 ------ modules/core_api/fsw/inc/cfe_evs.h | 1 - .../core_api/fsw/inc/cfe_evs_api_typedefs.h | 1 - .../core_api/fsw/inc/cfe_evs_core_internal.h | 2 -- .../fsw/inc/cfe_evs_extern_typedefs.h | 5 ---- modules/core_api/fsw/inc/cfe_fs.h | 2 -- .../core_api/fsw/inc/cfe_fs_api_typedefs.h | 1 - .../core_api/fsw/inc/cfe_fs_core_internal.h | 1 - .../core_api/fsw/inc/cfe_fs_extern_typedefs.h | 15 ------------ modules/core_api/fsw/inc/cfe_resourceid.h | 1 - modules/core_api/fsw/inc/cfe_sb.h | 1 - .../core_api/fsw/inc/cfe_sb_api_typedefs.h | 1 - .../core_api/fsw/inc/cfe_sb_core_internal.h | 2 -- .../core_api/fsw/inc/cfe_sb_extern_typedefs.h | 2 -- modules/core_api/fsw/inc/cfe_tbl.h | 1 - .../core_api/fsw/inc/cfe_tbl_api_typedefs.h | 1 - .../core_api/fsw/inc/cfe_tbl_core_internal.h | 2 -- .../fsw/inc/cfe_tbl_extern_typedefs.h | 1 - modules/core_api/fsw/inc/cfe_tbl_filedef.h | 1 - modules/core_api/fsw/inc/cfe_time.h | 2 -- .../core_api/fsw/inc/cfe_time_api_typedefs.h | 1 - .../core_api/fsw/inc/cfe_time_core_internal.h | 2 -- .../fsw/inc/cfe_time_extern_typedefs.h | 7 ------ .../ut-stubs/inc/ut_osprintf_stubs.h | 1 - .../core_private/ut-stubs/inc/ut_support.h | 1 - modules/es/fsw/inc/cfe_es_events.h | 2 -- modules/es/fsw/inc/cfe_es_msg.h | 1 - modules/es/fsw/src/cfe_es_cds.h | 4 ---- modules/es/fsw/src/cfe_es_cds_mempool.h | 1 - modules/es/fsw/src/cfe_es_generic_pool.h | 1 - modules/es/fsw/src/cfe_es_global.h | 1 - modules/es/fsw/src/cfe_es_log.h | 1 - modules/es/fsw/src/cfe_es_mempool.h | 1 - modules/es/fsw/src/cfe_es_module_all.h | 1 - modules/es/fsw/src/cfe_es_perf.h | 1 - modules/es/fsw/src/cfe_es_resource.h | 1 - modules/es/fsw/src/cfe_es_task.h | 1 - modules/es/fsw/src/cfe_es_verify.h | 2 -- modules/evs/fsw/inc/cfe_evs_events.h | 1 - modules/evs/fsw/inc/cfe_evs_msg.h | 4 ---- modules/evs/fsw/src/cfe_evs_task.h | 1 - modules/evs/fsw/src/cfe_evs_utils.h | 1 - modules/evs/fsw/src/cfe_evs_verify.h | 2 -- modules/evs/ut-coverage/evs_UT.h | 1 - modules/fs/fsw/src/cfe_fs_priv.h | 2 -- modules/fs/ut-coverage/fs_UT.h | 1 - modules/sb/fsw/inc/cfe_sb_events.h | 1 - modules/sb/fsw/inc/cfe_sb_msg.h | 1 - modules/sb/fsw/src/cfe_sb_priv.h | 1 - modules/sb/fsw/src/cfe_sb_verify.h | 1 - modules/sb/ut-coverage/sb_UT.h | 1 - modules/tbl/fsw/inc/cfe_tbl_events.h | 1 - modules/tbl/fsw/inc/cfe_tbl_msg.h | 1 - modules/tbl/fsw/src/cfe_tbl_internal.h | 13 ----------- modules/tbl/fsw/src/cfe_tbl_task.h | 3 --- modules/tbl/fsw/src/cfe_tbl_task_cmds.h | 3 --- modules/tbl/fsw/src/cfe_tbl_verify.h | 2 -- modules/tbl/ut-coverage/tbl_UT.h | 1 - modules/time/fsw/inc/cfe_time_events.h | 1 - modules/time/fsw/inc/cfe_time_msg.h | 1 - modules/time/fsw/src/cfe_time_utils.h | 1 - modules/time/fsw/src/cfe_time_verify.h | 2 -- modules/time/ut-coverage/time_UT.h | 1 - 75 files changed, 169 deletions(-) diff --git a/cmake/sample_defs/cpu1_msgids.h b/cmake/sample_defs/cpu1_msgids.h index 8cb4c8748..0da698f15 100644 --- a/cmake/sample_defs/cpu1_msgids.h +++ b/cmake/sample_defs/cpu1_msgids.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains the Message Id's for messages used by the * cFE core. diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h index 9493558bf..ee4c5d478 100644 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ b/cmake/sample_defs/cpu1_platform_cfg.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains the platform configuration parameters. * diff --git a/cmake/sample_defs/sample_mission_cfg.h b/cmake/sample_defs/sample_mission_cfg.h index a79b8cc75..319587389 100644 --- a/cmake/sample_defs/sample_mission_cfg.h +++ b/cmake/sample_defs/sample_mission_cfg.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains the mission configuration parameters and * typedefs with mission scope. @@ -66,7 +65,6 @@ ** format. This avoids having to modify each individual caller ** when the default choice is changed. ** -** ** \par Limits ** if CFE_MISSION_TIME_CFG_DEFAULT_TAI is defined as true then CFE_MISSION_TIME_CFG_DEFAULT_UTC must be ** defined as false. @@ -83,7 +81,6 @@ ** The following definition enables the use of a simulated time at ** the tone signal using a software bus message. ** -** ** \par Limits ** Not Applicable */ @@ -132,7 +129,6 @@ ** ** Note: units are in micro-seconds ** -** ** \par Limits ** 0 to 999,999 decimal */ @@ -422,7 +418,6 @@ ** anticipated to be reasonably small (i.e. tens, not hundreds). Large ** values have not been tested. ** -** */ #define CFE_MISSION_ES_POOL_MAX_BUCKETS 17 diff --git a/cmake/sample_defs/sample_perfids.h b/cmake/sample_defs/sample_perfids.h index 75c2e4011..f5e2d8427 100644 --- a/cmake/sample_defs/sample_perfids.h +++ b/cmake/sample_defs/sample_perfids.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: This file contains the cFE performance IDs * * Design Notes: diff --git a/modules/cfe_assert/inc/cfe_assert.h b/modules/cfe_assert/inc/cfe_assert.h index ce01e0480..c2cca7d7d 100644 --- a/modules/cfe_assert/inc/cfe_assert.h +++ b/modules/cfe_assert/inc/cfe_assert.h @@ -59,7 +59,6 @@ ** ** \return Execution status, see \ref CFEReturnCodes ** -** *************************************************************************/ void CFE_Assert_AppMain(void); diff --git a/modules/cfe_testrunner/inc/cfe_testrunner.h b/modules/cfe_testrunner/inc/cfe_testrunner.h index c766db082..daa651354 100644 --- a/modules/cfe_testrunner/inc/cfe_testrunner.h +++ b/modules/cfe_testrunner/inc/cfe_testrunner.h @@ -59,7 +59,6 @@ ** ** \return Execution status, see \ref CFEReturnCodes ** -** *************************************************************************/ void CFE_TestRunner_AppMain(void); diff --git a/modules/core_api/fsw/inc/cfe.h b/modules/core_api/fsw/inc/cfe.h index 2e04037f0..218afd9cb 100644 --- a/modules/core_api/fsw/inc/cfe.h +++ b/modules/core_api/fsw/inc/cfe.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE header file * * Author: David Kobe, the Hammers Company, Inc. diff --git a/modules/core_api/fsw/inc/cfe_endian.h b/modules/core_api/fsw/inc/cfe_endian.h index 25d013ca3..16f578631 100644 --- a/modules/core_api/fsw/inc/cfe_endian.h +++ b/modules/core_api/fsw/inc/cfe_endian.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * Define macros to enforce big-endian/network byte order for 16 and 32 bit integers * diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 9a6137761..510f6f9e6 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: cFE Status Code Definition Header File * * Purpose: @@ -75,7 +74,6 @@ typedef int32 CFE_Status_t; ** 110 - Tables Services ** 111 - Time Services ** -** ** Mission Defined - These bits are available for Mission ** specific coding standards. They can ** be used to classify error codes related diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 5555f279e..104f9617e 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * Unit specification for Executive Services library functions and macros. * @@ -341,7 +340,6 @@ CFE_Status_t CFE_ES_DeleteApp(CFE_ES_AppId_t AppID); ** \arg #CFE_ES_RunStatus_CORE_APP_INIT_ERROR - \copybrief CFE_ES_RunStatus_CORE_APP_INIT_ERROR ** \arg #CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR - \copybrief CFE_ES_RunStatus_CORE_APP_RUNTIME_ERROR ** -** ** \sa #CFE_ES_RunLoop, #CFE_ES_RegisterApp ** ******************************************************************************/ @@ -431,7 +429,6 @@ CFE_Status_t CFE_ES_WaitForSystemState(uint32 MinSystemState, uint32 TimeOutMill ** wait indefinitely to avoid hanging a critical ** application because a non-critical app did not start. ** -** ** \sa #CFE_ES_RunLoop ** ******************************************************************************/ @@ -498,7 +495,6 @@ void CFE_ES_IncrementTaskCounter(void); ** stored at the given address. For a list of possible Sub-Type values, see \link ** #CFE_PSP_RST_SUBTYPE_POWER_CYCLE "Reset Sub-Types" \endlink. ** -** ** \return Processor reset type ** \retval #CFE_PSP_RST_TYPE_POWERON \copybrief CFE_PSP_RST_TYPE_POWERON ** \retval #CFE_PSP_RST_TYPE_PROCESSOR \copybrief CFE_PSP_RST_TYPE_PROCESSOR @@ -521,7 +517,6 @@ int32 CFE_ES_GetResetType(uint32 *ResetSubtypePtr); ** \param[out] AppIdPtr Pointer to variable that is to receive the Application's ID. ** *AppIdPtr will be set to the application ID of the calling Application. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -569,7 +564,6 @@ CFE_Status_t CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr); ** \param[out] AppIdPtr Pointer to variable that is to receive the Application's ID. ** \param[in] AppName Pointer to null terminated character string containing an Application name. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND @@ -594,7 +588,6 @@ CFE_Status_t CFE_ES_GetAppIDByName(CFE_ES_AppId_t *AppIdPtr, const char *AppName ** \param[out] LibIdPtr Pointer to variable that is to receive the Library's ID. ** \param[in] LibName Pointer to null terminated character string containing a Library name. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND @@ -625,7 +618,6 @@ CFE_Status_t CFE_ES_GetLibIDByName(CFE_ES_LibId_t *LibIdPtr, const char *LibName ** into the \c AppName buffer. This routine will truncate the name to this length, ** if necessary. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -655,7 +647,6 @@ CFE_Status_t CFE_ES_GetAppName(char *AppName, CFE_ES_AppId_t AppId, size_t Buffe ** into the \c LibName buffer. This routine will truncate the name to this length, ** if necessary. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -681,7 +672,6 @@ CFE_Status_t CFE_ES_GetLibName(char *LibName, CFE_ES_LibId_t LibId, size_t Buffe ** resource name and memory addresses information. ** \param[in] AppId ID of application to obtain information about ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -710,7 +700,6 @@ CFE_Status_t CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId); ** ** \param[in] TaskId Application ID of Application whose name is being requested. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -743,7 +732,6 @@ CFE_Status_t CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t Tas ** resource name and memory addresses information. ** \param[in] LibId ID of application to obtain information about ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -769,7 +757,6 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId); ** easily ported to operate on either Libraries or Applications, where ** relevant. ** -** ** \par Assumptions, External Events, and Notes: ** None ** @@ -777,7 +764,6 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId); ** resource name and memory addresses information. ** \param[in] ResourceId ID of application or library to obtain information about ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -872,7 +858,6 @@ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *Task ** \param[out] TaskIdPtr Pointer to variable that is to receive the Task's ID. ** \param[in] TaskName Pointer to null terminated character string containing an Task name. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND @@ -903,7 +888,6 @@ CFE_Status_t CFE_ES_GetTaskIDByName(CFE_ES_TaskId_t *TaskIdPtr, const char *Task ** into the \c TaskName buffer. This routine will truncate the name to this length, ** if necessary. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -976,7 +960,6 @@ void CFE_ES_ExitChildTask(void); ** early will not cause the background task to do more work than it otherwise ** would - it just reduces the delay before work starts initially. ** -** ******************************************************************************/ void CFE_ES_BackgroundWakeup(void); @@ -1051,7 +1034,6 @@ uint32 CFE_ES_CalculateCRC(const void *DataPtr, size_t DataLength, uint32 InputC ** context which may use OSAL primitives. In general this means that ** it shouldn't be _directly_ invoked from an ISR/signal context. ** -** ******************************************************************************/ void CFE_ES_ProcessAsyncEvent(void); @@ -1081,7 +1063,6 @@ void CFE_ES_ProcessAsyncEvent(void); ** \param[in] Name A pointer to a character string containing an application ** unique name of #CFE_MISSION_ES_CDS_MAX_NAME_LENGTH characters or less. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS The memory block was successfully created in the CDS. ** \retval #CFE_ES_NOT_IMPLEMENTED The processor does not support a Critical Data Store. @@ -1109,7 +1090,6 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *HandlePtr, size_t BlockSize, ** \param[out] BlockIdPtr Pointer to variable that is to receive the CDS Block ID. ** \param[in] BlockName Pointer to null terminated character string containing a CDS Block name. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND @@ -1140,7 +1120,6 @@ CFE_Status_t CFE_ES_GetCDSBlockIDByName(CFE_ES_CDSHandle_t *BlockIdPtr, const ch ** into the \c BlockName buffer. This routine will truncate the name to this length, ** if necessary. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -1428,7 +1407,6 @@ int32 CFE_ES_PutPoolBuf(CFE_ES_MemHandle_t PoolID, CFE_ES_MemPoolBuf_t BufPtr); ** ** \param[in] Handle The handle to the memory pool whose statistics are desired. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID @@ -1665,7 +1643,6 @@ CFE_Status_t CFE_ES_GetGenCounterIDByName(CFE_ES_CounterId_t *CounterIdPtr, cons ** into the \c CounterName buffer. This routine will truncate the name to this length, ** if necessary. ** -** ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID diff --git a/modules/core_api/fsw/inc/cfe_es_api_typedefs.h b/modules/core_api/fsw/inc/cfe_es_api_typedefs.h index de8b80723..d8edef745 100644 --- a/modules/core_api/fsw/inc/cfe_es_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_api_typedefs.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * Unit specification for Executive Services library functions and macros. * diff --git a/modules/core_api/fsw/inc/cfe_es_core_internal.h b/modules/core_api/fsw/inc/cfe_es_core_internal.h index 22bdf1a01..e9e38a4b3 100644 --- a/modules/core_api/fsw/inc/cfe_es_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_es_core_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * Unit specification for Executive Services library functions and macros. * @@ -59,7 +58,6 @@ ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ extern void CFE_ES_TaskMain(void); @@ -101,7 +99,6 @@ extern int32 CFE_ES_CDS_EarlyInit(void); ** ** \param[in] CriticalTbl Indicates whether the CDS is to be used as a Critical Table or not ** -** ** \return See return codes for #CFE_ES_RegisterCDS ** ******************************************************************************/ diff --git a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h index 348900fc5..b0c70194b 100644 --- a/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_es_extern_typedefs.h @@ -61,7 +61,6 @@ enum CFE_ES_LogMode /** * @brief Identifies handling of log messages after storage is filled * - * * @sa enum CFE_ES_LogMode */ typedef uint8 CFE_ES_LogMode_Enum_t; @@ -86,7 +85,6 @@ enum CFE_ES_ExceptionAction /** * @brief Identifies action to take if exception occurs * - * * @sa enum CFE_ES_ExceptionAction */ typedef uint8 CFE_ES_ExceptionAction_Enum_t; @@ -116,7 +114,6 @@ enum CFE_ES_AppType /** * @brief Identifies type of CFE application * - * * @sa enum CFE_ES_AppType */ typedef uint8 CFE_ES_AppType_Enum_t; @@ -186,7 +183,6 @@ enum CFE_ES_RunStatus /** * @brief Run Status and Exit Status identifiers * - * * @sa enum CFE_ES_RunStatus */ typedef uint32 CFE_ES_RunStatus_Enum_t; @@ -241,7 +237,6 @@ enum CFE_ES_SystemState /** * @brief The overall cFE System State * - * * These values are used with the #CFE_ES_WaitForSystemState API call to synchronize application startup. * * @note These are defined in order so that relational comparisons e.g. if (STATEA < STATEB) are possible @@ -270,7 +265,6 @@ enum CFE_ES_LogEntryType /** * @brief Type of entry in the Error and Reset (ER) Log * - * * @sa enum CFE_ES_LogEntryType */ typedef uint8 CFE_ES_LogEntryType_Enum_t; @@ -320,7 +314,6 @@ enum CFE_ES_AppState /** * @brief Application Run State * - * * The normal progression of APP states: * UNDEFINED -> EARLY_INIT -> LATE_INIT -> RUNNING -> WAITING -> STOPPED * diff --git a/modules/core_api/fsw/inc/cfe_evs.h b/modules/core_api/fsw/inc/cfe_evs.h index 68b7412fd..b6c8f6b1b 100644 --- a/modules/core_api/fsw/inc/cfe_evs.h +++ b/modules/core_api/fsw/inc/cfe_evs.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Event Services API Application Library Header File * * Purpose: diff --git a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h index d53aeffac..eb787cdf2 100644 --- a/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_evs_api_typedefs.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Event Services API Application Library Header File * * Purpose: diff --git a/modules/core_api/fsw/inc/cfe_evs_core_internal.h b/modules/core_api/fsw/inc/cfe_evs_core_internal.h index d28d0b07f..694833da3 100644 --- a/modules/core_api/fsw/inc/cfe_evs_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_evs_core_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Event Services API Application Library Header File * * Purpose: @@ -59,7 +58,6 @@ ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ extern void CFE_EVS_TaskMain(void); diff --git a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h index 326cbb0c3..6259b5b37 100644 --- a/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_evs_extern_typedefs.h @@ -59,7 +59,6 @@ enum CFE_EVS_MsgFormat /** * @brief Identifies format of log messages * - * * @sa enum CFE_EVS_MsgFormat */ typedef uint8 CFE_EVS_MsgFormat_Enum_t; @@ -84,7 +83,6 @@ enum CFE_EVS_LogMode /** * @brief Identifies handling of log messages after storage is filled * - * * @sa enum CFE_EVS_LogMode */ typedef uint8 CFE_EVS_LogMode_Enum_t; @@ -119,7 +117,6 @@ enum CFE_EVS_EventType /** * @brief Identifies type of event message * - * * @sa enum CFE_EVS_EventType */ typedef uint16 CFE_EVS_EventType_Enum_t; @@ -139,7 +136,6 @@ enum CFE_EVS_EventFilter /** * @brief Identifies event filter schemes * - * * @sa enum CFE_EVS_EventFilter */ typedef uint8 CFE_EVS_EventFilter_Enum_t; @@ -174,7 +170,6 @@ enum CFE_EVS_EventOutput /** * @brief Identifies event output port * - * * @sa enum CFE_EVS_EventOutput */ typedef uint8 CFE_EVS_EventOutput_Enum_t; diff --git a/modules/core_api/fsw/inc/cfe_fs.h b/modules/core_api/fsw/inc/cfe_fs.h index 36acb9a19..6bca3f5c4 100644 --- a/modules/core_api/fsw/inc/cfe_fs.h +++ b/modules/core_api/fsw/inc/cfe_fs.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE File Services (FS) library API header file * * Author: S.Walling/Microtel @@ -112,7 +111,6 @@ void CFE_FS_InitHeader(CFE_FS_Header_t *Hdr, const char *Description, uint32 Sub ** -# \link #CFE_FS_Header_t::TimeSubSeconds \c TimeSubSeconds \endlink - Filled with the Time, subseconds, as ** obtained by #CFE_TIME_GetTime ** -** ** \par Assumptions, External Events, and Notes: ** -# The File has already been successfully opened using #OS_OpenCreate and ** the caller has a legitimate File Descriptor. diff --git a/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h index 2726afd32..0e7a80594 100644 --- a/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_fs_api_typedefs.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE File Services (FS) library API header file * * Author: S.Walling/Microtel diff --git a/modules/core_api/fsw/inc/cfe_fs_core_internal.h b/modules/core_api/fsw/inc/cfe_fs_core_internal.h index 3ca9e5afd..ee1f8768d 100644 --- a/modules/core_api/fsw/inc/cfe_fs_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_fs_core_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE File Services (FS) library API header file * * Author: S.Walling/Microtel diff --git a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h index 02ff09c63..d1780b544 100644 --- a/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_fs_extern_typedefs.h @@ -61,7 +61,6 @@ enum CFE_FS_SubType /** * @brief Executive Services Exception/Reset Log Type * - * * Executive Services Exception/Reset Log File which is generated in response to a * \link #CFE_ES_WRITE_ER_LOG_CC \ES_WRITEERLOG2FILE \endlink * command. @@ -72,7 +71,6 @@ enum CFE_FS_SubType /** * @brief Executive Services System Log Type * - * * Executive Services System Log File which is generated in response to a * \link #CFE_ES_WRITE_SYSLOG_CC \ES_WRITESYSLOG2FILE \endlink * command. @@ -83,7 +81,6 @@ enum CFE_FS_SubType /** * @brief Executive Services Information on All Applications File * - * * Executive Services Information on All Applications File which is generated in response to a * \link #CFE_ES_QUERY_ALL_CC \ES_WRITEAPPINFO2FILE \endlink * command. @@ -94,7 +91,6 @@ enum CFE_FS_SubType /** * @brief Executive Services Performance Data File * - * * Executive Services Performance Analyzer Data File which is generated in response to a * \link #CFE_ES_STOP_PERF_DATA_CC \ES_STOPLADATA \endlink * command. @@ -105,7 +101,6 @@ enum CFE_FS_SubType /** * @brief Executive Services Shell Response File * - * * Executive Services Shell Response Data File which is generated in response to a * shell command. * @@ -115,7 +110,6 @@ enum CFE_FS_SubType /** * @brief Executive Services Critical Data Store Registry Dump File * - * * Executive Services Critical Data Store Registry Dump File which is generated in response to a * \link #CFE_ES_DUMP_CDS_REGISTRY_CC \ES_DUMPCDSREG \endlink * command. @@ -126,7 +120,6 @@ enum CFE_FS_SubType /** * @brief Table Services Registry Dump File * - * * Table Services Registry Dump File which is generated in response to a * \link #CFE_TBL_DUMP_REGISTRY_CC \TBL_WRITEREG2FILE \endlink * command. @@ -137,7 +130,6 @@ enum CFE_FS_SubType /** * @brief Table Services Table Image File * - * * Table Services Table Image File which is generated either on the ground or in response to a * \link #CFE_TBL_DUMP_CC \TBL_DUMP \endlink command. * @@ -147,7 +139,6 @@ enum CFE_FS_SubType /** * @brief Event Services Application Data Dump File * - * * Event Services Application Data Dump File which is generated in response to a * \link #CFE_EVS_WRITE_APP_DATA_FILE_CC \EVS_WRITEAPPDATA2FILE \endlink * command. @@ -158,7 +149,6 @@ enum CFE_FS_SubType /** * @brief Event Services Local Event Log Dump File * - * * Event Services Local Event Log Dump File which is generated in response to a * \link #CFE_EVS_WRITE_LOG_DATA_FILE_CC \EVS_WRITELOG2FILE \endlink * command. @@ -169,7 +159,6 @@ enum CFE_FS_SubType /** * @brief Software Bus Pipe Data Dump File * - * * Software Bus Pipe Data Dump File which is generated in response to a * \link #CFE_SB_WRITE_PIPE_INFO_CC \SB_WRITEPIPE2FILE \endlink * command. @@ -180,7 +169,6 @@ enum CFE_FS_SubType /** * @brief Software Bus Message Routing Data Dump File * - * * Software Bus Message Routing Data Dump File which is generated in response to a * \link #CFE_SB_WRITE_ROUTING_INFO_CC \SB_WRITEROUTING2FILE \endlink * command. @@ -191,7 +179,6 @@ enum CFE_FS_SubType /** * @brief Software Bus Message Mapping Data Dump File * - * * Software Bus Message Mapping Data Dump File which is generated in response to a * \link #CFE_SB_WRITE_MAP_INFO_CC \SB_WRITEMAP2FILE \endlink * command. @@ -202,7 +189,6 @@ enum CFE_FS_SubType /** * @brief Executive Services Query All Tasks Data File * - * * Executive Services Query All Tasks Data File which is generated in response to a * \link #CFE_ES_QUERY_ALL_TASKS_CC \ES_WRITETASKINFO2FILE \endlink * command. @@ -214,7 +200,6 @@ enum CFE_FS_SubType /** * @brief Content descriptor for File Headers * - * * @sa enum CFE_FS_SubType */ typedef uint32 CFE_FS_SubType_Enum_t; diff --git a/modules/core_api/fsw/inc/cfe_resourceid.h b/modules/core_api/fsw/inc/cfe_resourceid.h index 2b3e48e01..428db8b68 100644 --- a/modules/core_api/fsw/inc/cfe_resourceid.h +++ b/modules/core_api/fsw/inc/cfe_resourceid.h @@ -21,7 +21,6 @@ /** * @file * - * * Contains global prototypes and definitions related to resource * management and related CFE resource IDs. * diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index 2eab32615..506f9437d 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains all definitions for the cFE Software Bus * Application Programmer's Interface. diff --git a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h index b21ed499f..37d288b62 100644 --- a/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_api_typedefs.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains all definitions for the cFE Software Bus * Application Programmer's Interface. diff --git a/modules/core_api/fsw/inc/cfe_sb_core_internal.h b/modules/core_api/fsw/inc/cfe_sb_core_internal.h index 701baaa20..25ee96929 100644 --- a/modules/core_api/fsw/inc/cfe_sb_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_sb_core_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains all definitions for the cFE Software Bus * Application Programmer's Interface. @@ -56,7 +55,6 @@ ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ extern void CFE_SB_TaskMain(void); diff --git a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h index 2413f6914..ae115a7ca 100644 --- a/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_sb_extern_typedefs.h @@ -63,7 +63,6 @@ enum CFE_SB_QosPriority /** * @brief Selects the priorty level for message routing * - * * @sa enum CFE_SB_QosPriority */ typedef uint8 CFE_SB_QosPriority_Enum_t; @@ -88,7 +87,6 @@ enum CFE_SB_QosReliability /** * @brief Selects the reliability level for message routing * - * * @sa enum CFE_SB_QosReliability */ typedef uint8 CFE_SB_QosReliability_Enum_t; diff --git a/modules/core_api/fsw/inc/cfe_tbl.h b/modules/core_api/fsw/inc/cfe_tbl.h index a0f945433..8fa42f9c3 100644 --- a/modules/core_api/fsw/inc/cfe_tbl.h +++ b/modules/core_api/fsw/inc/cfe_tbl.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Table Services API Application Library Header File * * Purpose: diff --git a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h index 39e44351b..39931bdac 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_api_typedefs.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Table Services API Application Library Header File * * Purpose: diff --git a/modules/core_api/fsw/inc/cfe_tbl_core_internal.h b/modules/core_api/fsw/inc/cfe_tbl_core_internal.h index 4692abae9..b298b2054 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_tbl_core_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Table Services API Application Library Header File * * Purpose: @@ -64,7 +63,6 @@ ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ extern void CFE_TBL_TaskMain(void); diff --git a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h index 416c0cfe5..08182786e 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_tbl_extern_typedefs.h @@ -61,7 +61,6 @@ enum CFE_TBL_BufferSelect /** * @brief Selects the buffer to operate on for validate or dump commands * - * * @sa enum CFE_TBL_BufferSelect */ typedef uint16 CFE_TBL_BufferSelect_Enum_t; diff --git a/modules/core_api/fsw/inc/cfe_tbl_filedef.h b/modules/core_api/fsw/inc/cfe_tbl_filedef.h index e0933246e..e50a91827 100644 --- a/modules/core_api/fsw/inc/cfe_tbl_filedef.h +++ b/modules/core_api/fsw/inc/cfe_tbl_filedef.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: ELF2CFETBL Utility Header File for Table Images * * Purpose: diff --git a/modules/core_api/fsw/inc/cfe_time.h b/modules/core_api/fsw/inc/cfe_time.h index 5d315ce50..1ca214ba3 100644 --- a/modules/core_api/fsw/inc/cfe_time.h +++ b/modules/core_api/fsw/inc/cfe_time.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Time Services (TIME) library API header file * * Author: S.Walling/Microtel @@ -716,7 +715,6 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint); ** This will update the global data structures accordingly, incrementing each ** by the 1Hz amount. ** -** ******************************************************************************/ void CFE_TIME_Local1HzISR(void); /**@}*/ diff --git a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h index 8ee72396c..6c3dd9f4f 100644 --- a/modules/core_api/fsw/inc/cfe_time_api_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_time_api_typedefs.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Time Services (TIME) library API header file * * Author: S.Walling/Microtel diff --git a/modules/core_api/fsw/inc/cfe_time_core_internal.h b/modules/core_api/fsw/inc/cfe_time_core_internal.h index 752d25cd1..0c0fc5839 100644 --- a/modules/core_api/fsw/inc/cfe_time_core_internal.h +++ b/modules/core_api/fsw/inc/cfe_time_core_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Time Services (TIME) library API header file * * Author: S.Walling/Microtel @@ -56,7 +55,6 @@ ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ extern void CFE_TIME_TaskMain(void); diff --git a/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h b/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h index b04b6ebc1..7a2aeb126 100644 --- a/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h +++ b/modules/core_api/fsw/inc/cfe_time_extern_typedefs.h @@ -121,7 +121,6 @@ enum CFE_TIME_FlagBit /** * @brief Bit positions of the various clock state flags * - * * @sa enum CFE_TIME_FlagBit */ typedef uint8 CFE_TIME_FlagBit_Enum_t; @@ -164,7 +163,6 @@ enum CFE_TIME_ClockState /** * @brief Enumerated types identifying the quality of the current time * - * * \par Description * The #CFE_TIME_ClockState_Enum_t enumerations identify the three recognized states of the current time. * If the clock has never been successfully synchronized with the primary onboard clock source, the @@ -200,7 +198,6 @@ enum CFE_TIME_SourceSelect /** * @brief Clock Source Selection Parameters * - * * @sa enum CFE_TIME_SourceSelect */ typedef uint8 CFE_TIME_SourceSelect_Enum_t; @@ -225,7 +222,6 @@ enum CFE_TIME_ToneSignalSelect /** * @brief Tone Signal Selection Parameters * - * * @sa enum CFE_TIME_ToneSignalSelect */ typedef uint8 CFE_TIME_ToneSignalSelect_Enum_t; @@ -250,7 +246,6 @@ enum CFE_TIME_AdjustDirection /** * @brief STCF adjustment direction (for both one-time and 1Hz adjustments) * - * * @sa enum CFE_TIME_AdjustDirection */ typedef uint8 CFE_TIME_AdjustDirection_Enum_t; @@ -275,7 +270,6 @@ enum CFE_TIME_FlywheelState /** * @brief Fly-wheel status values * - * * @sa enum CFE_TIME_FlywheelState */ typedef uint8 CFE_TIME_FlywheelState_Enum_t; @@ -300,7 +294,6 @@ enum CFE_TIME_SetState /** * @brief Clock status values (has the clock been set to correct time) * - * * @sa enum CFE_TIME_SetState */ typedef uint8 CFE_TIME_SetState_Enum_t; diff --git a/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h index 1db3e8cd0..58528ceb2 100644 --- a/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h +++ b/modules/core_private/ut-stubs/inc/ut_osprintf_stubs.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * OS API unit test header * diff --git a/modules/core_private/ut-stubs/inc/ut_support.h b/modules/core_private/ut-stubs/inc/ut_support.h index 2fa61659e..06e97b54a 100644 --- a/modules/core_private/ut-stubs/inc/ut_support.h +++ b/modules/core_private/ut-stubs/inc/ut_support.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * Unit specification for Unit Test Stubs * diff --git a/modules/es/fsw/inc/cfe_es_events.h b/modules/es/fsw/inc/cfe_es_events.h index 1b4fa8493..5024fa38b 100644 --- a/modules/es/fsw/inc/cfe_es_events.h +++ b/modules/es/fsw/inc/cfe_es_events.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * cFE Executive Services (ES) Event IDs * @@ -197,7 +196,6 @@ ** accepted the request to reload the application, and it will be reloaded after the app exits ** it's main loop, or times out. ** -** ** The \c 's' field identifies the name of the Application that will be reloaded. **/ #define CFE_ES_RELOAD_APP_DBG_EID 11 diff --git a/modules/es/fsw/inc/cfe_es_msg.h b/modules/es/fsw/inc/cfe_es_msg.h index e76a2df92..7092075b2 100644 --- a/modules/es/fsw/inc/cfe_es_msg.h +++ b/modules/es/fsw/inc/cfe_es_msg.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * cFE Executive Services (ES) Command and Telemetry packet definition file. * diff --git a/modules/es/fsw/src/cfe_es_cds.h b/modules/es/fsw/src/cfe_es_cds.h index 8e20a4d65..0a952a58a 100644 --- a/modules/es/fsw/src/cfe_es_cds.h +++ b/modules/es/fsw/src/cfe_es_cds.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This file contains the Internal interface for the cFE Critical Data Store functions. * These functions and data structures manage the Critical Data Store in the cFE. @@ -244,7 +243,6 @@ int32 CFE_ES_CDS_CacheFlush(CFE_ES_CDS_AccessCache_t *Cache); * Only one thread can use CDS cache at a given time, so the CDS access * control mutex must be obtained before calling this function. * - * * @param[inout] Cache the global CDS cache buffer * @param[in] Source the local object to load into cache * @param[in] Offset the CDS offset to fetch @@ -403,7 +401,6 @@ bool CFE_ES_CheckCDSHandleSlotUsed(CFE_ResourceId_t CheckId); ** ** \par SysLog Messages ** -** ** \return None ** ******************************************************************************/ @@ -498,7 +495,6 @@ int32 CFE_ES_UpdateCDSRegistry(void); ** ** \param[in] ThisAppId the Application ID of the Application making the call. ** -** ******************************************************************************/ void CFE_ES_FormCDSName(char *FullCDSName, const char *CDSName, CFE_ES_AppId_t ThisAppId); diff --git a/modules/es/fsw/src/cfe_es_cds_mempool.h b/modules/es/fsw/src/cfe_es_cds_mempool.h index 42c1c421a..696fca5d1 100644 --- a/modules/es/fsw/src/cfe_es_cds_mempool.h +++ b/modules/es/fsw/src/cfe_es_cds_mempool.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This file contains the Internal interface for the cFE Critical Data Store * memory pool functions. diff --git a/modules/es/fsw/src/cfe_es_generic_pool.h b/modules/es/fsw/src/cfe_es_generic_pool.h index 7f883963c..6021da2c1 100644 --- a/modules/es/fsw/src/cfe_es_generic_pool.h +++ b/modules/es/fsw/src/cfe_es_generic_pool.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This file contains the Internal interface for the cFE Critical Data Store * memory pool functions. diff --git a/modules/es/fsw/src/cfe_es_global.h b/modules/es/fsw/src/cfe_es_global.h index ee96fd932..7d690d957 100644 --- a/modules/es/fsw/src/cfe_es_global.h +++ b/modules/es/fsw/src/cfe_es_global.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This file contains the ES global data definitions. * diff --git a/modules/es/fsw/src/cfe_es_log.h b/modules/es/fsw/src/cfe_es_log.h index 1f29be821..cac9267c7 100644 --- a/modules/es/fsw/src/cfe_es_log.h +++ b/modules/es/fsw/src/cfe_es_log.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This file contains definitions needed for the cFE ES Logs. The * logs include the Mode Transition log, the System Log, and the diff --git a/modules/es/fsw/src/cfe_es_mempool.h b/modules/es/fsw/src/cfe_es_mempool.h index ae6cbf469..5c15f4cf6 100644 --- a/modules/es/fsw/src/cfe_es_mempool.h +++ b/modules/es/fsw/src/cfe_es_mempool.h @@ -21,7 +21,6 @@ /** * @file * - * * Contains data structure definitions used by the ES mempool implementation. * * The ES memory pools are now built on top of the generic memory pool implementation, diff --git a/modules/es/fsw/src/cfe_es_module_all.h b/modules/es/fsw/src/cfe_es_module_all.h index 8ae050eef..116a890f8 100644 --- a/modules/es/fsw/src/cfe_es_module_all.h +++ b/modules/es/fsw/src/cfe_es_module_all.h @@ -21,7 +21,6 @@ /** * @file * - * * Encapsulates all ES module internal header files, as well * as the public API from all other CFE core modules, OSAL, and PSP. * diff --git a/modules/es/fsw/src/cfe_es_perf.h b/modules/es/fsw/src/cfe_es_perf.h index 022f2d8a7..fa0a43599 100644 --- a/modules/es/fsw/src/cfe_es_perf.h +++ b/modules/es/fsw/src/cfe_es_perf.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: Performance Analyzer data structures * * Design Notes: diff --git a/modules/es/fsw/src/cfe_es_resource.h b/modules/es/fsw/src/cfe_es_resource.h index 5b57c6f2c..6d6f387b4 100644 --- a/modules/es/fsw/src/cfe_es_resource.h +++ b/modules/es/fsw/src/cfe_es_resource.h @@ -21,7 +21,6 @@ /** * @file * - * * Contains basic prototypes and definitions related to CFE ES resource * management and related resource IDs. * diff --git a/modules/es/fsw/src/cfe_es_task.h b/modules/es/fsw/src/cfe_es_task.h index 2c45c2fc8..336f2d1be 100644 --- a/modules/es/fsw/src/cfe_es_task.h +++ b/modules/es/fsw/src/cfe_es_task.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * cFE Executive Services (ES) task header file * diff --git a/modules/es/fsw/src/cfe_es_verify.h b/modules/es/fsw/src/cfe_es_verify.h index cf0b97dec..751eb5a0d 100644 --- a/modules/es/fsw/src/cfe_es_verify.h +++ b/modules/es/fsw/src/cfe_es_verify.h @@ -21,12 +21,10 @@ /** * @file * - * * Purpose: * This header file performs compile time checking for ES configuration * parameters. * - * * References: * Flight Software Branch C Coding Standard Version 1.0a * cFE Flight Software Application Developers Guide diff --git a/modules/evs/fsw/inc/cfe_evs_events.h b/modules/evs/fsw/inc/cfe_evs_events.h index 13e59f4ca..8f1f8db1e 100644 --- a/modules/evs/fsw/inc/cfe_evs_events.h +++ b/modules/evs/fsw/inc/cfe_evs_events.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * cFE Event Services (EVS) Event IDs * diff --git a/modules/evs/fsw/inc/cfe_evs_msg.h b/modules/evs/fsw/inc/cfe_evs_msg.h index cc2515b3c..9315bd830 100644 --- a/modules/evs/fsw/inc/cfe_evs_msg.h +++ b/modules/evs/fsw/inc/cfe_evs_msg.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Event Services Message definition header file Header File * * Purpose: @@ -254,7 +253,6 @@ ** - \b \c \EVS_CMDEC - command error counter will increment ** - An Error specific event message ** -** ** \par Criticality ** Setting the event format mode is not particularly hazardous, as the ** result may be saving necessary bandwidth. However, inappropriately @@ -296,7 +294,6 @@ ** increment ** - The generation of #CFE_EVS_ENAAPPEVTTYPE_EID debug event message ** -** ** \par Error Conditions ** This command may fail for the following reason(s): ** - Invalid Event Type Selection @@ -305,7 +302,6 @@ ** - \b \c \EVS_CMDEC - command error counter will increment ** - An Error specific event message ** -** ** \par Criticality ** Enabling an application event type is not particularly hazardous, as ** the result may be turning on necessary event messages and diff --git a/modules/evs/fsw/src/cfe_evs_task.h b/modules/evs/fsw/src/cfe_evs_task.h index 5548c5939..c8c4889f5 100644 --- a/modules/evs/fsw/src/cfe_evs_task.h +++ b/modules/evs/fsw/src/cfe_evs_task.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Event Services API - Management Control Interfaces. * * Purpose: diff --git a/modules/evs/fsw/src/cfe_evs_utils.h b/modules/evs/fsw/src/cfe_evs_utils.h index 1740fa02e..e90f7c653 100644 --- a/modules/evs/fsw/src/cfe_evs_utils.h +++ b/modules/evs/fsw/src/cfe_evs_utils.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Event Services Task and API - Utility functions. * * Purpose: diff --git a/modules/evs/fsw/src/cfe_evs_verify.h b/modules/evs/fsw/src/cfe_evs_verify.h index 67b7d4dfd..d94de4d20 100644 --- a/modules/evs/fsw/src/cfe_evs_verify.h +++ b/modules/evs/fsw/src/cfe_evs_verify.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file performs compile time checking for EVS configuration * parameters. @@ -30,7 +29,6 @@ * * Notes: * - * */ #ifndef CFE_EVS_VERIFY_H diff --git a/modules/evs/ut-coverage/evs_UT.h b/modules/evs/ut-coverage/evs_UT.h index d98f409cc..4e67a8259 100644 --- a/modules/evs/ut-coverage/evs_UT.h +++ b/modules/evs/ut-coverage/evs_UT.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * EVS unit test header * diff --git a/modules/fs/fsw/src/cfe_fs_priv.h b/modules/fs/fsw/src/cfe_fs_priv.h index 393bd331d..3979d98ec 100644 --- a/modules/fs/fsw/src/cfe_fs_priv.h +++ b/modules/fs/fsw/src/cfe_fs_priv.h @@ -21,14 +21,12 @@ /** * @file * - * * Purpose: * This header file contains prototypes for private functions and type * definitions for FS internal use. * * Author: A. Cudmore/NASA GSFC * - * */ #ifndef CFE_FS_PRIV_H diff --git a/modules/fs/ut-coverage/fs_UT.h b/modules/fs/ut-coverage/fs_UT.h index 025044cd0..e7f1fd747 100644 --- a/modules/fs/ut-coverage/fs_UT.h +++ b/modules/fs/ut-coverage/fs_UT.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * FS unit test header * diff --git a/modules/sb/fsw/inc/cfe_sb_events.h b/modules/sb/fsw/inc/cfe_sb_events.h index 24c02be34..682b3fe35 100644 --- a/modules/sb/fsw/inc/cfe_sb_events.h +++ b/modules/sb/fsw/inc/cfe_sb_events.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * cFE Software Bus (SB) Event IDs * diff --git a/modules/sb/fsw/inc/cfe_sb_msg.h b/modules/sb/fsw/inc/cfe_sb_msg.h index fc2892f90..93a9de958 100644 --- a/modules/sb/fsw/inc/cfe_sb_msg.h +++ b/modules/sb/fsw/inc/cfe_sb_msg.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains structure definitions for all SB command and * telemetry packets diff --git a/modules/sb/fsw/src/cfe_sb_priv.h b/modules/sb/fsw/src/cfe_sb_priv.h index e650e6ddb..019f664bc 100644 --- a/modules/sb/fsw/src/cfe_sb_priv.h +++ b/modules/sb/fsw/src/cfe_sb_priv.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file contains prototypes for private functions and type * definitions for SB internal use. diff --git a/modules/sb/fsw/src/cfe_sb_verify.h b/modules/sb/fsw/src/cfe_sb_verify.h index ec67e50e3..fd1221e3a 100644 --- a/modules/sb/fsw/src/cfe_sb_verify.h +++ b/modules/sb/fsw/src/cfe_sb_verify.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * This header file performs compile time checking for SB configuration * parameters. diff --git a/modules/sb/ut-coverage/sb_UT.h b/modules/sb/ut-coverage/sb_UT.h index 11c9b5000..4aa09e201 100644 --- a/modules/sb/ut-coverage/sb_UT.h +++ b/modules/sb/ut-coverage/sb_UT.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * SB unit test header * diff --git a/modules/tbl/fsw/inc/cfe_tbl_events.h b/modules/tbl/fsw/inc/cfe_tbl_events.h index 4d1d57b1f..ad100681c 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_events.h +++ b/modules/tbl/fsw/inc/cfe_tbl_events.h @@ -21,7 +21,6 @@ /** * @file * - * * Title: Table Services API Event ID Header File * * Purpose: diff --git a/modules/tbl/fsw/inc/cfe_tbl_msg.h b/modules/tbl/fsw/inc/cfe_tbl_msg.h index 2e688adab..99e86f051 100644 --- a/modules/tbl/fsw/inc/cfe_tbl_msg.h +++ b/modules/tbl/fsw/inc/cfe_tbl_msg.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Table Services (TBL) SB message definitions header file * * Author: D.Kobe/Hammers diff --git a/modules/tbl/fsw/src/cfe_tbl_internal.h b/modules/tbl/fsw/src/cfe_tbl_internal.h index 5532b034a..93e60c31b 100644 --- a/modules/tbl/fsw/src/cfe_tbl_internal.h +++ b/modules/tbl/fsw/src/cfe_tbl_internal.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Table Services (TBL) utility function interface file * * Author: D. Kobe/the Hammers Company, Inc. @@ -93,7 +92,6 @@ int32 CFE_TBL_ValidateHandle(CFE_TBL_Handle_t TblHandle); ** \param[in, out] AppIdPtr Pointer to value that will hold AppID on return. *AppIdPtr is the AppID as obtained from *#CFE_ES_GetAppID ** -** ** \retval #CFE_SUCCESS \copydoc CFE_SUCCESS ** \retval #CFE_TBL_ERR_BAD_APP_ID \copydoc CFE_TBL_ERR_BAD_APP_ID ** \retval #CFE_TBL_ERR_INVALID_HANDLE \copydoc CFE_TBL_ERR_INVALID_HANDLE @@ -166,7 +164,6 @@ int32 CFE_TBL_RemoveAccessLink(CFE_TBL_Handle_t TblHandle); ** \param[in] TblHandle Handle of Table whose address is needed. ** \param[in] ThisAppId AppID of application making the address request. ** -** ** \retval #CFE_SUCCESS \copydoc CFE_SUCCESS ** \retval #CFE_TBL_ERR_INVALID_HANDLE \copydoc CFE_TBL_ERR_INVALID_HANDLE ** \retval #CFE_TBL_ERR_NO_ACCESS \copydoc CFE_TBL_ERR_NO_ACCESS @@ -263,8 +260,6 @@ CFE_TBL_Handle_t CFE_TBL_FindFreeHandle(void); ** ** \param[in] ThisAppId the Application ID of the Application making the call. ** -** -** ******************************************************************************/ void CFE_TBL_FormTableName(char *FullTblName, const char *TblName, CFE_ES_AppId_t ThisAppId); @@ -326,7 +321,6 @@ int32 CFE_TBL_UnlockRegistry(void); ** function is being called by a user Application (true) ** or by the Table Services Application (false) ** -** ** \retval #CFE_SUCCESS \copydoc CFE_SUCCESS ** \retval #CFE_TBL_ERR_NO_BUFFER_AVAIL \copydoc CFE_TBL_ERR_NO_BUFFER_AVAIL ** @@ -443,8 +437,6 @@ void CFE_TBL_NotifyTblUsersOfUpdate(CFE_TBL_RegistryRec_t *RegRecPtr); ** \param[in] LoadFilename Pointer to character string containing full path ** and filename of table image to be loaded ** -** -** ** \retval #CFE_SUCCESS \copydoc CFE_SUCCESS ** \retval #CFE_TBL_ERR_NO_STD_HEADER \copydoc CFE_TBL_ERR_NO_STD_HEADER ** \retval #CFE_TBL_ERR_NO_TBL_HEADER \copydoc CFE_TBL_ERR_NO_TBL_HEADER @@ -483,7 +475,6 @@ void CFE_TBL_InitRegistryRecord(CFE_TBL_RegistryRec_t *RegRecPtr); ** ** \param[in, out] HdrPtr Pointer to table header that needs to be swapped. *HdrPtr provides the swapped header ** -** ******************************************************************************/ void CFE_TBL_ByteSwapTblHeader(CFE_TBL_File_Hdr_t *HdrPtr); @@ -509,7 +500,6 @@ void CFE_TBL_ByteSwapTblHeader(CFE_TBL_File_Hdr_t *HdrPtr); ** ** \param[in] CDSHandleToFind CDS Handle to be located in Critical Table Registry. ** -** ******************************************************************************/ void CFE_TBL_FindCriticalTblInfo(CFE_TBL_CritRegRec_t **CritRegRecPtr, CFE_ES_CDSHandle_t CDSHandleToFind); @@ -529,7 +519,6 @@ void CFE_TBL_FindCriticalTblInfo(CFE_TBL_CritRegRec_t **CritRegRecPtr, CFE_ES_CD ** \param[in] RegRecPtr Pointer to Registry Record of Critical Table whose CDS ** needs to be updated. ** -** ******************************************************************************/ void CFE_TBL_UpdateCriticalTblCDS(CFE_TBL_RegistryRec_t *RegRecPtr); @@ -548,7 +537,6 @@ void CFE_TBL_UpdateCriticalTblCDS(CFE_TBL_RegistryRec_t *RegRecPtr); ** ** \param[in] RegRecPtr Pointer to Registry Record of Table whose owner needs notifying. ** -** ******************************************************************************/ int32 CFE_TBL_SendNotificationMsg(CFE_TBL_RegistryRec_t *RegRecPtr); @@ -565,7 +553,6 @@ int32 CFE_TBL_SendNotificationMsg(CFE_TBL_RegistryRec_t *RegRecPtr); ** ** \param[in, out] Uint32ToSwapPtr Pointer to uint32 value to be swapped. *Uint32ToSwapPtr is the swapped uint32 value ** -** ******************************************************************************/ extern void CFE_TBL_ByteSwapUint32(uint32 *Uint32ToSwapPtr); diff --git a/modules/tbl/fsw/src/cfe_tbl_task.h b/modules/tbl/fsw/src/cfe_tbl_task.h index c8c3f6738..18a479ea3 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task.h +++ b/modules/tbl/fsw/src/cfe_tbl_task.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Table Services (TBL) task header file * * Author: David Kobe (the Hammers Company, Inc.) @@ -405,7 +404,6 @@ int32 CFE_TBL_TaskInit(void); ** ** \param[in] MessagePtr a pointer to the message received from the command pipe ** -** ******************************************************************************/ void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); @@ -419,7 +417,6 @@ void CFE_TBL_TaskPipe(CFE_SB_Buffer_t *SBBufPtr); ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ void CFE_TBL_InitData(void); diff --git a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h index 386f69abd..07a7d6992 100644 --- a/modules/tbl/fsw/src/cfe_tbl_task_cmds.h +++ b/modules/tbl/fsw/src/cfe_tbl_task_cmds.h @@ -21,7 +21,6 @@ /** * @file * - * * Subsystem: cFE TBL Task Command Handler Interface Definition File * * Author: David Kobe (the Hammers Company, Inc.) @@ -99,7 +98,6 @@ typedef struct ** \par Assumptions, External Events, and Notes: ** None ** -** ******************************************************************************/ extern void CFE_TBL_GetHkData(void); @@ -116,7 +114,6 @@ extern void CFE_TBL_GetHkData(void); ** #CFE_TBL_Global_t::HkTlmTblRegIndex is assumed to be a valid index into ** the Table Registry. ** -** ******************************************************************************/ extern void CFE_TBL_GetTblRegData(void); diff --git a/modules/tbl/fsw/src/cfe_tbl_verify.h b/modules/tbl/fsw/src/cfe_tbl_verify.h index d16fe0811..614031568 100644 --- a/modules/tbl/fsw/src/cfe_tbl_verify.h +++ b/modules/tbl/fsw/src/cfe_tbl_verify.h @@ -21,8 +21,6 @@ /** * @file * - * - * * Purpose: * This header file performs compile time checking for TBL configuration * parameters. diff --git a/modules/tbl/ut-coverage/tbl_UT.h b/modules/tbl/ut-coverage/tbl_UT.h index 531a441f8..e7d579e40 100644 --- a/modules/tbl/ut-coverage/tbl_UT.h +++ b/modules/tbl/ut-coverage/tbl_UT.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * TBL unit test header * diff --git a/modules/time/fsw/inc/cfe_time_events.h b/modules/time/fsw/inc/cfe_time_events.h index 1e5e46722..ae43e9b3b 100644 --- a/modules/time/fsw/inc/cfe_time_events.h +++ b/modules/time/fsw/inc/cfe_time_events.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * cFE Time Services (Time) Event IDs * diff --git a/modules/time/fsw/inc/cfe_time_msg.h b/modules/time/fsw/inc/cfe_time_msg.h index c5f2194a3..9aad58e12 100644 --- a/modules/time/fsw/inc/cfe_time_msg.h +++ b/modules/time/fsw/inc/cfe_time_msg.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Time Services (TIME) SB message definitions header file * * Author: S.Walling/Microtel diff --git a/modules/time/fsw/src/cfe_time_utils.h b/modules/time/fsw/src/cfe_time_utils.h index 7f5f0f44c..5b11a06e2 100644 --- a/modules/time/fsw/src/cfe_time_utils.h +++ b/modules/time/fsw/src/cfe_time_utils.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: cFE Time Services (TIME) library utilities header file * * Author: S.Walling/Microtel diff --git a/modules/time/fsw/src/cfe_time_verify.h b/modules/time/fsw/src/cfe_time_verify.h index 36c8b4c15..015e8cc60 100644 --- a/modules/time/fsw/src/cfe_time_verify.h +++ b/modules/time/fsw/src/cfe_time_verify.h @@ -21,14 +21,12 @@ /** * @file * - * * Purpose: cFE Time Services (TIME) configuration verification * * Author: S.Walling/Microtel * * Notes: * - * */ #ifndef CFE_TIME_VERIFY_H diff --git a/modules/time/ut-coverage/time_UT.h b/modules/time/ut-coverage/time_UT.h index 25787d079..eac77bce3 100644 --- a/modules/time/ut-coverage/time_UT.h +++ b/modules/time/ut-coverage/time_UT.h @@ -21,7 +21,6 @@ /** * @file * - * * Purpose: * TIME unit test header * From 21f1b029f316a9c461f830bac40e0399a6da6a78 Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Thu, 25 Mar 2021 11:02:40 -0400 Subject: [PATCH 21/27] Fix #1264, use simple filenames. --- docs/README_functionaltest.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README_functionaltest.md b/docs/README_functionaltest.md index f4bfaaec6..b65a3f439 100644 --- a/docs/README_functionaltest.md +++ b/docs/README_functionaltest.md @@ -29,10 +29,10 @@ cases. It also must be loaded after `cfe_assert`. To execute tests at startup, the following lines can be added to `cfe_es_startup.scr` on the designated test target: - CFE_LIB, /cf/cfe_assert.so, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0; - CFE_APP, /cf/cfe_testrunner.so, CFE_TR_AppMain, TESTRUN_APP, 100, 16384, 0x0, 0; - CFE_LIB, /cf/cfe_testcase.so, CFE_Test_Init, CFETEST_LIB, 0, 0, 0x0, 0; - CFE_LIB, /cf/psp_test.so, PSP_Test_Init, PSPTEST_LIB, 0, 0, 0x0, 0; + CFE_LIB, cfe_assert, CFE_Assert_LibInit, ASSERT_LIB, 0, 0, 0x0, 0; + CFE_APP, cfe_testrunner, CFE_TR_AppMain, TESTRUN_APP, 100, 16384, 0x0, 0; + CFE_LIB, cfe_testcase, CFE_Test_Init, CFETEST_LIB, 0, 0, 0x0, 0; + CFE_LIB, psp_test, PSP_Test_Init, PSPTEST_LIB, 0, 0, 0x0, 0; It is important that `cfe_assert` is loaded first, as all other test libraries depend on symbols provided in this library. The order of loading other test cases should not From 4c33529fa054b3418adbacf786cb79a712d49304 Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Fri, 26 Mar 2021 12:27:11 -0400 Subject: [PATCH 22/27] Fix #1267, add null pointer check --- modules/es/fsw/src/cfe_es_api.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index 78f9a6491..740489d5a 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -788,6 +788,11 @@ int32 CFE_ES_GetAppID(CFE_ES_AppId_t *AppIdPtr) CFE_ES_AppRecord_t *AppRecPtr; int32 Result; + if (AppIdPtr == NULL) + { + return CFE_ES_BAD_ARGUMENT; + } + CFE_ES_LockSharedData(__func__, __LINE__); AppRecPtr = CFE_ES_GetAppRecordByContext(); @@ -817,6 +822,11 @@ int32 CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr) int32 Result; CFE_ES_TaskRecord_t *TaskRecPtr; + if (TaskIdPtr == NULL) + { + return CFE_ES_BAD_ARGUMENT; + } + CFE_ES_LockSharedData(__func__, __LINE__); TaskRecPtr = CFE_ES_GetTaskRecordByContext(); if (TaskRecPtr == NULL) From fe95bec69bf35c8c03e57edf4fd191059714a150 Mon Sep 17 00:00:00 2001 From: Alex Campbell Date: Fri, 26 Mar 2021 13:40:29 -0400 Subject: [PATCH 23/27] Fix #1269, refactor CFE_ES_ERR_BUFFER to CFE_ES_BAD_ARGUMENT --- modules/core_api/fsw/inc/cfe_error.h | 8 ---- modules/core_api/fsw/inc/cfe_es.h | 48 ++++++++++++------- modules/es/fsw/src/cfe_es_api.c | 6 +-- modules/es/ut-coverage/es_UT.c | 4 +- modules/evs/fsw/src/cfe_evs.c | 2 +- modules/evs/ut-coverage/evs_UT.c | 2 +- .../resourceid/fsw/src/cfe_resourceid_api.c | 2 +- .../ut-coverage/test_cfe_resourceid.c | 2 +- 8 files changed, 40 insertions(+), 34 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_error.h b/modules/core_api/fsw/inc/cfe_error.h index 2e9331e0a..13603846c 100644 --- a/modules/core_api/fsw/inc/cfe_error.h +++ b/modules/core_api/fsw/inc/cfe_error.h @@ -295,14 +295,6 @@ typedef int32 CFE_Status_t; */ #define CFE_ES_ERR_NAME_NOT_FOUND ((CFE_Status_t)0xc4000002) -/** - * @brief Invalid Pointer - * - * Invalid pointer argument (NULL) - * - */ -#define CFE_ES_ERR_BUFFER ((CFE_Status_t)0xc4000003) - /** * @brief Application Create Error * diff --git a/modules/core_api/fsw/inc/cfe_es.h b/modules/core_api/fsw/inc/cfe_es.h index 0a9ed536e..50a9a3869 100644 --- a/modules/core_api/fsw/inc/cfe_es.h +++ b/modules/core_api/fsw/inc/cfe_es.h @@ -524,7 +524,7 @@ int32 CFE_ES_GetResetType(uint32 *ResetSubtypePtr); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetResetType, #CFE_ES_GetAppIDByName, #CFE_ES_GetAppName, #CFE_ES_GetTaskInfo ** @@ -549,7 +549,7 @@ CFE_Status_t CFE_ES_GetAppID(CFE_ES_AppId_t *AppIdPtr); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ******************************************************************************/ CFE_Status_t CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr); @@ -572,7 +572,7 @@ CFE_Status_t CFE_ES_GetTaskID(CFE_ES_TaskId_t *TaskIdPtr); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetAppID, #CFE_ES_GetAppName, #CFE_ES_GetAppInfo ** @@ -597,7 +597,7 @@ CFE_Status_t CFE_ES_GetAppIDByName(CFE_ES_AppId_t *AppIdPtr, const char *AppName ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetLibName ** @@ -628,6 +628,7 @@ CFE_Status_t CFE_ES_GetLibIDByName(CFE_ES_LibId_t *LibIdPtr, const char *LibName ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetAppID, #CFE_ES_GetAppIDByName, #CFE_ES_GetAppInfo ** @@ -658,6 +659,7 @@ CFE_Status_t CFE_ES_GetAppName(char *AppName, CFE_ES_AppId_t AppId, size_t Buffe ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetLibIDByName ** @@ -684,7 +686,7 @@ CFE_Status_t CFE_ES_GetLibName(char *LibName, CFE_ES_LibId_t LibId, size_t Buffe ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetAppID, #CFE_ES_GetAppIDByName, #CFE_ES_GetAppName ** @@ -713,7 +715,7 @@ CFE_Status_t CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetTaskID, #CFE_ES_GetTaskIDByName, #CFE_ES_GetTaskName ** @@ -746,7 +748,7 @@ CFE_Status_t CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t Tas ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetLibIDByName, #CFE_ES_GetLibName ** @@ -780,7 +782,7 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetLibInfo, #CFE_ES_GetAppInfo ** @@ -849,6 +851,7 @@ CFE_Status_t CFE_ES_RegisterChildTask(void); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_CHILD_TASK_CREATE \copybrief CFE_ES_ERR_CHILD_TASK_CREATE +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_RegisterChildTask, #CFE_ES_DeleteChildTask, #CFE_ES_ExitChildTask ** @@ -875,7 +878,7 @@ CFE_Status_t CFE_ES_CreateChildTask(CFE_ES_TaskId_t *TaskIdPtr, const char *Task ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetTaskName ** @@ -906,6 +909,7 @@ CFE_Status_t CFE_ES_GetTaskIDByName(CFE_ES_TaskId_t *TaskIdPtr, const char *Task ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetTaskIDByName ** @@ -999,6 +1003,7 @@ void CFE_ES_BackgroundWakeup(void); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_SYS_LOG_FULL \copybrief CFE_ES_ERR_SYS_LOG_FULL +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ******************************************************************************/ CFE_Status_t CFE_ES_WriteToSysLog(const char *SpecStringPtr, ...) OS_PRINTF(1, 2); @@ -1088,6 +1093,7 @@ void CFE_ES_ProcessAsyncEvent(void); ** \retval #CFE_ES_CDS_INVALID_SIZE \copybrief CFE_ES_CDS_INVALID_SIZE ** \retval #CFE_ES_CDS_INVALID_NAME \copybrief CFE_ES_CDS_INVALID_NAME ** \retval #CFE_ES_CDS_REGISTRY_FULL \copybrief CFE_ES_CDS_REGISTRY_FULL +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_CopyToCDS, #CFE_ES_RestoreFromCDS ** @@ -1112,7 +1118,7 @@ CFE_Status_t CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *HandlePtr, size_t BlockSize, ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetCDSBlockName ** @@ -1143,6 +1149,7 @@ CFE_Status_t CFE_ES_GetCDSBlockIDByName(CFE_ES_CDSHandle_t *BlockIdPtr, const ch ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetCDSBlockIDByName ** @@ -1168,6 +1175,7 @@ CFE_Status_t CFE_ES_GetCDSBlockName(char *BlockName, CFE_ES_CDSHandle_t BlockId, ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_RegisterCDS, #CFE_ES_RestoreFromCDS ** @@ -1195,9 +1203,10 @@ CFE_Status_t CFE_ES_CopyToCDS(CFE_ES_CDSHandle_t Handle, void *DataToCopy); ** the CDS. *RestoreToMemory is the contents of the specified CDS. ** ** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS +** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID -** \retval #CFE_ES_CDS_BLOCK_CRC_ERR \copybrief CFE_ES_CDS_BLOCK_CRC_ERR +** \retval #CFE_ES_CDS_BLOCK_CRC_ERR \copybrief CFE_ES_CDS_BLOCK_CRC_ERR +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_RegisterCDS, #CFE_ES_CopyToCDS ** @@ -1354,6 +1363,7 @@ int32 CFE_ES_PoolDelete(CFE_ES_MemHandle_t PoolID); ** \return Bytes Allocated, or error code \ref CFEReturnCodes ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID ** \retval #CFE_ES_ERR_MEM_BLOCK_SIZE \copybrief CFE_ES_ERR_MEM_BLOCK_SIZE +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_PutPoolBuf, #CFE_ES_GetMemPoolStats, *#CFE_ES_GetPoolBufInfo @@ -1379,6 +1389,7 @@ int32 CFE_ES_GetPoolBuf(CFE_ES_MemPoolBuf_t *BufPtr, CFE_ES_MemHandle_t PoolID, ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID ** \retval #CFE_ES_BUFFER_NOT_IN_POOL \copybrief CFE_ES_BUFFER_NOT_IN_POOL +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_GetPoolBuf, #CFE_ES_GetMemPoolStats, *#CFE_ES_PutPoolBuf @@ -1402,6 +1413,7 @@ CFE_Status_t CFE_ES_GetPoolBufInfo(CFE_ES_MemHandle_t PoolID, CFE_ES_MemPoolBuf_ ** ** \return Bytes released, or error code \ref CFEReturnCodes ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_GetPoolBuf, #CFE_ES_GetMemPoolStats, *#CFE_ES_GetPoolBufInfo @@ -1431,6 +1443,7 @@ int32 CFE_ES_PutPoolBuf(CFE_ES_MemHandle_t PoolID, CFE_ES_MemPoolBuf_t BufPtr); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_PoolCreate, #CFE_ES_PoolCreateNoSem, #CFE_ES_PoolCreateEx, #CFE_ES_GetPoolBuf, #CFE_ES_PutPoolBuf ** @@ -1520,8 +1533,8 @@ void CFE_ES_PerfLogAdd(uint32 Marker, uint32 EntryExit); ** \param[out] *CounterIdPtr The Counter Id of the newly created counter. ** ** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT +** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_IncrementGenCounter, #CFE_ES_DeleteGenCounter, #CFE_ES_SetGenCount, #CFE_ES_GetGenCount, *#CFE_ES_GetGenCounterIDByName @@ -1564,8 +1577,8 @@ CFE_Status_t CFE_ES_DeleteGenCounter(CFE_ES_CounterId_t CounterId); ** \param[in] CounterId The Counter to be incremented. ** ** \return Execution status, see \ref CFEReturnCodes -** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS -** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT +** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_RegisterGenCounter, #CFE_ES_DeleteGenCounter, #CFE_ES_SetGenCount, #CFE_ES_GetGenCount, *#CFE_ES_GetGenCounterIDByName @@ -1637,7 +1650,7 @@ CFE_Status_t CFE_ES_GetGenCount(CFE_ES_CounterId_t CounterId, uint32 *Count); ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_NAME_NOT_FOUND \copybrief CFE_ES_ERR_NAME_NOT_FOUND -** \retval #CFE_ES_ERR_BUFFER \copybrief CFE_ES_ERR_BUFFER +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetGenCounterName ** @@ -1668,6 +1681,7 @@ CFE_Status_t CFE_ES_GetGenCounterIDByName(CFE_ES_CounterId_t *CounterIdPtr, cons ** \return Execution status, see \ref CFEReturnCodes ** \retval #CFE_SUCCESS \copybrief CFE_SUCCESS ** \retval #CFE_ES_ERR_RESOURCEID_NOT_VALID \copybrief CFE_ES_ERR_RESOURCEID_NOT_VALID +** \retval #CFE_ES_BAD_ARGUMENT \copybrief CFE_ES_BAD_ARGUMENT ** ** \sa #CFE_ES_GetGenCounterIDByName ** diff --git a/modules/es/fsw/src/cfe_es_api.c b/modules/es/fsw/src/cfe_es_api.c index 740489d5a..6df39b4aa 100644 --- a/modules/es/fsw/src/cfe_es_api.c +++ b/modules/es/fsw/src/cfe_es_api.c @@ -974,7 +974,7 @@ int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_AppId_t AppId) if (AppInfo == NULL) { CFE_ES_WriteToSysLog("CFE_ES_GetAppInfo: Invalid Parameter ( Null Pointer )\n"); - return CFE_ES_ERR_BUFFER; + return CFE_ES_BAD_ARGUMENT; } memset(AppInfo, 0, sizeof(*AppInfo)); @@ -1064,7 +1064,7 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_LibId_t LibId) if (LibInfo == NULL) { CFE_ES_WriteToSysLog("CFE_ES_GetLibInfo: Invalid Parameter ( Null Pointer )\n"); - return CFE_ES_ERR_BUFFER; + return CFE_ES_BAD_ARGUMENT; } memset(LibInfo, 0, sizeof(*LibInfo)); @@ -1152,7 +1152,7 @@ int32 CFE_ES_GetTaskInfo(CFE_ES_TaskInfo_t *TaskInfo, CFE_ES_TaskId_t TaskId) if (TaskInfo == NULL) { CFE_ES_WriteToSysLog("CFE_ES_GetTaskInfo: Invalid Parameter ( Null Pointer )\n"); - return CFE_ES_ERR_BUFFER; + return CFE_ES_BAD_ARGUMENT; } memset(TaskInfo, 0, sizeof(*TaskInfo)); diff --git a/modules/es/ut-coverage/es_UT.c b/modules/es/ut-coverage/es_UT.c index 67e48dc4f..7b6c8b71d 100644 --- a/modules/es/ut-coverage/es_UT.c +++ b/modules/es/ut-coverage/es_UT.c @@ -1417,7 +1417,7 @@ void TestApps(void) ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, NULL); AppId = CFE_ES_AppRecordGetID(UtAppRecPtr); - UT_Report(__FILE__, __LINE__, CFE_ES_GetAppInfo(NULL, AppId) == CFE_ES_ERR_BUFFER, "CFE_ES_GetAppInfo", + UT_Report(__FILE__, __LINE__, CFE_ES_GetAppInfo(NULL, AppId) == CFE_ES_BAD_ARGUMENT, "CFE_ES_GetAppInfo", "Null application information pointer"); /* Test populating the application information structure using an @@ -3804,7 +3804,7 @@ void TestAPI(void) ES_ResetUnitTest(); ES_UT_SetupSingleAppId(CFE_ES_AppType_EXTERNAL, CFE_ES_AppState_RUNNING, NULL, &UtAppRecPtr, &UtTaskRecPtr); TaskId = CFE_ES_TaskRecordGetID(UtTaskRecPtr); - UT_Report(__FILE__, __LINE__, CFE_ES_GetTaskInfo(NULL, TaskId) == CFE_ES_ERR_BUFFER, "CFE_ES_GetTaskInfo", + UT_Report(__FILE__, __LINE__, CFE_ES_GetTaskInfo(NULL, TaskId) == CFE_ES_BAD_ARGUMENT, "CFE_ES_GetTaskInfo", "Get task info by ID; NULL buffer"); /* Test getting task information using the task ID - bad task ID */ diff --git a/modules/evs/fsw/src/cfe_evs.c b/modules/evs/fsw/src/cfe_evs.c index b04dfaf38..405635603 100644 --- a/modules/evs/fsw/src/cfe_evs.c +++ b/modules/evs/fsw/src/cfe_evs.c @@ -67,7 +67,7 @@ int32 CFE_EVS_Register(const void *Filters, uint16 NumEventFilters, uint16 Filte } else if ((NumEventFilters != 0) && (Filters == NULL)) { - Status = CFE_ES_ERR_BUFFER; + Status = CFE_ES_BAD_ARGUMENT; } else { diff --git a/modules/evs/ut-coverage/evs_UT.c b/modules/evs/ut-coverage/evs_UT.c index d863302a4..e29970831 100644 --- a/modules/evs/ut-coverage/evs_UT.c +++ b/modules/evs/ut-coverage/evs_UT.c @@ -2039,7 +2039,7 @@ void Test_Misc(void) /* Test registering an application with invalid filter argument */ UT_InitData(); - UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 1, 0) == CFE_ES_ERR_BUFFER, "CFE_EVS_Register", + UT_Report(__FILE__, __LINE__, CFE_EVS_Register(NULL, 1, 0) == CFE_ES_BAD_ARGUMENT, "CFE_EVS_Register", "Register application with invalid arguments"); /* Test housekeeping report with log disabled */ diff --git a/modules/resourceid/fsw/src/cfe_resourceid_api.c b/modules/resourceid/fsw/src/cfe_resourceid_api.c index e9f2ccae9..b05e4ab70 100644 --- a/modules/resourceid/fsw/src/cfe_resourceid_api.c +++ b/modules/resourceid/fsw/src/cfe_resourceid_api.c @@ -75,7 +75,7 @@ int32 CFE_ResourceId_ToIndex(CFE_ResourceId_t Id, uint32 BaseValue, uint32 Table if (Idx == NULL) { - return CFE_ES_ERR_BUFFER; + return CFE_ES_BAD_ARGUMENT; } Serial = CFE_ResourceId_ToInteger(Id) - BaseValue; diff --git a/modules/resourceid/ut-coverage/test_cfe_resourceid.c b/modules/resourceid/ut-coverage/test_cfe_resourceid.c index 21f52ba58..8f7952178 100644 --- a/modules/resourceid/ut-coverage/test_cfe_resourceid.c +++ b/modules/resourceid/ut-coverage/test_cfe_resourceid.c @@ -168,7 +168,7 @@ void TestResourceID(void) UtAssert_True(CFE_ResourceId_Equal(Id, CFE_RESOURCEID_UNDEFINED), "CFE_ResourceId_FindNext() bad input: id=%lx", CFE_ResourceId_ToInteger(Id)); - UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, RefBase, 1, NULL), CFE_ES_ERR_BUFFER); + UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, RefBase, 1, NULL), CFE_ES_BAD_ARGUMENT); UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, RefBase, 0, &TestIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); UtAssert_INT32_EQ(CFE_ResourceId_ToIndex(Id, ~RefBase, 1, &TestIndex), CFE_ES_ERR_RESOURCEID_NOT_VALID); } From c1de7f412cf25dfa1b0f7679549ff4b867346bd8 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Mon, 29 Mar 2021 13:12:49 -0400 Subject: [PATCH 24/27] Fix #1270, limit check in pool validation It is OK/valid if NumBuckets is the maximum value --- modules/es/fsw/src/cfe_es_generic_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/es/fsw/src/cfe_es_generic_pool.c b/modules/es/fsw/src/cfe_es_generic_pool.c index bba148318..2df3712cc 100644 --- a/modules/es/fsw/src/cfe_es_generic_pool.c +++ b/modules/es/fsw/src/cfe_es_generic_pool.c @@ -601,7 +601,7 @@ int32 CFE_ES_GenPoolRebuild(CFE_ES_GenPoolRecord_t *PoolRecPtr) bool CFE_ES_GenPoolValidateState(const CFE_ES_GenPoolRecord_t *PoolRecPtr) { return (PoolRecPtr->PoolTotalSize > 0 && PoolRecPtr->TailPosition <= PoolRecPtr->PoolMaxOffset && - PoolRecPtr->NumBuckets > 0 && PoolRecPtr->NumBuckets < CFE_PLATFORM_ES_POOL_MAX_BUCKETS); + PoolRecPtr->NumBuckets > 0 && PoolRecPtr->NumBuckets <= CFE_PLATFORM_ES_POOL_MAX_BUCKETS); } /* From 2af49e33fc861e2629e05d21e8192f30c77848a2 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Tue, 30 Mar 2021 17:09:23 -0400 Subject: [PATCH 25/27] IC:2021-03-30, Fix ZeroCopy references in docs Updates documentation for ZeroCopy Ptr APIs updated in #1257 Add "c" to code blocks in users guide markdown syntax --- docs/cFE Application Developers Guide.md | 67 ++++++++++++------------ docs/src/cfe_api.dox | 4 +- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/docs/cFE Application Developers Guide.md b/docs/cFE Application Developers Guide.md index ac995d283..4e3c37892 100644 --- a/docs/cFE Application Developers Guide.md +++ b/docs/cFE Application Developers Guide.md @@ -488,12 +488,12 @@ deciding on whether to create multiple Applications versus a single Application with multiple Tasks, the Application Developer should keep in mind these facts: -- When the Application exits it is the responsiabilty of the +- When the Application exits it is the responsiabilty of the Main Task to safely stop all of its Child Tasks. - If the Main Task of an Application is stopped, either through detection of an exception or via command, all Child Tasks are also - forcibly stopped in an unsafe manner. + forcibly stopped in an unsafe manner. Child Tasks can be useful in both "Software Only" and "Hardware Servicing" applications. @@ -1052,7 +1052,7 @@ into a working image in the Application.  An example of how to use the CDS is shown below: -``` +```c FILE: "sample_task.h": /* Define the structure for the data stored in my Critical Data Store */ @@ -1079,7 +1079,7 @@ typedef struct #define SAMPLE_CDS_NAME "CDS" ``` -``` +```c FILE: "sample_task.c": SAMPLE_TaskData_t SAMPLE_TaskData; @@ -1172,7 +1172,7 @@ calculation is done consistently for a mission, the Executive Services provides an API for a CRC calculation that can be used by all Applications on a mission. This function looks like the following: -``` +```c uint32 CFE_ES_CalculateCRC(void *pData, uint32 DataLength, uint32 InputCRC, uint32 TypeCRC); ``` @@ -1272,7 +1272,7 @@ segment of code to monitor. Applications typically define these perfids in their xx_mission_cfg.h file. A common pattern for performance monitoring is shown below. -``` +```c FILE: xx_app.c void XX_AppMain(void) @@ -1324,7 +1324,7 @@ void XX_AppMain(void) RunStatus = CFE_ES_RunStatus_APP_ERROR; } } - +} ``` While outside the scope of this documentation, an external post processing tool @@ -1467,7 +1467,7 @@ the cFE of pipes that it requires to receive data. The Application performs this request by calling the CFE_SB_CreatePipe API. The following is a brief example of how this is accomplished: -``` +```c FILE: sample_app.h ... @@ -1482,9 +1482,9 @@ typedef struct CFE_SB_PipeId_t SAMPLE_Pipe_1; /* Variable to hold Pipe ID (i.e.- Handle) */ ... } SAMPLE_AppData_t; - -``` ``` + +```c FILE: sample_app.c SAMPLE_AppData_t; SAMPLE_AppData; @@ -1499,10 +1499,9 @@ SAMPLE_AppData_t; SAMPLE_AppData; SAMPLE_PIPE_1_NAME); /* Name of Pipe */ ... } - ``` -In this example, the Developer has created a Pipe, called "SAMPLE_PIPE_1" +In this example, the Developer has created a Pipe, called `SAMPLE_PIPE_1` with a depth of 10. The Pipe name shall be at least one character and no more than OS_MAX_API_NAME characters long. Developers should prefix their Pipe names with the Application's abbreviated name, because Pipe names will @@ -1520,8 +1519,7 @@ important when using other SB API functions. It is important to realize that the Pipe is not multi-thread safe. Therefore, it is illegal for another thread, even one from the same Application, to attempt to receive data from the created pipe. If multiple threads require access -to messages, each thread needs to create their own pipe and make their -own message subscriptions. +to messages, each thread needs to create their own pipe and make their own message subscriptions. ## 6.2.1 Deleting Software Bus Pipes @@ -1529,7 +1527,7 @@ If an Application no longer requires a Pipe, it can delete the Pipe by calling the CFE_SB_DeletePipe API. This API is demonstrated as follows: -``` +```c FILE: sample_app.c { @@ -1557,7 +1555,7 @@ Once an Application has created a Pipe, it can begin to request data be put into that Pipe. This process is referred to a SB Message Subscription. An example of this process can be seen below: -``` +```c FILE: sample_msgids.h ... @@ -1565,7 +1563,7 @@ FILE: sample_msgids.h #define SAMPLE_CMDID_1 (0x0123) ... ``` -``` +```c FILE: sample_app.h ... @@ -1581,7 +1579,7 @@ typedef struct } SAMPLE_AppData_t; ``` -``` +```c FILE: sample_app.c SAMPLE_AppData_t SAMPLE_AppData; @@ -1634,7 +1632,7 @@ If an Application no longer wishes to receive an SB Message that it had previously subscribed to, it can selectively unsubscribe to specified SB Message IDs. The following is a sample of the API to accomplish this: -``` +```c { int32 Status; @@ -1657,7 +1655,7 @@ memory for it (instantiate it), initialize it with the appropriate SB Message Header information and fill the rest of the structure with appropriate data. An example of this process can be seen below: -``` +```c FILE: sample_msgids.h ... @@ -1666,7 +1664,7 @@ FILE: sample_msgids.h ``` -``` +```c FILE: sample_app.h /* @@ -1698,7 +1696,7 @@ typedef struct ... } SAMPLE_AppData_t; ``` -``` +```c FILE: sample_app.c SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ @@ -1742,7 +1740,7 @@ secondary header structures. The secondary header structures are shown below. Note that all messages must have a secondary header, a message containing just a CFE_MSG_Message_t is invalid per the CCSDS standard. -``` +```c typedef struct { @@ -1854,7 +1852,7 @@ After an SB message has been created (see Section 6.5) and its contents have been set to the appropriate values, the application can then send the message on the SB. An example of this is shown below: -``` +```c FILE: sample_app.c SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ @@ -1875,14 +1873,15 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ CFE_SB_TransmitMsg(&SAMPLE_APP_Data.HkTlm.TlmHeader.Msg, true); ... } -``` +``` + ## 6.7 Receiving Software Bus Messages To receive a SB Message, an application calls CFE_SB_ReceiveBuffer. Since most applications are message-driven, this typically occurs in an application's main execution loop. An example of this is shown below. -``` +```c FILE: sample_app.h typedef struct @@ -1892,7 +1891,7 @@ typedef struct ... } SAMPLE_AppData_t; ``` -``` +```c FILE: sample_app.c { @@ -1949,7 +1948,7 @@ copy is too time consuming, the Developer can choose to utilize the "Zero Copy" protocol. The application can request a buffer from SB utilizing -CFE_SB_ZeroCopyGetPtr, then write the message data directly to the +`CFE_SB_AllocateMessageBuffer`, then write the message data directly to the buffer that can be sent directly (without a copy) by SB. Once an Application has formatted and filled the SB buffer with the @@ -1961,14 +1960,14 @@ calls the CFE_SB_TransmitBuffer API.** Applications should not assume the SB Buffer pointer is accessible once the buffer has been sent. -If an Application has called the CFE_SB_ZeroCopyGetPtr API call and +If an Application has called the `CFE_SB_AllocateMessageBuffer` API call and then later determines that it is not going to send the SB Message, it shall free the allocated buffer by calling the -CFE_SB_ZeroCopyReleasePtr API. +`CFE_SB_ReleaseMessageBuffer` API. An example of the "Zero Copy" protocol is shown below: -``` +```c FILE: app_msgids.h ... @@ -2017,8 +2016,8 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ /* ** Get a SB Message block of memory and initialize it */ - SAMPLE_AppData.BigPktBuf = (SAMPLE_BigPkt_Buffer_t *)CFE_SB_ZeroCopyGetPtr(sizeof(SAMPLE_BigPkt_t), - &BufferHandle); + SAMPLE_AppData.BigPktBuf = (SAMPLE_BigPkt_Buffer_t *)CFE_SB_AllocateMessageBuffer(sizeof(SAMPLE_BigPkt_t)); + CFE_MSG_Init(SAMPLE_AppData.BigPktBuf->Pkt.TlmHeader.Msg, SAMPLE_BIG_TLM_MID, sizeof(SAMPLE_AppData.BigPktBuf->Pkt); @@ -2034,7 +2033,7 @@ SAMPLE_AppData_t SAMPLE_AppData; /* Instantiate Task Data */ /* SAMPLE_AppData.BigPktBuf is no longer a valid pointer */ ... } -``` +```c ## 6.9 Best Practices for using Software Bus diff --git a/docs/src/cfe_api.dox b/docs/src/cfe_api.dox index 85f5f896d..b09273272 100644 --- a/docs/src/cfe_api.dox +++ b/docs/src/cfe_api.dox @@ -136,8 +136,8 @@
  • \ref CFEAPISBZeroCopy
      -
    • #CFE_SB_ZeroCopyGetPtr - \copybrief CFE_SB_ZeroCopyGetPtr -
    • #CFE_SB_ZeroCopyReleasePtr - \copybrief CFE_SB_ZeroCopyReleasePtr +
    • #CFE_SB_AllocateMessageBuffer - \copybrief CFE_SB_AllocateMessageBuffer +
    • #CFE_SB_ReleaseMessageBuffer - \copybrief CFE_SB_ReleaseMessageBuffer
    • #CFE_SB_TransmitBuffer - \copybrief CFE_SB_TransmitBuffer
  • \ref CFEAPISBSetMessage From 5ea1db70aefc0014f066b98133000ffcf79fa5c6 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Tue, 30 Mar 2021 18:28:32 -0400 Subject: [PATCH 26/27] IC:2021-03-30, add missing doxygen group closing --- modules/core_api/fsw/inc/cfe_sb.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/core_api/fsw/inc/cfe_sb.h b/modules/core_api/fsw/inc/cfe_sb.h index 4b8e03b87..ebcdc01bb 100644 --- a/modules/core_api/fsw/inc/cfe_sb.h +++ b/modules/core_api/fsw/inc/cfe_sb.h @@ -463,7 +463,7 @@ CFE_Status_t CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenc ** \retval #CFE_SB_NO_MESSAGE \copybrief CFE_SB_NO_MESSAGE **/ CFE_Status_t CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr, CFE_SB_PipeId_t PipeId, int32 TimeOut); -/**@}*/ +/** @} */ /** @defgroup CFEAPISBZeroCopy cFE Zero Copy APIs * @{ @@ -564,6 +564,8 @@ CFE_Status_t CFE_SB_ReleaseMessageBuffer(CFE_SB_Buffer_t *BufPtr); **/ CFE_Status_t CFE_SB_TransmitBuffer(CFE_SB_Buffer_t *BufPtr, bool IncrementSequenceCount); +/** @} */ + /** @defgroup CFEAPISBSetMessage cFE Setting Message Characteristics APIs * @{ */ @@ -642,7 +644,7 @@ void CFE_SB_TimeStampMsg(CFE_MSG_Message_t *MsgPtr); */ int32 CFE_SB_MessageStringSet(char *DestStringPtr, const char *SourceStringPtr, size_t DestMaxSize, size_t SourceMaxSize); -/**@}*/ +/** @} */ /** @defgroup CFEAPIGetMessage cFE Getting Message Characteristics APIs * @{ @@ -725,7 +727,7 @@ size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr); */ int32 CFE_SB_MessageStringGet(char *DestStringPtr, const char *SourceStringPtr, const char *DefaultString, size_t DestMaxSize, size_t SourceMaxSize); -/**@}*/ +/** @} */ /** @defgroup CFEAPISBMessageID cFE Message ID APIs * @{ @@ -827,6 +829,6 @@ static inline CFE_SB_MsgId_t CFE_SB_ValueToMsgId(CFE_SB_MsgId_Atom_t MsgIdValue) CFE_SB_MsgId_t Result = CFE_SB_MSGID_WRAP_VALUE(MsgIdValue); return Result; } -/**@}*/ +/** @} */ #endif /* CFE_SB_H */ From 806fd877faf97fa53814426b39149e25142f6d69 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Thu, 1 Apr 2021 01:05:33 -0400 Subject: [PATCH 27/27] IC:2021-03-30, Bump to v6.8.0-rc1+dev484 --- README.md | 24 ++++++++++++++++++++++++ modules/core_api/fsw/inc/cfe_version.h | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc7e8f1ec..9dbc32c99 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,30 @@ The detailed cFE user's guide can be viewed at + ### Development Build: v6.8.0-rc1+dev436 - Adds a local definition of SOFTWARE_BIG/LITTLE_BIT_ORDER directly inside cfe_endian.h to provide a compatible symbol for apps that still require this. This allows CFE to build and run successfully when OSAL stops providing this in `common_types.h`. diff --git a/modules/core_api/fsw/inc/cfe_version.h b/modules/core_api/fsw/inc/cfe_version.h index 38e6db2b8..7c7a7a597 100644 --- a/modules/core_api/fsw/inc/cfe_version.h +++ b/modules/core_api/fsw/inc/cfe_version.h @@ -28,7 +28,7 @@ #define CFE_VERSION_H /* Development Build Macro Definitions */ -#define CFE_BUILD_NUMBER 436 /*!< Development Build: Number of commits since baseline */ +#define CFE_BUILD_NUMBER 484 /*!< Development Build: Number of commits since baseline */ #define CFE_BUILD_BASELINE \ "v6.8.0-rc1" /*!< Development Build: git tag that is the base for the current development \ */