Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #965, remove OSAL ID from App/LibInfo struct #1017

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions fsw/cfe-core/src/es/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_ResourceID_t AppId)
CFE_ES_AppRecord_t *AppRecPtr;
CFE_ES_TaskRecord_t *TaskRecPtr;
int32 Status;
osal_id_t ModuleId;
uint32 i;

if ( AppInfo == NULL )
Expand All @@ -979,6 +980,7 @@ int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_ResourceID_t AppId)
}

memset(AppInfo, 0, sizeof(*AppInfo));
ModuleId = OS_OBJECT_ID_UNDEFINED;

AppRecPtr = CFE_ES_LocateAppRecordByID(AppId);

Expand Down Expand Up @@ -1007,6 +1009,8 @@ int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_ResourceID_t AppId)
AppInfo->Priority = AppRecPtr->StartParams.Priority;
AppInfo->MainTaskId = AppRecPtr->MainTaskId;

ModuleId = AppRecPtr->ModuleInfo.ModuleId;

/*
** Calculate the number of child tasks
*/
Expand Down Expand Up @@ -1044,7 +1048,7 @@ int32 CFE_ES_GetAppInfo(CFE_ES_AppInfo_t *AppInfo, CFE_ES_ResourceID_t AppId)
*/
if (Status == CFE_SUCCESS)
{
CFE_ES_CopyModuleAddressInfo(AppInfo->ModuleId, AppInfo);
CFE_ES_CopyModuleAddressInfo(ModuleId, AppInfo);
}

return Status;
Expand All @@ -1057,13 +1061,17 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_ResourceID_t LibId)
{
int32 Status;
CFE_ES_LibRecord_t *LibRecPtr;
osal_id_t ModuleId;

if ( LibInfo == NULL )
{
CFE_ES_WriteToSysLog("CFE_ES_GetLibInfo: Invalid Parameter ( Null Pointer )\n");
return CFE_ES_ERR_BUFFER;
}

memset(LibInfo, 0, sizeof(*LibInfo));
ModuleId = OS_OBJECT_ID_UNDEFINED;

LibRecPtr = CFE_ES_LocateLibRecordByID(LibId);

CFE_ES_LockSharedData(__func__,__LINE__);
Expand All @@ -1086,6 +1094,8 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_ResourceID_t LibId)
CFE_ES_CopyModuleBasicInfo(&LibRecPtr->BasicInfo, LibInfo);
CFE_ES_CopyModuleStatusInfo(&LibRecPtr->ModuleInfo, LibInfo);

ModuleId = LibRecPtr->ModuleInfo.ModuleId;

Status = CFE_SUCCESS;
}

Expand All @@ -1096,7 +1106,7 @@ int32 CFE_ES_GetLibInfo(CFE_ES_AppInfo_t *LibInfo, CFE_ES_ResourceID_t LibId)
*/
if (Status == CFE_SUCCESS)
{
CFE_ES_CopyModuleAddressInfo(LibInfo->ModuleId, LibInfo);
CFE_ES_CopyModuleAddressInfo(ModuleId, LibInfo);
}

return Status;
Expand Down
1 change: 0 additions & 1 deletion fsw/cfe-core/src/es/cfe_es_apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,6 @@ void CFE_ES_CopyModuleBasicInfo(const CFE_ES_ModuleLoadParams_t *ParamsPtr, CFE_
*/
void CFE_ES_CopyModuleStatusInfo(const CFE_ES_ModuleLoadStatus_t *StatusPtr, CFE_ES_AppInfo_t *AppInfoPtr)
{
AppInfoPtr->ModuleId = StatusPtr->ModuleId;
CFE_SB_SET_MEMADDR(AppInfoPtr->StartAddress, StatusPtr->EntryAddress);
}

Expand Down
2 changes: 0 additions & 2 deletions fsw/cfe-core/src/inc/cfe_es_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,6 @@ typedef struct CFE_ES_AppInfo

CFE_ES_MemOffset_t StackSize; /**< \cfetlmmnemonic \ES_STACKSIZE
\brief The Stack Size of the Application */
osal_id_t ModuleId; /**< \cfetlmmnemonic \ES_MODULEID
\brief The ID of the Loadable Module for the Application */
uint32 AddressesAreValid; /**< \cfetlmmnemonic \ES_ADDRVALID
\brief Indicates that the Code, Data, and BSS addresses/sizes are valid */
CFE_ES_MemAddress_t CodeAddress; /**< \cfetlmmnemonic \ES_CODEADDR
Expand Down