Skip to content

Commit

Permalink
Update nasa#158, Minor fixes for cppcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jphickey committed May 5, 2020
1 parent fe5e019 commit 93990ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion fsw/pc-linux/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ void OS_Application_Startup(void)
*/
CFE_PSP_SpacecraftId = CommandData.SpacecraftId;
CFE_PSP_CpuId = CommandData.CpuId;
strncpy(CFE_PSP_CpuName, CommandData.CpuName, CFE_PSP_CPU_NAME_LENGTH);
strncpy(CFE_PSP_CpuName, CommandData.CpuName, sizeof(CFE_PSP_CpuName)-1);
CFE_PSP_CpuName[sizeof(CFE_PSP_CpuName)-1] = 0;

/*
** Set the reset subtype
Expand Down
7 changes: 7 additions & 0 deletions fsw/pc-rtems/src/cfe_psp_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ void CFE_PSP_SetupReservedMemoryMap(void)
CFE_PSP_ReservedMemoryMap.UserReservedMemory.BlockSize = CFE_PSP_USER_RESERVED_SIZE;
ReservedMemoryAddr += UserReservedSize;

/*
* displaying the final address shows how much was actually used,
* and additionally avoids a warning about the result of the final increment not being used.
* (prefer this over removing the increment, as it is safer if another block is added)
*/
OS_printf("CFE_PSP: PSP reserved memory ends at: 0x%08lX\n",
(unsigned long)ReservedMemoryAddr);
}

/******************************************************************************
Expand Down
12 changes: 1 addition & 11 deletions fsw/pc-rtems/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,7 @@ extern CFE_PSP_MemoryBlock_t PcRtems_ReservedMemBlock;
void CFE_PSP_Restart(uint32 reset_type)
{

if ( reset_type == CFE_PSP_RST_TYPE_POWERON )
{
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
/* reboot(BOOT_CLEAR); Need RTEMS equiv. */
}
else
{
CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
/* reboot(BOOT_NORMAL); Need RTEMS Equiv */
}

CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize);
OS_printf("CFE_PSP_Restart is not implemented on this platform ( yet ! )\n");
exit(-1);

Expand Down

0 comments on commit 93990ef

Please sign in to comment.