Skip to content

Commit

Permalink
CCB 20191218: Merge #118 #120
Browse files Browse the repository at this point in the history
Fix #117, #119
Reviewed and approved at 2019-12-18 CCB
  • Loading branch information
skliper committed Dec 30, 2019
2 parents 502e83a + c6cd4eb commit 980b27e
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 33 deletions.
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
dist: bionic
sudo: required
language:
- c
compiler:
- gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake

before_install:
- sudo apt-get install cppcheck

script:
# Check versions
- cppcheck --version

#cppcheck flight software psp/fsw
- cppcheck --force --inline-suppr --std=c99 --language=c --error-exitcode=1 --enable=warning,performance,portability,style --suppress=variableScope --inconclusive fsw 2>cppcheck_flight_psp.txt
- |
if [[ -s cppcheck_flight_psp.txt ]]; then
echo "You must fix cppcheck errors before submitting a pull request"
echo ""
cat cppcheck_flight_psp.txt
exit -1
fi
2 changes: 1 addition & 1 deletion fsw/mcp750-vxworks/src/cfe_psp_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ char CFE_PSP_ExceptionReasonString[256];
**
*/

void CFE_PSP_ExceptionHook ( TASK_ID task_id, int vector, void* pEsf );
void CFE_PSP_ExceptionHook ( TASK_ID task_id, int vector, void* vpEsf );


/***************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion fsw/modules/eeprom_mmap_file/cfe_psp_eeprom_mmap_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void eeprom_mmap_file_Init(uint32 PspModuleId)
*/
Status = CFE_PSP_MemRangeSet (1, CFE_PSP_MEM_EEPROM, eeprom_address,
eeprom_size, CFE_PSP_MEM_SIZE_DWORD, 0 );
OS_printf("CFE_PSP: EEPROM Range (2) created: Start Address = %08lX, Size = %08X\n", (unsigned long)eeprom_address, (unsigned int)eeprom_size);
OS_printf("CFE_PSP: EEPROM Range (2) created: Start Address = %08lX, Size = %08X Status = %d\n", (unsigned long)eeprom_address, (unsigned int)eeprom_size, Status);

}
else
Expand Down
38 changes: 28 additions & 10 deletions fsw/pc-linux/src/cfe_psp_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,19 +674,37 @@ int32 CFE_PSP_InitProcessorReservedMemory( uint32 RestartType )
tempFd = open(CFE_PSP_RESERVED_KEY_FILE, O_RDONLY | O_CREAT, S_IRWXU );
close(tempFd);

if ( RestartType == CFE_PSP_RST_TYPE_PROCESSOR )

return_code = CFE_PSP_InitCDS( RestartType );
if (return_code != CFE_PSP_SUCCESS)
{
OS_printf("CFE_PSP_InitCDS didn't return success (%d)\n", return_code);

return(return_code);
}

return_code = CFE_PSP_InitResetArea( RestartType );
if (return_code != CFE_PSP_SUCCESS)
{
OS_printf("CFE_PSP_InitResetArea didn't return success (%d)\n", return_code);

return(return_code);
}

return_code = CFE_PSP_InitVolatileDiskMem( RestartType );
if (return_code != CFE_PSP_SUCCESS)
{
return_code = CFE_PSP_InitCDS( CFE_PSP_RST_TYPE_PROCESSOR );
return_code = CFE_PSP_InitResetArea( CFE_PSP_RST_TYPE_PROCESSOR );
return_code = CFE_PSP_InitVolatileDiskMem( CFE_PSP_RST_TYPE_PROCESSOR );
return_code = CFE_PSP_InitUserReservedArea( CFE_PSP_RST_TYPE_PROCESSOR );
OS_printf("CFE_PSP_InitVolatileDiskMem didn't return success (%d)\n", return_code);

return(return_code);
}
else

return_code = CFE_PSP_InitUserReservedArea( RestartType );
if (return_code != CFE_PSP_SUCCESS)
{
return_code = CFE_PSP_InitCDS( CFE_PSP_RST_TYPE_POWERON );
return_code = CFE_PSP_InitResetArea( CFE_PSP_RST_TYPE_POWERON );
return_code = CFE_PSP_InitVolatileDiskMem( CFE_PSP_RST_TYPE_POWERON );
return_code = CFE_PSP_InitUserReservedArea( CFE_PSP_RST_TYPE_POWERON );
OS_printf("CFE_PSP_InitVolatileDiskMem didn't return success (%d)\n", return_code);

return(return_code);
}

return(return_code);
Expand Down
8 changes: 6 additions & 2 deletions fsw/pc-linux/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,12 @@ int main(int argc, char *argv[])
/*
** Initialize the reserved memory
*/
CFE_PSP_InitProcessorReservedMemory(reset_type);

Status = CFE_PSP_InitProcessorReservedMemory(reset_type);
if (Status != CFE_PSP_SUCCESS)
{
OS_printf("CFE_PSP: CFE_PSP_InitProcessorReservedMemory() Failure");
CFE_PSP_Panic(Status);
}

/*
** Call cFE entry point.
Expand Down
18 changes: 1 addition & 17 deletions fsw/pc-rtems/src/cfe_psp_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,7 @@ void CFE_PSP_AttachExceptions(void)
void CFE_PSP_ExceptionHook (int task_id, int vector, int32 *pEsf )
{

char TaskName[16];

/*
** Get the task name
*/
strncpy(TaskName, "TBD", 16);

if ( TaskName == NULL )
{
sprintf(CFE_PSP_ExceptionReasonString, "Exception: Vector=0x%06X, vxWorks Task Name=NULL, Task ID=0x%08X",
vector,task_id);
}
else
{
sprintf(CFE_PSP_ExceptionReasonString, "Exception: Vector=0x%06X, vxWorks Task Name=%s, Task ID=0x%08X",
vector, TaskName, task_id);
}
sprintf(CFE_PSP_ExceptionReasonString, "Not Implemented");

/*
** Save Exception Stack frame
Expand Down
4 changes: 2 additions & 2 deletions fsw/shared/cfe_psp_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int32 CFE_PSP_Module_GetAPIEntry(uint32 PspModuleId, CFE_PSP_ModuleApi_t **API)
*
* See prototype for full description
*/
int32 CFE_PSP_Module_FindByName(const char *DriverName, uint32 *PspModuleId)
int32 CFE_PSP_Module_FindByName(const char *ModuleName, uint32 *PspModuleId)
{
uint32 i;
int32 Result;
Expand All @@ -119,7 +119,7 @@ int32 CFE_PSP_Module_FindByName(const char *DriverName, uint32 *PspModuleId)
i = 0;
while (i < CFE_PSP_ModuleCount)
{
if (strcmp(Entry->Name, DriverName) == 0)
if (strcmp(Entry->Name, ModuleName) == 0)
{
*PspModuleId = CFE_PSP_MODULE_BASE | (i & CFE_PSP_MODULE_INDEX_MASK);
Result = CFE_PSP_SUCCESS;
Expand Down

0 comments on commit 980b27e

Please sign in to comment.