Skip to content

Commit

Permalink
Merge pull request #381 from thnkslprpt/fix-274-cfe_psp.h-cleanup
Browse files Browse the repository at this point in the history
Part #274, Cleanup and add doxygen for cfe_psp.h
  • Loading branch information
dmknutsen committed Dec 14, 2023
2 parents 24849bb + 0d2f710 commit 49c3175
Show file tree
Hide file tree
Showing 26 changed files with 1,247 additions and 1,550 deletions.
887 changes: 693 additions & 194 deletions fsw/inc/cfe_psp.h

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions fsw/mcp750-vxworks/src/cfe_psp_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,12 @@ void CFE_PSP_ExceptionHook(TASK_ID task_id, int vector, void *vpEsf)
}
}

/*
**
** Purpose: This function sets a default exception environment that can be used
**
** Notes: The exception environment is local to each task Therefore this must be
** called for each task that that wants to do floating point and catch exceptions
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_SetDefaultExceptionEnvironment(void)
{
vxMsrSet(vxMsrGet() | _PPC_MSR_EE | /* enable the external interrupt */
Expand Down
2 changes: 1 addition & 1 deletion fsw/mcp750-vxworks/src/cfe_psp_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,4 +538,4 @@ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFES
}

return return_code;
}
}
20 changes: 6 additions & 14 deletions fsw/mcp750-vxworks/src/cfe_psp_ssr.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,12 @@
#include "cfe_psp.h"
#include "cfe_psp_memory.h"

/******************************************************************************
**
** Purpose:
** Initializes the Solid State Recorder device. For the MCP750, this simply
** initializes the Hard disk device.
**
** Arguments:
** bus, device, device name
**
** Return:
** (none)
*/

/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
int32 CFE_PSP_InitSSR(uint32 bus, uint32 device, char *DeviceName)
{
int32 ReturnCode;
Expand Down
118 changes: 36 additions & 82 deletions fsw/mcp750-vxworks/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,12 @@
*/
extern CFE_PSP_MemoryBlock_t MCP750_ReservedMemBlock;

/******************************************************************************
**
** Purpose:
** Provides a common interface to the processor reset.
**
** Arguments:
** reset_type : Type of reset.
**
** Return:
** (none)
*/

/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_Restart(uint32 reset_type)
{
if (reset_type == CFE_PSP_RST_TYPE_POWERON)
Expand All @@ -99,38 +93,24 @@ void CFE_PSP_Restart(uint32 reset_type)
}
}

/******************************************************************************
**
** Purpose:
** Provides a common interface to abort the cFE startup process and return
** back to the OS.
**
** Arguments:
** ErrorCode : Reason for Exiting.
**
** Return:
** (none)
*/

/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_Panic(int32 ErrorCode)
{
printf("%s called with error code = 0x%08X. Exiting.\n", __func__, (unsigned int)ErrorCode);
exit(-1); /* Need to improve this */
}

/******************************************************************************
**
** Purpose:
** Provides a common interface to flush the processor caches. This routine
** is in the BSP because it is sometimes implemented in hardware and
** sometimes taken care of by the RTOS.
**
** Arguments:
**
** Return:
** (none)
*/

/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_FlushCaches(uint32 type, void *address, uint32 size)
{
if (type == 1)
Expand All @@ -139,60 +119,34 @@ void CFE_PSP_FlushCaches(uint32 type, void *address, uint32 size)
}
}

/*
**
** Purpose:
** return the processor ID.
**
**
** Parameters:
**
** Global Inputs: None
**
** Global Outputs: None
**
**
**
** Return Values: Processor ID
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
uint32 CFE_PSP_GetProcessorId(void)
{
return CFE_PSP_CPU_ID;
}

/*
**
** Purpose:
** return the spacecraft ID.
**
** Parameters:
**
** Global Inputs: None
**
** Global Outputs: None
**
**
** Return Values: Spacecraft ID
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
uint32 CFE_PSP_GetSpacecraftId(void)
{
return CFE_PSP_SPACECRAFT_ID;
}

/*
**
** Purpose:
** return the processor name.
**
** Parameters:
**
** Global Inputs: None
**
** Global Outputs: None
**
**
** Return Values: Processor name
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
const char *CFE_PSP_GetProcessorName(void)
{
return CFE_PSP_CPU_NAME;
Expand Down
108 changes: 36 additions & 72 deletions fsw/mcp750-vxworks/src/cfe_psp_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@
*/
uint32 CFE_PSP_WatchdogValue = CFE_PSP_WATCHDOG_MAX;

/******************************************************************************
**
** Purpose:
** To setup the timer resolution and/or other settings custom to this platform.
**
** Arguments:
**
** Return:
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_WatchdogInit(void)
{
/*
Expand All @@ -91,15 +88,12 @@ void CFE_PSP_WatchdogInit(void)
CFE_PSP_WatchdogValue = CFE_PSP_WATCHDOG_MAX;
}

/******************************************************************************
**
** Purpose:
** Enable the watchdog timer
**
** Arguments:
**
** Return:
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_WatchdogEnable(void)
{
/* Arm the WDT2 control register */
Expand All @@ -109,15 +103,12 @@ void CFE_PSP_WatchdogEnable(void)
PCI_OUT_LONG(0xFEFF0068, 0xFFFFFFAA);
}

/******************************************************************************
**
** Purpose:
** Disable the watchdog timer
**
** Arguments:
**
** Return:
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_WatchdogDisable(void)
{
/* Arm the WDT2 control register */
Expand All @@ -127,23 +118,12 @@ void CFE_PSP_WatchdogDisable(void)
PCI_OUT_LONG(0xFEFF0068, 0xFFFF7FAA);
}

/******************************************************************************
**
** Purpose:
** Load the watchdog timer with a count that corresponds to the millisecond
** time given in the parameter.
**
** Arguments:
** None.
**
** Return:
** None
**
** Note:
** Currently an ExpireTime value of zero will result in the minimum reset time
** of 4.5 seconds. All other ExpireTime values will result in a reset time of
** 5.5 seconds. See comments below.
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_WatchdogService(void)
{
/* Arm the WDT2 control register */
Expand Down Expand Up @@ -171,39 +151,23 @@ void CFE_PSP_WatchdogService(void)
}
}

/******************************************************************************
**
** Purpose:
** Get the current watchdog value.
**
** Arguments:
** none
**
** Return:
** the current watchdog value
**
** Notes:
**
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
uint32 CFE_PSP_WatchdogGet(void)
{
return CFE_PSP_WatchdogValue;
}

/******************************************************************************
**
** Purpose:
** Get the current watchdog value.
**
** Arguments:
** The new watchdog value
**
** Return:
** nothing
**
** Notes:
**
*/
/*----------------------------------------------------------------
*
* Implemented per public API
* See description in header file for argument/return detail
*
*-----------------------------------------------------------------*/
void CFE_PSP_WatchdogSet(uint32 WatchdogValue)
{
CFE_PSP_WatchdogValue = WatchdogValue;
Expand Down
Loading

0 comments on commit 49c3175

Please sign in to comment.