diff --git a/fsw/inc/cfe_psp.h b/fsw/inc/cfe_psp.h index 91f7e580..478c9dcc 100644 --- a/fsw/inc/cfe_psp.h +++ b/fsw/inc/cfe_psp.h @@ -32,18 +32,18 @@ #ifndef CFE_PSP_H #define CFE_PSP_H -/* -** Include Files -*/ +/****************************************************************************** + INCLUDE FILES + ******************************************************************************/ #include "common_types.h" #include "osapi.h" #include "cfe_psp_error.h" -/* -** Macro Definitions -*/ +/****************************************************************************** + MACRO DEFINITIONS + ******************************************************************************/ /* ** Definitions for PSP PANIC types @@ -89,7 +89,7 @@ /* * Common definition for reset types at the PSP layer */ -/** \name Reset Types */ +/** @name Reset Types */ /** \{ */ #define CFE_PSP_RST_TYPE_PROCESSOR 1 /**< Volatile disk, CDS and User Reserved memory may be valid */ #define CFE_PSP_RST_TYPE_POWERON 2 /**< All memory has been cleared */ @@ -99,344 +99,841 @@ /* ** Reset Sub-Types */ -/** \name Reset Sub-Types */ +/** @name Reset Sub-Types */ /** \{ */ -/** \brief Reset caused by power having been removed and restored */ +/** @brief Reset caused by power having been removed and restored */ #define CFE_PSP_RST_SUBTYPE_POWER_CYCLE 1 -/** \brief Reset caused by reset button on the board */ +/** @brief Reset caused by reset button on the board */ #define CFE_PSP_RST_SUBTYPE_PUSH_BUTTON 2 -/** \brief Reset was caused by a reset line having been stimulated by a hardware special command */ +/** @brief Reset was caused by a reset line having been stimulated by a hardware special command */ #define CFE_PSP_RST_SUBTYPE_HW_SPECIAL_COMMAND 3 -/** \brief Reset was caused by a watchdog timer expiring */ +/** @brief Reset was caused by a watchdog timer expiring */ #define CFE_PSP_RST_SUBTYPE_HW_WATCHDOG 4 -/** \brief Reset was caused by cFE ES processing a \link #CFE_ES_RESTART_CC Reset Command \endlink */ +/** @brief Reset was caused by cFE ES processing a @link #CFE_ES_RESTART_CC Reset Command @endlink */ #define CFE_PSP_RST_SUBTYPE_RESET_COMMAND 5 -/** \brief Reset was caused by a Processor Exception */ +/** @brief Reset was caused by a Processor Exception */ #define CFE_PSP_RST_SUBTYPE_EXCEPTION 6 -/** \brief Reset was caused in an unknown manner */ +/** @brief Reset was caused in an unknown manner */ #define CFE_PSP_RST_SUBTYPE_UNDEFINED_RESET 7 -/** \brief Reset was caused by a JTAG or BDM connection */ +/** @brief Reset was caused by a JTAG or BDM connection */ #define CFE_PSP_RST_SUBTYPE_HWDEBUG_RESET 8 -/** \brief Reset reverted to a cFE POWERON due to a boot bank switch */ +/** @brief Reset reverted to a cFE POWERON due to a boot bank switch */ #define CFE_PSP_RST_SUBTYPE_BANKSWITCH_RESET 9 -/** \brief Placeholder to indicate 1+ the maximum value that the PSP will ever use. */ +/** @brief Placeholder to indicate 1+ the maximum value that the PSP will ever use. */ #define CFE_PSP_RST_SUBTYPE_MAX 10 /** \} */ /** - * \brief The name of the software/RTOS timebase for general system timers. + * @brief The name of the software/RTOS timebase for general system timers. * * This name may be referred to by CFE TIME and/or SCH when setting up its own timers. */ #define CFE_PSP_SOFT_TIMEBASE_NAME "cFS-Master" -/* -** Type Definitions -*/ - -/* -** Function prototypes -*/ +/****************************************************************************** + FUNCTION PROTOTYPES + ******************************************************************************/ /* ** PSP entry point and reset routines */ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief PSP Entry Point to initialize the OSAL and start up the cFE + * + * This is the entry point that the real-time OS calls to start our software. + * This routine will do any BSP/OS-specific setup, then call the entry point of + * the flight software (i.e. the cFE main entry point). + * + * @note The flight software (i.e. cFE) should not call this routine. + */ extern void CFE_PSP_Main(void); -/* -** CFE_PSP_Main is the entry point that the real time OS calls to start our -** software. This routine will do any BSP/OS specific setup, then call the -** entrypoint of the flight software ( i.e. the cFE main entry point ). -** The flight software (i.e. cFE ) should not call this routine. -*/ - +/*--------------------------------------------------------------------------------------*/ /** - * \brief Sample/Read a monotonic platform clock with normalization + * @brief Sample/Read a monotonic platform clock with normalization * - * Outputs an OS_time_t value indicating the time elapsed since an epoch. The - * epoch is not defined, but typically represents the system boot time. The + * Outputs an OS_time_t value indicating the time elapsed since an epoch. The + * epoch is not defined, but typically represents the system boot time. The * value increases continuously over time and cannot be reset by software. * * This is similar to the CFE_PSP_Get_Timebase(), but additionally it normalizes - * the output value to an OS_time_t, thereby providing consistent units to - * the calling application. Any OSAL-provided routine accepts OS_time_t inputs + * the output value to an OS_time_t, thereby providing consistent units to the + * calling application. Any OSAL-provided routine that accepts OS_time_t inputs * may be used to convert this value into other standardized time units. * - * \note This should refer to the same time domain as CFE_PSP_Get_Timebase(), + * @note This should refer to the same time domain as CFE_PSP_Get_Timebase(), * the primary difference being the format and units of the output value. * - * \sa CFE_PSP_Get_Timebase() + * @sa CFE_PSP_Get_Timebase() * - * \param[out] LocalTime Value of PSP tick counter as OS_time_t + * @param[out] LocalTime Value of PSP tick counter as OS_time_t */ extern void CFE_PSP_GetTime(OS_time_t *LocalTime); +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Entry point back to the BSP to restart the processor. + * + * The flight software calls this routine to restart the processor. + * + * @param[in] resetType Type of reset + */ extern void CFE_PSP_Restart(uint32 resetType); -/* -** CFE_PSP_Restart is the entry point back to the BSP to restart the processor. -** The flight software calls this routine to restart the processor. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the last reset type + * + * @note If a pointer to a valid memory space is passed in, it returns the reset + * sub-type in that memory. Right now the reset types are application-specific. + * For the cFE they are defined in the cfe_es.h file. + * + * @param restartSubType + */ extern uint32 CFE_PSP_GetRestartType(uint32 *restartSubType); -/* -** CFE_PSP_GetRestartType returns the last reset type and if a pointer to a valid -** memory space is passed in, it returns the reset sub-type in that memory. -** Right now the reset types are application specific. For the cFE they -** are defined in the cfe_es.h file. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief This is a BSP-specific cache flush routine + * + * 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. + * + * @param[in] type + * @param[in] address + * @param[in] size + */ extern void CFE_PSP_FlushCaches(uint32 type, void *address, uint32 size); -/* -** This is a BSP specific cache flush routine -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the CPU ID as defined by the specific board and BSP. + * + * @return The processor ID + */ extern uint32 CFE_PSP_GetProcessorId(void); -/* -** CFE_PSP_GetProcessorId returns the CPU ID as defined by the specific board -** and BSP. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the Spacecraft ID (if any) + * + * @return The Spacecraft ID + */ extern uint32 CFE_PSP_GetSpacecraftId(void); -/* -** CFE_PSP_GetSpacecraftId returns the Spacecraft ID (if any ) -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the processor name + * + * @return The processor name + */ extern const char *CFE_PSP_GetProcessorName(void); -/* -** CFE_PSP_GetProcessorName returns the processor name -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the underlying OS timer tick value + * + * It is used for the performance monitoring software + */ extern uint32 CFE_PSP_Get_Timer_Tick(void); -/* -** CFE_PSP_Get_Timer_Tick returns the underlying OS timer tick value -** It is used for the performance monitoring software -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * Provides the resolution of the least significant 32 bits of the 64-bit time + * stamp returned by CFE_PSP_Get_Timebase in timer ticks per second. The timer + * resolution for accuracy should not be any slower than 1000000 ticks per + * second or 1 us (microsecond) per tick + * + * @return The number of timer ticks per second of the time stamp returned by + * CFE_PSP_Get_Timebase + */ extern uint32 CFE_PSP_GetTimerTicksPerSecond(void); -/* -** CFE_PSP_GetTimerTicksPerSecond provides the resolution of the least significant -** 32 bits of the 64 bit time stamp returned by CFE_PSP_Get_Timebase in timer -** ticks per second. The timer resolution for accuracy should not be any slower -** than 1000000 ticks per second or 1 us per tick -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * Provides the number that the least significant 32 bits of the 64-bit time + * stamp returned by CFE_PSP_Get_Timebase rolls over. If the lower 32 bits rolls + * at 1 second, then the CFE_PSP_TIMER_LOW32_ROLLOVER will be 1000000. If the + * lower 32 bits rolls at its maximum value (2^32) then + * CFE_PSP_TIMER_LOW32_ROLLOVER will be 0. + * + * @return The number that the least significant 32 bits of the 64-bit time + * stamp returned by CFE_PSP_Get_Timebase rolls over. + */ extern uint32 CFE_PSP_GetTimerLow32Rollover(void); -/* -** CFE_PSP_GetTimerLow32Rollover provides the number that the least significant -** 32 bits of the 64 bit time stamp returned by CFE_PSP_Get_Timebase rolls over. -** If the lower 32 bits rolls at 1 second, then the CFE_PSP_TIMER_LOW32_ROLLOVER -** will be 1000000. if the lower 32 bits rolls at its maximum value (2^32) then -** CFE_PSP_TIMER_LOW32_ROLLOVER will be 0. -*/ /** - * \brief Sample/Read a monotonic platform clock without normalization + * @brief Sample/Read a monotonic platform clock without normalization * - * This is defined as a free-running, monotonically-increasing tick counter. The - * epoch is not defined, but typically is the system boot time, and the value increases - * indefinitely as the system runs. The tick period/rate is also not defined. + * Provides a common interface to system timebase. This routine is in the BSP + * because it is sometimes implemented in hardware and sometimes taken care of + * by the RTOS. + * + * This is defined as a free-running, monotonically-increasing tick counter. The + * epoch is not defined, but typically is the system boot time, and the value + * increases indefinitely as the system runs. The tick period/rate is also not + * defined. * * Rollover events - where the range of representable values is exceeded - are - * theoretically possible, but would take many years of continuous uptime to occur - * (typically hundreds of years, if not thousands). System designers should ensure - * that the actual tick rate and resulting timebase range is sufficiently large to - * ensure that rollover is not a concern. + * theoretically possible, but would take many years of continuous uptime to + * occur (typically hundreds of years, if not thousands). System designers + * should ensure that the actual tick rate and resulting timebase range is + * sufficiently large to ensure that rollover is not a concern. * - * \note This is a "raw" value from the underlying platform with minimal/no conversions - * or normalization applied. Neither the epoch nor the resolution of this tick - * counter is specified, and it may vary from platform to platform. Use the - * CFE_PSP_GetTime() function to sample the timebase and also convert the units - * into a normalized/more consistent form. + * @note This is a "raw" value from the underlying platform with minimal/no + * conversions or normalization applied. Neither the epoch nor the resolution of + * this tick counter is specified, and it may vary from platform to platform. + * Use the CFE_PSP_GetTime() function to sample the timebase and also convert + * the units into a normalized/more consistent form. * - * \sa CFE_PSP_GetTime() + * @sa CFE_PSP_GetTime() * - * \param[out] Tbu Buffer to hold the upper 32 bits of a 64-bit tick counter - * \param[out] Tbl Buffer to hold the lower 32 bits of a 64-bit tick counter + * @param[out] Tbu Buffer to hold the upper 32 bits of a 64-bit tick counter + * @param[out] Tbl Buffer to hold the lower 32 bits of a 64-bit tick counter */ extern void CFE_PSP_Get_Timebase(uint32 *Tbu, uint32 *Tbl); +/*--------------------------------------------------------------------------------------*/ +/** + * @brief CFE_PSP_Get_Dec + */ extern uint32 CFE_PSP_Get_Dec(void); -/* -** CFE_PSP_Get_Dec -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Fetches the size of the OS Critical Data Store area. + * + * @param[out] SizeOfCDS Pointer to the variable that will store the size of the CDS + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_GetCDSSize(uint32 *SizeOfCDS); -/* -** CFE_PSP_GetCDSSize fetches the size of the OS Critical Data Store area. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Writes to the CDS Block. + * + * @param[in] PtrToDataToWrite Pointer to the data that will be written to the CDS + * @param[in] CDSOffset CDS offset + * @param[in] NumBytes Number of bytes to write + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_WriteToCDS(const void *PtrToDataToWrite, uint32 CDSOffset, uint32 NumBytes); -/* -** CFE_PSP_WriteToCDS writes to the CDS Block. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Reads from the CDS Block + * + * @param[out] PtrToDataToRead Pointer to the location that will store the data to be read from the CDS + * @param[in] CDSOffset CDS offset + * @param[in] NumBytes Number of bytes to read + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumBytes); -/* -** CFE_PSP_ReadFromCDS reads from the CDS Block -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the location and size of the ES Reset information area. + * + * This area is preserved during a processor reset and is used to store the ER + * Log, System Log and reset-related variables + * + * @param[out] PtrToResetArea Pointer to the variable that will store the location of the reset area + * @param[out] SizeOfResetArea Pointer to the variable that will store the reset area size + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_GetResetArea(cpuaddr *PtrToResetArea, uint32 *SizeOfResetArea); -/* -** CFE_PSP_GetResetArea returns the location and size of the ES Reset information area. -** This area is preserved during a processor reset and is used to store the -** ER Log, System Log and reset related variables -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the location and size of the memory used for the cFE user-reserved area. + * + * @param[out] PtrToUserArea Pointer to the variable that will store the location of the user-reserved area + * @param[out] SizeOfUserArea Pointer to the variable that will store the size of the user-reserved area + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_GetUserReservedArea(cpuaddr *PtrToUserArea, uint32 *SizeOfUserArea); -/* -** CFE_PSP_GetUserReservedArea returns the location and size of the memory used for the cFE -** User reserved area. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the location and size of the memory used for the cFE volatile disk. + * + * @param[out] PtrToVolDisk Pointer to the variable that will store the location of the cFE volatile disk + * @param[out] SizeOfVolDisk Pointer to the variable that will store the size of the cFE volatile disk + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk); -/* -** CFE_PSP_GetVolatileDiskMem returns the location and size of the memory used for the cFE -** volatile disk. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the location and size of the kernel memory. + * + * This function returns the start and end address of the kernel text segment. + * It may not be implemented on all architectures. + * + * @param[out] PtrToKernelSegment Pointer to the variable that will store the location of the kernel text segment + * @param[out] SizeOfKernelSegment Pointer to the variable that will store the size of the kernel text segment + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + * or CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ extern int32 CFE_PSP_GetKernelTextSegmentInfo(cpuaddr *PtrToKernelSegment, uint32 *SizeOfKernelSegment); -/* -** CFE_PSP_GetKernelTextSegmentInfo returns the location and size of the kernel memory. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the location and size of the kernel memory. + * + * This function returns the start and end address of the CFE text segment. It + * may not be implemented on all architectures. + * + * @param[out] PtrToCFESegment Pointer to the variable that will store the location of the cFE text segment + * @param[out] SizeOfCFESegment Pointer to the variable that will store the size of the cFE text segment + * + * @return 0 (OS_SUCCESS or CFE_PSP_SUCCESS) on success, -1 (OS_ERROR or CFE_PSP_ERROR) on error + */ extern int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFESegment); -/* -** CFE_PSP_GetCFETextSegmentInfo returns the location and size of the kernel memory. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Configures the watchdog timer. + * + * To set up the timer resolution and/or other settings custom to this platform. + */ extern void CFE_PSP_WatchdogInit(void); -/* -** CFE_PSP_WatchdogInit configures the watchdog timer. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Enables the watchdog timer. + */ extern void CFE_PSP_WatchdogEnable(void); -/* -** CFE_PSP_WatchdogEnable enables the watchdog timer. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Disables the watchdog timer. + */ extern void CFE_PSP_WatchdogDisable(void); -/* -** CFE_PSP_WatchdogDisable disables the watchdog timer. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Services the watchdog timer according to the value set in WatchDogSet. + * + * Load the watchdog timer with a count that corresponds to the millisecond + * time given in the parameter. + * + * @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. + */ extern void CFE_PSP_WatchdogService(void); -/* -** CFE_PSP_WatchdogService services the watchdog timer according to the -** value set in WatchDogSet. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Gets the watchdog time in milliseconds + * + * @return The current watchdog value + */ extern uint32 CFE_PSP_WatchdogGet(void); -/* -** CFE_PSP_WatchdogGet gets the watchdog time in milliseconds -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Sets the watchdog time in milliseconds + * + * @param[in] WatchdogValue New watchdog value to set + */ extern void CFE_PSP_WatchdogSet(uint32 WatchdogValue); -/* -** CFE_PSP_WatchdogSet sets the watchdog time in milliseconds -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Aborts the cFE startup + * + * Provides a common interface to abort the cFE startup process and return back + * to the OS. + * + * @note This is called by the cFE Core startup code when it needs to abort the + * cFE startup. This should not be called by applications. + * + * @param[in] ErrorCode Reason for exiting + */ extern void CFE_PSP_Panic(int32 ErrorCode); -/* -** CFE_PSP_Panic is called by the cFE Core startup code when it needs to abort the -** cFE startup. This should not be called by applications. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Initializes the Solid State recorder memory for a particular platform + * + * @note For the MCP750, this simply initializes the Hard Disk device. + * + * @param[in] bus + * @param[in] device + * @param[in] DeviceName + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR on error + */ extern int32 CFE_PSP_InitSSR(uint32 bus, uint32 device, char *DeviceName); -/* -** CFE_PSP_InitSSR will initialize the Solid state recorder memory for a particular platform -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Uncompresses the source file to the file specified in the destination file name. + * + * @note The Decompress uses the "gzip" algorithm. Files can be compressed + * using the "gzip" program available on almost all host platforms. + * + * @param srcFileName Source file to decompress + * @param dstFileName Destination file name + */ extern int32 CFE_PSP_Decompress(char *srcFileName, char *dstFileName); -/* -** CFE_PSP_Decompress will uncompress the source file to the file specified in the -** destination file name. The Decompress uses the "gzip" algorithm. Files can -** be compressed using the "gzip" program available on almost all host platforms. -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Sets up the exception environment for the chosen platform + * + * On a board, this can be configured to look at a debug flag or switch in order + * to keep the standard OS exception handlers, rather than restarting the system. + */ extern void CFE_PSP_AttachExceptions(void); -/* -** CFE_PSP_AttachExceptions will setup the exception environment for the chosen platform -** On a board, this can be configured to look at a debug flag or switch in order to -** keep the standard OS exeption handlers, rather than restarting the system -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Defines the CPU and FPU exceptions that are enabled for each cFE Task/App + * + * This function sets a default exception environment that can be used + * + * @note The exception environment is local to each task. Therefore, this must + * be Called for each task that wants to do floating point and catch exceptions. + */ extern void CFE_PSP_SetDefaultExceptionEnvironment(void); -/* -** -** CFE_PSP_SetDefaultExceptionEnvironment defines the CPU and FPU exceptions that are enabled for each cFE Task/App -** -** 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 -*/ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the unread exception count + * + * @return The unread exception count + */ extern uint32 CFE_PSP_Exception_GetCount(void); -extern int32 CFE_PSP_Exception_GetSummary(uint32 *ContextLogId, osal_id_t *TaskId, char *ReasonBuf, uint32 ReasonSize); -extern int32 CFE_PSP_Exception_CopyContext(uint32 ContextLogId, void *ContextBuf, uint32 ContextSize); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Retrieves a summary of an exception log entry + * + * @note This function returns CFE_PSP_SUCCESS to indicate that an entry was + * popped from the queue. This doesn't necessarily mean that the output fields + * have valid data, but it does mean they are initialized to something. + * + * @param[in] ContextLogId ID of the exception log entry to get a summary for + * @param[in, out] TaskId Pointer to the TaskID buffer + * @param[out] ReasonBuf Pointer to the buffer that will store the exception summary string + * @param[in] ReasonSize Maximum size of the summary string to retrieve + * + * @retval CFE_PSP_SUCCESS on success (see note above) + * @retval CFE_PSP_NO_EXCEPTION_DATA if no context available for reading + */ +extern int32 CFE_PSP_Exception_GetSummary(uint32 *ContextLogId, osal_id_t *TaskId, char *ReasonBuf, uint32 ReasonSize); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Retrieves exception log entry context information + * + * @param[in] ContextLogId ID of the exception log entry to copy + * @param[out] ContextBuf Pointer to the buffer where the context information is to be copied to + * @param[in] ContextSize Maximum size of context information data to copy + * + * @return Size of the copied data + * @retval CFE_PSP_NO_EXCEPTION_DATA if data has expired from the memory log + */ +extern int32 CFE_PSP_Exception_CopyContext(uint32 ContextLogId, void *ContextBuf, uint32 ContextSize); /* ** I/O Port API */ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Read one byte of memory. + * + * @param[in] PortAddress Address to be read + * @param[out] ByteValue The address content will be copied to the location pointed to by this argument + * + * @return Always returns CFE_PSP_SUCCESS (if implemented) + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_PortRead8(cpuaddr PortAddress, uint8 *ByteValue); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write one byte of memory. + * + * @param[out] PortAddress Address to be written to + * @param[in] ByteValue The content pointed to by this argument will be copied to the address + * + * @return Always returns CFE_PSP_SUCCESS (if implemented) + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_PortWrite8(cpuaddr PortAddress, uint8 ByteValue); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Read 2 bytes of memory. + * + * @param[in] PortAddress Address to be read + * @param[out] uint16Value The address content will be copied to the location pointed to by this argument + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_PortRead16(cpuaddr PortAddress, uint16 *uint16Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write 2 bytes of memory. + * + * @param[out] PortAddress Address to be written to + * @param[in] uint16Value the content pointed to by this argument will be copied to the address + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_PortWrite16(cpuaddr PortAddress, uint16 uint16Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Read 4 bytes of memory. + * + * @param[in] PortAddress Address to be read + * @param[out] uint32Value The address content will be copied to the location pointed to by this argument + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_PortRead32(cpuaddr PortAddress, uint32 *uint32Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write 4 bytes of memory. + * + * @param[out] PortAddress Address to be written to + * @param[in] uint32Value The content pointed to by this argument will be copied to the address + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_PortWrite32(cpuaddr PortAddress, uint32 uint32Value); /* ** Memory API */ +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Read one byte of memory. + * + * @param[in] MemoryAddress Address to be read + * @param[out] ByteValue The address content will be copied to the location pointed to by this argument + * + * @return Always returns CFE_PSP_SUCCESS (if implemented) + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_MemRead8(cpuaddr MemoryAddress, uint8 *ByteValue); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write one byte of memory. + * + * @param[out] MemoryAddress Address to be written to + * @param[in] ByteValue The content pointed to by this argument will be copied to the address + * + * @return Always returns CFE_PSP_SUCCESS (if implemented) + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_MemWrite8(cpuaddr MemoryAddress, uint8 ByteValue); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Read 2 bytes of memory. + * + * @param[in] MemoryAddress Address to be read + * @param[out] uint16Value The address content will be copied to the location pointed to by this argument + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_MemRead16(cpuaddr MemoryAddress, uint16 *uint16Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write 2 bytes of memory. + * + * @param[out] MemoryAddress Address to be written to + * @param[in] uint16Value The content pointed to by this argument will be copied to the address + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_MemWrite16(cpuaddr MemoryAddress, uint16 uint16Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Read 4 bytes of memory. + * + * @param[in] MemoryAddress Address to be read + * @param[out] uint32Value The address content will be copied to the location pointed to by this argument + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_MemRead32(cpuaddr MemoryAddress, uint32 *uint32Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write 4 bytes of memory. + * + * @param[out] MemoryAddress Address to be written to + * @param[in] uint32Value The content pointed to by this argument will be copied to the address + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_MemWrite32(cpuaddr MemoryAddress, uint32 uint32Value); +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Copy 'n' bytes from 'src' to 'dest' + * + * Copies 'n' bytes from memory address pointed to by 'src' to memory + * address pointed to by 'dest'. + * + * @note For now we are using the standard C library call 'memcpy' but if we + * find we need to make it more efficient then we'll implement it in assembly. + * + * @param[out] dest Pointer to the destination address to copy to + * @param[in] src Pointer to the address to copy from + * @param[in] n Number of bytes to copy + * + * @return Always returns CFE_PSP_SUCCESS + */ int32 CFE_PSP_MemCpy(void *dest, const void *src, uint32 n); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Copy 'n' bytes of value 'value' to 'dest' + * + * Copies 'n' number of bytes of value 'value' to memory address pointed + * to by 'dest'. + * + * @note For now we are using the standard C library call 'memset' but if we + * find we need to make it more efficient then we'll implement it in assembly. + * + * @param[out] dest Pointer to the destination address to copy to + * @param[in] value Value to set + * @param[in] n Number of bytes to copy + * + * @return Always returns CFE_PSP_SUCCESS + */ int32 CFE_PSP_MemSet(void *dest, uint8 value, uint32 n); -int32 CFE_PSP_MemValidateRange(cpuaddr Address, size_t Size, uint32 MemoryType); +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Validates the memory range and type using the global CFE_PSP_MemoryTable + * + * @param[in] Address A 32-bit starting address of the memory range + * @param[in] Size A 32-bit size of the memory range (Address + Size = End Address) + * @param[in] MemoryType The memory type to validate, including but not limited to: + * CFE_PSP_MEM_RAM, CFE_PSP_MEM_EEPROM, or CFE_PSP_MEM_ANY + * Any defined CFE_PSP_MEM_* enumeration can be specified + * + * @retval CFE_PSP_SUCCESS Memory range and type information is valid and can be used. + * @retval CFE_PSP_INVALID_MEM_ADDR Starting address is not valid + * @retval CFE_PSP_INVALID_MEM_TYPE Memory type associated with the range does not match the passed-in type. + * @retval CFE_PSP_INVALID_MEM_RANGE The Memory range associated with the address is not large enough to contain + * Address + Size. + */ +int32 CFE_PSP_MemValidateRange(cpuaddr Address, size_t Size, uint32 MemoryType); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Returns the number of memory ranges in the CFE_PSP_MemoryTable + * + * @return Positive integer number of entries in the memory range table + */ uint32 CFE_PSP_MemRanges(void); -int32 CFE_PSP_MemRangeSet(uint32 RangeNum, uint32 MemoryType, cpuaddr StartAddr, size_t Size, size_t WordSize, - uint32 Attributes); -int32 CFE_PSP_MemRangeGet(uint32 RangeNum, uint32 *MemoryType, cpuaddr *StartAddr, size_t *Size, size_t *WordSize, - uint32 *Attributes); +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Populates one of the records in the CFE_PSP_MemoryTable. + * + * @note Because the table is fixed size, the entries are set by using the + * integer index. No validation is done with the address or size. + * + * @param[in] RangeNum A 32-bit integer (starting with 0) specifying the MemoryTable entry. + * @param[in] MemoryType The memory type to validate, including but not limited to: + * CFE_PSP_MEM_RAM, CFE_PSP_MEM_EEPROM, or CFE_PSP_MEM_ANY + * Any defined CFE_PSP_MEM_* enumeration can be specified + * @param[in] StartAddr A 32-bit starting address of the memory range + * @param[in] Size A 32-bit size of the memory range (Address + Size = End Address) + * @param[in] WordSize The minimum addressable size of the range: + * (CFE_PSP_MEM_SIZE_BYTE, CFE_PSP_MEM_SIZE_WORD, CFE_PSP_MEM_SIZE_DWORD) + * @param[in] Attributes The attributes of the Memory Range: + * (CFE_PSP_MEM_ATTR_WRITE, CFE_PSP_MEM_ATTR_READ, CFE_PSP_MEM_ATTR_READWRITE) + * + * @retval CFE_PSP_SUCCESS Memory range set successfully. + * @retval CFE_PSP_INVALID_MEM_RANGE The index into the table is invalid + * @retval FE_PSP_INVALID_MEM_ADDR Starting address is not valid + * @retval CFE_PSP_INVALID_MEM_TYPE Memory type associated with the range does not match the passed-in type. + * @retval CFE_PSP_INVALID_MEM_WORDSIZE The WordSize parameter is not one of the predefined types. + * @retval CFE_PSP_INVALID_MEM_ATTR The Attributes parameter is not one of the predefined types. + * @retval OP_INVALID_MEM_SIZE The Memory range associated with the address is not large enough to contain + * Address + Size. + */ +int32 CFE_PSP_MemRangeSet(uint32 RangeNum, uint32 MemoryType, cpuaddr StartAddr, size_t Size, size_t WordSize, + uint32 Attributes); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Retrieves one of the records in the CFE_PSP_MemoryTable. + * + * @note Because the table is fixed size, the entries are accessed by using the integer index. + * + * @param[in] RangeNum A 32-bit integer (starting with 0) specifying the MemoryTable entry. + * @param[out] MemoryType A pointer to the 32-bit integer where the Memory Type is stored. + * Any defined CFE_PSP_MEM_* enumeration can be specified + * @param[out] StartAddr Pointer to the 32-bit integer where the 32-bit starting address of the memory range is stored. + * @param[out] Size A pointer to the 32-bit integer where the 32-bit size of the memory range is stored. + * @param[out] WordSize A pointer to the 32-bit integer where the minimum addressable size of the range: + * (CFE_PSP_MEM_SIZE_BYTE, CFE_PSP_MEM_SIZE_WORD, CFE_PSP_MEM_SIZE_DWORD) + * @param[out] Attributes The attributes of the Memory Range: + * (CFE_PSP_MEM_ATTR_WRITE, CFE_PSP_MEM_ATTR_READ, CFE_PSP_MEM_ATTR_READWRITE) + * + * @retval CFE_PSP_SUCCESS Memory range returned successfully. + * @retval CFE_PSP_INVALID_POINTER Parameter error + * @retval CFE_PSP_INVALID_MEM_RANGE The index into the table is invalid + */ +int32 CFE_PSP_MemRangeGet(uint32 RangeNum, uint32 *MemoryType, cpuaddr *StartAddr, size_t *Size, size_t *WordSize, + uint32 *Attributes); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write one byte (ByteValue) to EEPROM address MemoryAddress + * + * @param[out] MemoryAddress Memory address to write to + * @param[in] ByteValue Value to write to memory + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_TIMEOUT write operation did not go through after a specific timeout. + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromWrite8(cpuaddr MemoryAddress, uint8 ByteValue); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write two bytes (uint16Value) to EEPROM address MemoryAddress + * + * @param[out] MemoryAddress Memory address to write to + * @param[in] uint16Value Value to write to memory + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_TIMEOUT write operation did not go through after a specific timeout. + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromWrite16(cpuaddr MemoryAddress, uint16 uint16Value); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Write four bytes (uint32Value) to EEPROM address MemoryAddress + * + * @param[out] MemoryAddress Memory address to write to + * @param[in] uint32Value Value to write to memory + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_TIMEOUT write operation did not go through after a specific timeout. + * @retval CFE_PSP_ERROR_ADDRESS_MISALIGNED if the address is not aligned to a 16-bit addressing scheme. + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromWrite32(cpuaddr MemoryAddress, uint32 uint32Value); +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Enable the EEPROM for write operation + * + * @param[in] Bank The bank of EEPROM to enable + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromWriteEnable(uint32 Bank); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Disable the EEPROM from write operation + * + * @param[in] Bank The bank of EEPROM to disable + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromWriteDisable(uint32 Bank); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Power up the EEPROM + * + * @param[in] Bank The bank of EEPROM to power up + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromPowerUp(uint32 Bank); + +/*--------------------------------------------------------------------------------------*/ +/** + * @brief Power down the EEPROM + * + * @param[in] Bank The bank of EEPROM to power down + * + * @retval CFE_PSP_SUCCESS on success + * @retval CFE_PSP_ERROR_NOT_IMPLEMENTED if not implemented + */ int32 CFE_PSP_EepromPowerDown(uint32 Bank); +/*--------------------------------------------------------------------------------------*/ /** - * \brief Obtain the PSP version/baseline identifier string + * @brief Obtain the PSP version/baseline identifier string * * This retrieves the PSP version identifier string without extra info * - * \returns Version string. This is a fixed string and cannot be NULL. + * @return Version string. This is a fixed string and cannot be NULL. */ const char *CFE_PSP_GetVersionString(void); +/*--------------------------------------------------------------------------------------*/ /** - * \brief Obtain the version code name + * @brief Obtain the version code name * - * This retrieves the PSP code name. This is a compatibility indicator for the - * overall NASA CFS ecosystem. All modular components which are intended to + * This retrieves the PSP code name. This is a compatibility indicator for the + * overall NASA cFS ecosystem. All modular components which are intended to * interoperate should report the same code name. * - * \returns Code name. This is a fixed string and cannot be NULL. + * @return Code name. This is a fixed string and cannot be NULL. */ const char *CFE_PSP_GetVersionCodeName(void); +/*--------------------------------------------------------------------------------------*/ /** - * \brief Obtain the PSP numeric version numbers as uint8 values - * - * This retrieves the numeric PSP version identifier as an array of 4 uint8 values. + * @brief Retrieves the numeric PSP version identifier as an array of uint8 values * * The array of numeric values is in order of precedence: * [0] = Major Number @@ -450,21 +947,23 @@ const char *CFE_PSP_GetVersionCodeName(void); * 1-254 local patch level (reserved for mission use) * 255 indicates a development build * - * \param[out] VersionNumbers A fixed-size array to be filled with the version numbers + * @param[out] VersionNumbers A fixed-size array to be filled with the version numbers */ void CFE_PSP_GetVersionNumber(uint8 VersionNumbers[4]); +/*--------------------------------------------------------------------------------------*/ /** - * \brief Obtain the PSP library numeric build number + * @brief Obtain the PSP library numeric build number * * The build number is a monotonically increasing number that (coarsely) - * reflects the number of commits/changes that have been merged since the - * epoch release. During development cycles this number should increase - * after each subsequent merge/modification. + * reflects the number of commits/changes that have been merged since the epoch + * release. During development cycles this number should increase after each + * subsequent merge/modification. * - * Like other version information, this is a fixed number assigned at compile time. + * Like other version information, this is a fixed number assigned at compile + * time. * - * \returns The OSAL library build number + * @return The OSAL library build number */ uint32 CFE_PSP_GetBuildNumber(void); diff --git a/fsw/mcp750-vxworks/src/cfe_psp_exception.c b/fsw/mcp750-vxworks/src/cfe_psp_exception.c index 1c641b46..d23b632a 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_exception.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_exception.c @@ -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 */ diff --git a/fsw/mcp750-vxworks/src/cfe_psp_memory.c b/fsw/mcp750-vxworks/src/cfe_psp_memory.c index 648a917f..f326f00a 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_memory.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_memory.c @@ -538,4 +538,4 @@ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFES } return return_code; -} +} \ No newline at end of file diff --git a/fsw/mcp750-vxworks/src/cfe_psp_ssr.c b/fsw/mcp750-vxworks/src/cfe_psp_ssr.c index 2b8c14be..30e2f263 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_ssr.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_ssr.c @@ -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; diff --git a/fsw/mcp750-vxworks/src/cfe_psp_support.c b/fsw/mcp750-vxworks/src/cfe_psp_support.c index b912c94c..1b8acf15 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_support.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_support.c @@ -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) @@ -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("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (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) @@ -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; diff --git a/fsw/mcp750-vxworks/src/cfe_psp_watchdog.c b/fsw/mcp750-vxworks/src/cfe_psp_watchdog.c index 8129c865..6cee24a1 100644 --- a/fsw/mcp750-vxworks/src/cfe_psp_watchdog.c +++ b/fsw/mcp750-vxworks/src/cfe_psp_watchdog.c @@ -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) { /* @@ -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 */ @@ -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 */ @@ -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 */ @@ -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; diff --git a/fsw/modules/eeprom_direct/cfe_psp_eeprom_direct.c b/fsw/modules/eeprom_direct/cfe_psp_eeprom_direct.c index a1406d86..5a3740ec 100644 --- a/fsw/modules/eeprom_direct/cfe_psp_eeprom_direct.c +++ b/fsw/modules/eeprom_direct/cfe_psp_eeprom_direct.c @@ -50,26 +50,12 @@ void eeprom_direct_Init(uint32 PspModuleId) ** global memory */ -/* - ** - ** Purpose: - ** - ** Assumptions and Notes: - ** - ** Parameters: - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_TIMEOUT write operation did not go through after a specific - ** timeout. - ** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit addressing - ** scheme. - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromWrite32(cpuaddr MemoryAddress, uint32 uint32Value) { uint32 ret_value = CFE_PSP_SUCCESS; @@ -86,26 +72,12 @@ int32 CFE_PSP_EepromWrite32(cpuaddr MemoryAddress, uint32 uint32Value) return ret_value; } -/* - ** - ** Purpose: - ** - ** Assumptions and Notes: - ** - ** Parameters: - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_TIMEOUT write operation did not go through after a specific - ** timeout. - ** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit addressing - ** scheme. - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromWrite16(cpuaddr MemoryAddress, uint16 uint16Value) { uint32 write32; @@ -180,25 +152,12 @@ int32 CFE_PSP_EepromWrite16(cpuaddr MemoryAddress, uint16 uint16Value) return CFE_PSP_EepromWrite32(aligned_address, write32); } -/* - ** - ** Purpose: - ** - ** Assumptions and Notes: - ** - ** Parameters: - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_TIMEOUT write operation did not go through after a specific - ** timeout. - */ - +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromWrite8(cpuaddr MemoryAddress, uint8 ByteValue) { uint32 aligned_address; @@ -264,91 +223,45 @@ int32 CFE_PSP_EepromWrite8(cpuaddr MemoryAddress, uint8 ByteValue) return CFE_PSP_EepromWrite16(aligned_address, write16); } -/* -** -** Purpose: -** Enable the eeprom for write operation -** -** Assumptions and Notes: -** -** Parameters: -** Bank: Which bank of EEPROM -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** Return Values: -** CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromWriteEnable(uint32 Bank) { return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Disable the eeprom from write operation -** -** Assumptions and Notes: -** -** Parameters: -** Bank: Which bank of EEPROM -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** Return Values: -** CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromWriteDisable(uint32 Bank) { return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Power up the eeprom -** Assumptions and Notes: -** -** Parameters: -** Bank: Which bank of EEPROM -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** Return Values: -** CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromPowerUp(uint32 Bank) { return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Power down the eeprom -** Assumptions and Notes: -** -** Parameters: -** Bank: Which bank of EEPROM -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** Return Values: -** CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_EepromPowerDown(uint32 Bank) { return CFE_PSP_SUCCESS; diff --git a/fsw/modules/port_direct/cfe_psp_port_direct.c b/fsw/modules/port_direct/cfe_psp_port_direct.c index 147af09e..61af2c31 100644 --- a/fsw/modules/port_direct/cfe_psp_port_direct.c +++ b/fsw/modules/port_direct/cfe_psp_port_direct.c @@ -38,25 +38,12 @@ void port_direct_Init(uint32 PspModuleId) ** global memory */ -/* -** -** Purpose: -** Read one byte of memory. -** -** -** Parameters: -** PortAddress : Address to be read -** ByteValue : The address content will be copied to the location pointed by -** this argument -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** -** Return Values: CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_PortRead8(cpuaddr PortAddress, uint8 *ByteValue) { (*ByteValue) = (uint8) * ((uint8 *)PortAddress); @@ -64,54 +51,24 @@ int32 CFE_PSP_PortRead8(cpuaddr PortAddress, uint8 *ByteValue) return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Write one byte of memory. -** -** -** Parameters: -** PortAddress : Address to be written to -** ByteValue : The content pointed by this argument will be copied to the -** address -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** -** Return Values: -** CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_PortWrite8(cpuaddr PortAddress, uint8 ByteValue) { *((uint8 *)PortAddress) = ByteValue; return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Read 2 bytes of memory. -** -** -** Parameters: -** PortAddress : Address to be read -** uint16Value : The address content will be copied to the location pointed by -** this argument -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** -** Return Values: -** CFE_PSP_SUCCESS -** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit -** addressing scheme. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_PortRead16(cpuaddr PortAddress, uint16 *uint16Value) { /* check 16 bit alignment , check the 1st lsb */ @@ -123,28 +80,12 @@ int32 CFE_PSP_PortRead16(cpuaddr PortAddress, uint16 *uint16Value) return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Write 2 byte of memory. -** -** -** Parameters: -** PortAddress : Address to be written to -** uint16Value : The content pointed by this argument will be copied to the -** address -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** -** Return Values: -** CFE_PSP_SUCCESS -** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit -** addressing scheme. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_PortWrite16(cpuaddr PortAddress, uint16 uint16Value) { /* check 16 bit alignment , check the 1st lsb */ @@ -156,28 +97,12 @@ int32 CFE_PSP_PortWrite16(cpuaddr PortAddress, uint16 uint16Value) return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Read 4 bytes of memory. -** -** -** Parameters: -** PortAddress : Address to be read -** uint32Value : The address content will be copied to the location pointed by -** this argument -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** -** Return Values: -** CFE_PSP_SUCCESS -** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit -** addressing scheme. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_PortRead32(cpuaddr PortAddress, uint32 *uint32Value) { /* check 32 bit alignment */ @@ -189,28 +114,12 @@ int32 CFE_PSP_PortRead32(cpuaddr PortAddress, uint32 *uint32Value) return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Write 4 byte of memory. -** -** -** Parameters: -** PortAddress : Address to be written to -** uint32Value : The content pointed by this argument will be copied to the -** address -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** -** Return Values: -** CFE_PSP_SUCCESS -** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit -** addressing scheme. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_PortWrite32(cpuaddr PortAddress, uint32 uint32Value) { /* check 32 bit alignment */ diff --git a/fsw/modules/ram_direct/cfe_psp_ram_direct.c b/fsw/modules/ram_direct/cfe_psp_ram_direct.c index e6abb08f..271ad6ba 100644 --- a/fsw/modules/ram_direct/cfe_psp_ram_direct.c +++ b/fsw/modules/ram_direct/cfe_psp_ram_direct.c @@ -38,24 +38,12 @@ void ram_direct_Init(uint32 PspModuleId) ** global memory */ -/* - ** - ** Purpose: - ** Read one byte of memory. - ** - ** - ** Parameters: - ** MemoryAddress : Address to be read - ** ByteValue : The address content will be copied to the location pointed by this argument - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** - ** Return Values: CFE_PSP_SUCCESS - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemRead8(cpuaddr MemoryAddress, uint8 *ByteValue) { (*ByteValue) = *((uint8 *)MemoryAddress); @@ -63,53 +51,24 @@ int32 CFE_PSP_MemRead8(cpuaddr MemoryAddress, uint8 *ByteValue) return CFE_PSP_SUCCESS; } -/* - ** - ** Purpose: - ** Write one byte of memory. - ** - ** - ** Parameters: - ** MemoryAddress : Address to be written to - ** ByteValue : The content pointed by this argument will be copied to the address - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemWrite8(cpuaddr MemoryAddress, uint8 ByteValue) { *((uint8 *)MemoryAddress) = ByteValue; return CFE_PSP_SUCCESS; } -/* - ** - ** Purpose: - ** Read 2 bytes of memory. - ** - ** - ** Parameters: - ** MemoryAddress : Address to be read - ** uint16Value : The address content will be copied to the location pointed by - ** this argument - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit - ** addressing scheme. - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemRead16(cpuaddr MemoryAddress, uint16 *uint16Value) { /* check 16 bit alignment , check the 1st lsb */ @@ -121,28 +80,12 @@ int32 CFE_PSP_MemRead16(cpuaddr MemoryAddress, uint16 *uint16Value) return CFE_PSP_SUCCESS; } -/* - ** - ** Purpose: - ** Write 2 byte of memory. - ** - ** - ** Parameters: - ** MemoryAddress : Address to be written to - ** uint16Value : The content pointed by this argument will be copied to the - ** address - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_ADD_MISALIGNED The MemoryAddress is not aligned to 16 bit - ** addressing scheme. - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemWrite16(cpuaddr MemoryAddress, uint16 uint16Value) { /* check 16 bit alignment , check the 1st lsb */ @@ -154,28 +97,12 @@ int32 CFE_PSP_MemWrite16(cpuaddr MemoryAddress, uint16 uint16Value) return CFE_PSP_SUCCESS; } -/* - ** - ** Purpose: - ** Read 4 bytes of memory. - ** - ** - ** Parameters: - ** MemoryAddress : Address to be read - ** uint32Value : The address content will be copied to the location pointed by - ** this argument - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit - ** addressing scheme. - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemRead32(cpuaddr MemoryAddress, uint32 *uint32Value) { /* check 32 bit alignment */ @@ -188,28 +115,12 @@ int32 CFE_PSP_MemRead32(cpuaddr MemoryAddress, uint32 *uint32Value) return CFE_PSP_SUCCESS; } -/* - ** - ** Purpose: - ** Write 4 byte of memory. - ** - ** - ** Parameters: - ** MemoryAddress : Address to be written to - ** uint32Value : The content pointed by this argument will be copied to the - ** address - ** - ** Global Inputs: None - ** - ** Global Outputs: None - ** - ** - ** - ** Return Values: - ** CFE_PSP_SUCCESS - ** CFE_PSP_ERROR_ADD_MISALIGNED The Address is not aligned to 16 bit - ** addressing scheme. - */ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemWrite32(cpuaddr MemoryAddress, uint32 uint32Value) { /* check 32 bit alignment */ diff --git a/fsw/modules/timebase_posix_clock/cfe_psp_timebase_posix_clock.c b/fsw/modules/timebase_posix_clock/cfe_psp_timebase_posix_clock.c index 5c679889..b17f100a 100644 --- a/fsw/modules/timebase_posix_clock/cfe_psp_timebase_posix_clock.c +++ b/fsw/modules/timebase_posix_clock/cfe_psp_timebase_posix_clock.c @@ -115,41 +115,24 @@ void CFE_PSP_GetTime(OS_time_t *LocalTime) *LocalTime = OS_TimeAssembleFromNanoseconds(now.tv_sec, now.tv_nsec); } -/****************************************************************************** -** -** Purpose: -** Provides the resolution of the least significant 32 bits of the 64 bit -** time stamp returned by CFE_PSP_Get_Timebase in timer ticks per second. -** The timer resolution for accuracy should not be any slower than 1000000 -** ticks per second or 1 us per tick -** -** Arguments: -** -** Return: -** The number of timer ticks per second of the time stamp returned -** by CFE_PSP_Get_Timebase -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ uint32 CFE_PSP_GetTimerTicksPerSecond(void) { /* POSIX "struct timespec" resolution is defined as nanoseconds */ return 1000000000; } -/****************************************************************************** -** -** Purpose: -** Provides the number that the least significant 32 bits of the 64 bit -** time stamp returned by CFE_PSP_Get_Timebase rolls over. If the lower 32 -** bits rolls at 1 second, then the CFE_PSP_TIMER_LOW32_ROLLOVER will be 1000000. -** if the lower 32 bits rolls at its maximum value (2^32) then -** CFE_PSP_TIMER_LOW32_ROLLOVER will be 0. -** -** Arguments: -** -** Return: -** The number that the least significant 32 bits of the 64 bit time stamp -** returned by CFE_PSP_Get_Timebase rolls over. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ uint32 CFE_PSP_GetTimerLow32Rollover(void) { /* POSIX "struct timespec" resolution is defined as nanoseconds */ diff --git a/fsw/modules/timebase_vxworks/cfe_psp_timebase_vxworks.c b/fsw/modules/timebase_vxworks/cfe_psp_timebase_vxworks.c index fa0d3190..056b490e 100644 --- a/fsw/modules/timebase_vxworks/cfe_psp_timebase_vxworks.c +++ b/fsw/modules/timebase_vxworks/cfe_psp_timebase_vxworks.c @@ -143,57 +143,34 @@ void timebase_vxworks_Init(uint32 PspModuleId) PSP_VxWorks_Timebase_Global.TicksPerSecond = TicksPerSec & 0xFFFFFFFF; } -/****************************************************************************** -** -** Purpose: -** Provides the resolution of the least significant 32 bits of the 64 bit -** time stamp returned by CFE_PSP_Get_Timebase in timer ticks per second. -** The timer resolution for accuracy should not be any slower than 1000000 -** ticks per second or 1 us per tick -** -** Arguments: -** -** Return: -** The number of timer ticks per second of the time stamp returned -** by CFE_PSP_Get_Timebase -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ uint32 CFE_PSP_GetTimerTicksPerSecond(void) { return PSP_VxWorks_Timebase_Global.TicksPerSecond; } -/****************************************************************************** -** -** Purpose: -** Provides the number that the least significant 32 bits of the 64 bit -** time stamp returned by CFE_PSP_Get_Timebase rolls over. If the lower 32 -** bits rolls at 1 second, then the CFE_PSP_TIMER_LOW32_ROLLOVER will be 1000000. -** if the lower 32 bits rolls at its maximum value (2^32) then -** CFE_PSP_TIMER_LOW32_ROLLOVER will be 0. -** -** Arguments: -** -** Return: -** The number that the least significant 32 bits of the 64 bit time stamp -** returned by CFE_PSP_Get_Timebase rolls over. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ uint32 CFE_PSP_GetTimerLow32Rollover(void) { return 0; } -/****************************************************************************** -** -** Purpose: -** Provides a common interface to system timebase. This routine -** is in the BSP because it is sometimes implemented in hardware and -** sometimes taken care of by the RTOS. -** -** Arguments: -** -** Return: -** Timebase register value -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ void CFE_PSP_Get_Timebase(uint32 *Tbu, uint32 *Tbl) { vxTimeBaseGet((UINT32 *)Tbu, (UINT32 *)Tbl); diff --git a/fsw/pc-linux/src/cfe_psp_exception.c b/fsw/pc-linux/src/cfe_psp_exception.c index 7f7b6847..5a19de32 100644 --- a/fsw/pc-linux/src/cfe_psp_exception.c +++ b/fsw/pc-linux/src/cfe_psp_exception.c @@ -244,14 +244,12 @@ void CFE_PSP_AttachExceptions(void) CFE_PSP_Exception_Reset(); } -/* -** -** 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) { /* diff --git a/fsw/pc-linux/src/cfe_psp_memory.c b/fsw/pc-linux/src/cfe_psp_memory.c index 11168fcb..5fcbdc7a 100644 --- a/fsw/pc-linux/src/cfe_psp_memory.c +++ b/fsw/pc-linux/src/cfe_psp_memory.c @@ -194,18 +194,12 @@ void CFE_PSP_DeleteCDS(void) } } -/****************************************************************************** -** -** Purpose: -** This function fetches the size of the OS Critical Data Store area. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ - +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetCDSSize(uint32 *SizeOfCDS) { int32 return_code; @@ -223,18 +217,12 @@ int32 CFE_PSP_GetCDSSize(uint32 *SizeOfCDS) return return_code; } -/****************************************************************************** -** -** Purpose: -** This function writes to the CDS Block. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ - +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_WriteToCDS(const void *PtrToDataToWrite, uint32 CDSOffset, uint32 NumBytes) { uint8 *CopyPtr; @@ -264,18 +252,12 @@ int32 CFE_PSP_WriteToCDS(const void *PtrToDataToWrite, uint32 CDSOffset, uint32 return return_code; } -/****************************************************************************** -** -** Purpose: -** This function reads from the CDS Block -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ - +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumBytes) { uint8 *CopyPtr; @@ -411,21 +393,12 @@ void CFE_PSP_DeleteResetArea(void) } } -/* - */ -/****************************************************************************** -** -** Purpose: -** This function returns the location and size of the ES Reset information area. -** This area is preserved during a processor reset and is used to store the -** ER Log, System Log and reset related variables -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetResetArea(cpuaddr *PtrToResetArea, uint32 *SizeOfResetArea) { int32 return_code; @@ -526,18 +499,12 @@ void CFE_PSP_DeleteUserReservedArea(void) } } -/****************************************************************************** -** -** Purpose: -** This function returns the location and size of the memory used for the cFE -** User reserved area. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetUserReservedArea(cpuaddr *PtrToUserArea, uint32 *SizeOfUserArea) { int32 return_code; @@ -583,18 +550,12 @@ void CFE_PSP_InitVolatileDiskMem(void) */ } -/****************************************************************************** -** -** Purpose: -** This function returns the location and size of the memory used for the cFE -** volatile disk. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk) { int32 return_code; @@ -743,18 +704,12 @@ void CFE_PSP_DeleteProcessorReservedMemory(void) ********************************************************************************* */ -/****************************************************************************** -** -** Purpose: -** This function returns the start and end address of the kernel text segment. -** It may not be implemented on all architectures. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetKernelTextSegmentInfo(cpuaddr *PtrToKernelSegment, uint32 *SizeOfKernelSegment) { /* Check pointers */ @@ -770,18 +725,12 @@ int32 CFE_PSP_GetKernelTextSegmentInfo(cpuaddr *PtrToKernelSegment, uint32 *Size return CFE_PSP_ERROR_NOT_IMPLEMENTED; } -/****************************************************************************** -** -** Purpose: -** This function returns the start and end address of the CFE text segment. -** It may not be implemented on all architectures. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFESegment) { int32 return_code; diff --git a/fsw/pc-linux/src/cfe_psp_ssr.c b/fsw/pc-linux/src/cfe_psp_ssr.c index 3f282dfb..ae4bec3d 100644 --- a/fsw/pc-linux/src/cfe_psp_ssr.c +++ b/fsw/pc-linux/src/cfe_psp_ssr.c @@ -48,18 +48,12 @@ #include #include -/****************************************************************************** -** -** Purpose: -** Initializes the Solid State Recorder device. This can be filled in for the platform. -** -** 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 Status; diff --git a/fsw/pc-linux/src/cfe_psp_support.c b/fsw/pc-linux/src/cfe_psp_support.c index 59e39da5..24d63860 100644 --- a/fsw/pc-linux/src/cfe_psp_support.c +++ b/fsw/pc-linux/src/cfe_psp_support.c @@ -51,18 +51,12 @@ extern uint32 CFE_PSP_SpacecraftId; extern uint32 CFE_PSP_CpuId; extern char CFE_PSP_CpuName[]; -/****************************************************************************** -** -** 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) @@ -113,19 +107,12 @@ void CFE_PSP_Restart(uint32 reset_type) abort(); } -/****************************************************************************** -** -** 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) { OS_printf("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (unsigned int)ErrorCode); @@ -133,77 +120,45 @@ void CFE_PSP_Panic(int32 ErrorCode) abort(); /* abort() is preferable to exit(-1), as it may create a core file for debug */ } -/****************************************************************************** -** -** 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) { printf("CFE_PSP_FlushCaches called -- Currently no Linux/OSX/Cygwin implementation\n"); } -/* -** -** 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_CpuId; } -/* -** -** 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_SpacecraftId; } -/* -** -** 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_CpuName; diff --git a/fsw/pc-linux/src/cfe_psp_watchdog.c b/fsw/pc-linux/src/cfe_psp_watchdog.c index 767a78a3..d7872b1f 100644 --- a/fsw/pc-linux/src/cfe_psp_watchdog.c +++ b/fsw/pc-linux/src/cfe_psp_watchdog.c @@ -60,15 +60,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) { /* @@ -79,78 +76,47 @@ 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) {} -/****************************************************************************** -** -** 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) {} -/****************************************************************************** -** -** Purpose: -** Load the watchdog timer with a count that corresponds to the millisecond -** time given in the parameter. -** -** Arguments: -** None. -** -** Return: -** None -** -** Notes: -** -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ 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; diff --git a/fsw/pc-rtems/src/cfe_psp_exception.c b/fsw/pc-rtems/src/cfe_psp_exception.c index eaa46e1c..f0c8a842 100644 --- a/fsw/pc-rtems/src/cfe_psp_exception.c +++ b/fsw/pc-rtems/src/cfe_psp_exception.c @@ -78,11 +78,10 @@ int32 CFE_PSP_ExceptionGetSummary_Impl(const CFE_PSP_Exception_LogData_t *Buffer return CFE_PSP_ERROR_NOT_IMPLEMENTED; } -/* -** -** 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) {} diff --git a/fsw/pc-rtems/src/cfe_psp_memory.c b/fsw/pc-rtems/src/cfe_psp_memory.c index ec259cb0..e8bb018c 100644 --- a/fsw/pc-rtems/src/cfe_psp_memory.c +++ b/fsw/pc-rtems/src/cfe_psp_memory.c @@ -93,18 +93,12 @@ CFE_PSP_MemoryBlock_t PcRtems_ReservedMemBlock; ********************************************************************************* */ -/****************************************************************************** -** -** Purpose: -** This function fetches the size of the OS Critical Data Store area. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ - +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetCDSSize(uint32 *SizeOfCDS) { int32 return_code; @@ -121,17 +115,12 @@ int32 CFE_PSP_GetCDSSize(uint32 *SizeOfCDS) return return_code; } -/****************************************************************************** -** -** Purpose: -** This function writes to the CDS Block. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_WriteToCDS(const void *PtrToDataToWrite, uint32 CDSOffset, uint32 NumBytes) { uint8 *CopyPtr; @@ -162,18 +151,12 @@ int32 CFE_PSP_WriteToCDS(const void *PtrToDataToWrite, uint32 CDSOffset, uint32 return return_code; } -/****************************************************************************** -** -** Purpose: -** This function reads from the CDS Block -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ - +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumBytes) { uint8 *CopyPtr; @@ -210,19 +193,12 @@ int32 CFE_PSP_ReadFromCDS(void *PtrToDataToRead, uint32 CDSOffset, uint32 NumByt ********************************************************************************* */ -/****************************************************************************** -** -** Purpose: -** This function returns the location and size of the ES Reset information area. -** This area is preserved during a processor reset and is used to store the -** ER Log, System Log and reset related variables -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetResetArea(cpuaddr *PtrToResetArea, uint32 *SizeOfResetArea) { int32 return_code; @@ -247,18 +223,12 @@ int32 CFE_PSP_GetResetArea(cpuaddr *PtrToResetArea, uint32 *SizeOfResetArea) ********************************************************************************* */ -/****************************************************************************** -** -** Purpose: -** This function returns the location and size of the memory used for the cFE -** User reserved area. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetUserReservedArea(cpuaddr *PtrToUserArea, uint32 *SizeOfUserArea) { int32 return_code; @@ -283,18 +253,12 @@ int32 CFE_PSP_GetUserReservedArea(cpuaddr *PtrToUserArea, uint32 *SizeOfUserArea ********************************************************************************* */ -/****************************************************************************** -** -** Purpose: -** This function returns the location and size of the memory used for the cFE -** volatile disk. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk) { int32 return_code; @@ -442,18 +406,12 @@ int32 CFE_PSP_InitProcessorReservedMemory(uint32 RestartType) ********************************************************************************* */ -/****************************************************************************** -** -** Purpose: -** This function returns the start and end address of the kernel text segment. -** It may not be implemented on all architectures. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetKernelTextSegmentInfo(cpuaddr *PtrToKernelSegment, uint32 *SizeOfKernelSegment) { int32 return_code; @@ -483,18 +441,12 @@ int32 CFE_PSP_GetKernelTextSegmentInfo(cpuaddr *PtrToKernelSegment, uint32 *Size return return_code; } -/****************************************************************************** -** -** Purpose: -** This function returns the start and end address of the CFE text segment. -** It may not be implemented on all architectures. -** -** Arguments: -** (none) -** -** Return: -** (none) -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_GetCFETextSegmentInfo(cpuaddr *PtrToCFESegment, uint32 *SizeOfCFESegment) { int32 return_code; diff --git a/fsw/pc-rtems/src/cfe_psp_ssr.c b/fsw/pc-rtems/src/cfe_psp_ssr.c index d9074feb..d0ac00b3 100644 --- a/fsw/pc-rtems/src/cfe_psp_ssr.c +++ b/fsw/pc-rtems/src/cfe_psp_ssr.c @@ -47,20 +47,12 @@ #include "cfe_psp.h" #include "cfe_psp_memory.h" -/****************************************************************************** -** -** Purpose: -** Initializes the Solid State Recorder device. Dummy function for this -** platform. -** -** -** 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; diff --git a/fsw/pc-rtems/src/cfe_psp_support.c b/fsw/pc-rtems/src/cfe_psp_support.c index b72bc0d4..dc555406 100644 --- a/fsw/pc-rtems/src/cfe_psp_support.c +++ b/fsw/pc-rtems/src/cfe_psp_support.c @@ -65,18 +65,12 @@ */ extern CFE_PSP_MemoryBlock_t PcRtems_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) { CFE_PSP_FlushCaches(1, PcRtems_ReservedMemBlock.BlockPtr, PcRtems_ReservedMemBlock.BlockSize); @@ -84,38 +78,24 @@ void CFE_PSP_Restart(uint32 reset_type) exit(-1); } -/****************************************************************************** -** -** 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("CFE_PSP_Panic Called with error code = 0x%08X. Exiting.\n", (unsigned int)ErrorCode); OS_ApplicationExit(ErrorCode); } -/****************************************************************************** -** -** 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) @@ -124,60 +104,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; diff --git a/fsw/pc-rtems/src/cfe_psp_watchdog.c b/fsw/pc-rtems/src/cfe_psp_watchdog.c index ade64472..4afac615 100644 --- a/fsw/pc-rtems/src/cfe_psp_watchdog.c +++ b/fsw/pc-rtems/src/cfe_psp_watchdog.c @@ -60,15 +60,12 @@ */ uint32 CFE_PSP_WatchdogValue = 0; -/* -** -** 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) { /* @@ -79,78 +76,47 @@ 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) {} -/****************************************************************************** -** -** 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) {} -/****************************************************************************** -** -** Purpose: -** Load the watchdog timer with a count that corresponds to the millisecond -** time given in the parameter. -** -** Arguments: -** None. -** -** Return: -** None -** -** Notes: -** -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ 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; diff --git a/fsw/shared/src/cfe_psp_exceptionstorage.c b/fsw/shared/src/cfe_psp_exceptionstorage.c index b6843935..fea838ff 100644 --- a/fsw/shared/src/cfe_psp_exceptionstorage.c +++ b/fsw/shared/src/cfe_psp_exceptionstorage.c @@ -137,20 +137,24 @@ void CFE_PSP_Exception_WriteComplete(void) ** (Functions used by CFE or PSP) ***************************************************************************/ -/*--------------------------------------------------------------------------- - * CFE_PSP_Exception_GetCount - * See description in PSP API - *---------------------------------------------------------------------------*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ uint32 CFE_PSP_Exception_GetCount(void) { return (CFE_PSP_ReservedMemoryMap.ExceptionStoragePtr->NumWritten - CFE_PSP_ReservedMemoryMap.ExceptionStoragePtr->NumRead); } -/*--------------------------------------------------------------------------- - * CFE_PSP_Exception_GetSummary - * See description in PSP API - *---------------------------------------------------------------------------*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_Exception_GetSummary(uint32 *ContextLogId, osal_id_t *TaskId, char *ReasonBuf, uint32 ReasonSize) { const CFE_PSP_Exception_LogData_t *Buffer; @@ -210,10 +214,12 @@ int32 CFE_PSP_Exception_GetSummary(uint32 *ContextLogId, osal_id_t *TaskId, char return CFE_PSP_SUCCESS; } -/*--------------------------------------------------------------------------- - * CFE_PSP_Exception_CopyContext - * See description in PSP API - *---------------------------------------------------------------------------*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_Exception_CopyContext(uint32 ContextLogId, void *ContextBuf, uint32 ContextSize) { const CFE_PSP_Exception_LogData_t *Buffer; diff --git a/fsw/shared/src/cfe_psp_memrange.c b/fsw/shared/src/cfe_psp_memrange.c index b628845d..870f34cb 100644 --- a/fsw/shared/src/cfe_psp_memrange.c +++ b/fsw/shared/src/cfe_psp_memrange.c @@ -35,31 +35,12 @@ #include "cfe_psp.h" #include "cfe_psp_memory.h" -/* -** -** Purpose: -** Validate the memory range and type using the global CFE_PSP_MemoryTable -** -** Assumptions and Notes: -** -** Parameters: -** Address -- A 32 bit starting address of the memory range -** Size -- A 32 bit size of the memory range ( Address + Size = End Address ) -** MemoryType -- The memory type to validate, including but not limited to: -** CFE_PSP_MEM_RAM, CFE_PSP_MEM_EEPROM, or CFE_PSP_MEM_ANY -** Any defined CFE_PSP_MEM_* enumeration can be specified -** -** Global Inputs: None -** -** Global Outputs: None -** -** Return Values: -** CFE_PSP_SUCCESS -- Memory range and type information is valid and can be used. -** CFE_PSP_INVALID_MEM_ADDR -- Starting address is not valid -** CFE_PSP_INVALID_MEM_TYPE -- Memory type associated with the range does not match the passed in type. -** CFE_PSP_INVALID_MEM_RANGE -- The Memory range associated with the address is not large enough to contain -** Address + Size. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemValidateRange(cpuaddr Address, size_t Size, uint32 MemoryType) { cpuaddr StartAddressToTest = Address; @@ -152,63 +133,23 @@ int32 CFE_PSP_MemValidateRange(cpuaddr Address, size_t Size, uint32 MemoryType) return ReturnCode; } -/* -** -** Purpose: -** Return the number of memory ranges in the CFE_PSP_MemoryTable -** -** Assumptions and Notes: -** -** Parameters: -** None -** -** Global Inputs: None -** -** Global Outputs: None -** -** Return Values: -** Positive integer number of entries in the memory range table -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ uint32 CFE_PSP_MemRanges(void) { return CFE_PSP_MEM_TABLE_SIZE; } -/* -** -** Purpose: -** This function populates one of the records in the CFE_PSP_MemoryTable. -** -** Assumptions and Notes: -** Because the table is fixed size, the entries are set by using the integer index. -** No validation is done with the address or size. -** -** Parameters: -** RangeNum -- A 32 bit integer ( starting with 0 ) specifying the MemoryTable entry. -** MemoryType -- The memory type to validate, including but not limited to: -** CFE_PSP_MEM_RAM, CFE_PSP_MEM_EEPROM, or CFE_PSP_MEM_ANY -** Any defined CFE_PSP_MEM_* enumeration can be specified -** Address -- A 32 bit starting address of the memory range -** Size -- A 32 bit size of the memory range ( Address + Size = End Address ) -** WordSize -- The minimum addressable size of the range: -** ( CFE_PSP_MEM_SIZE_BYTE, CFE_PSP_MEM_SIZE_WORD, CFE_PSP_MEM_SIZE_DWORD ) -** Attributes -- The attributes of the Memory Range: -** (CFE_PSP_MEM_ATTR_WRITE, CFE_PSP_MEM_ATTR_READ, CFE_PSP_MEM_ATTR_READWRITE) -** -** Global Inputs: Reads CFE_PSP_MemoryTable -** -** Global Outputs: Changes CFE_PSP_MemoryTable -** -** Return Values: -** CFE_PSP_SUCCESS -- Memory range set successfully. -** CFE_PSP_INVALID_MEM_RANGE -- The index into the table is invalid -** CFE_PSP_INVALID_MEM_ADDR -- Starting address is not valid -** CFE_PSP_INVALID_MEM_TYPE -- Memory type associated with the range does not match the passed in type. -** OP_INVALID_MEM_SIZE -- The Memory range associated with the address is not large enough to contain -** Address + Size. -** CFE_PSP_INVALID_MEM_WORDSIZE -- The WordSIze parameter is not one of the predefined types. -** CFE_PSP_INVALID_MEM_ATTR -- The Attributes parameter is not one of the predefined types. -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemRangeSet(uint32 RangeNum, uint32 MemoryType, cpuaddr StartAddr, size_t Size, size_t WordSize, uint32 Attributes) { @@ -250,36 +191,12 @@ int32 CFE_PSP_MemRangeSet(uint32 RangeNum, uint32 MemoryType, cpuaddr StartAddr, return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** This function retrieves one of the records in the CFE_PSP_MemoryTable. -** -** Assumptions and Notes: -** Because the table is fixed size, the entries are accessed by using the integer index. -** -** Parameters: -** RangeNum -- A 32 bit integer ( starting with 0 ) specifying the MemoryTable entry. -** *MemoryType -- A pointer to the 32 bit integer where the Memory Type is stored. -** Any defined CFE_PSP_MEM_* enumeration can be specified -** *Address -- A pointer to the 32 bit integer where the 32 bit starting address of the memory range -** is stored. -** *Size -- A pointer to the 32 bit integer where the 32 bit size of the memory range -** is stored. -** *WordSize -- A pointer to the 32 bit integer where the minimum addressable size of the range: -** ( CFE_PSP_MEM_SIZE_BYTE, CFE_PSP_MEM_SIZE_WORD, CFE_PSP_MEM_SIZE_DWORD ) -** Attributes -- The attributes of the Memory Range: -** (CFE_PSP_MEM_ATTR_WRITE, CFE_PSP_MEM_ATTR_READ, CFE_PSP_MEM_ATTR_READWRITE) -** -** Global Inputs: Reads CFE_PSP_MemoryTable -** -** Global Outputs: Changes CFE_PSP_MemoryTable -** -** Return Values: -** CFE_PSP_SUCCESS -- Memory range returned successfully. -** CFE_PSP_INVALID_POINTER -- Parameter error -** CFE_PSP_INVALID_MEM_RANGE -- The index into the table is invalid -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemRangeGet(uint32 RangeNum, uint32 *MemoryType, cpuaddr *StartAddr, size_t *Size, size_t *WordSize, uint32 *Attributes) { diff --git a/fsw/shared/src/cfe_psp_memutils.c b/fsw/shared/src/cfe_psp_memutils.c index 32ffd654..97c2b289 100644 --- a/fsw/shared/src/cfe_psp_memutils.c +++ b/fsw/shared/src/cfe_psp_memutils.c @@ -45,56 +45,24 @@ ** global memory */ -/* -** -** Purpose: -** Copies 'size' byte from memory address pointed by 'src' to memory -** address pointed by ' dst' For now we are using the standard c library -** call 'memcpy' but if we find we need to make it more efficient then -** we'll implement it in assembly. -** -** Assumptions and Notes: -** -** Parameters: -** dst : pointer to an address to copy to -** src : pointer address to copy from -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** Return Values: CFE_PSP_SUCCESS -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemCpy(void *dst, const void *src, uint32 size) { memcpy(dst, src, size); return CFE_PSP_SUCCESS; } -/* -** -** Purpose: -** Copies 'size' number of byte of value 'value' to memory address pointed -** by 'dst' .For now we are using the standard c library call 'memset' -** but if we find we need to make it more efficient then we'll implement -** it in assembly. -** -** -** Assumptions and Notes: -** -** Parameters: -** -** Global Inputs: None -** -** Global Outputs: None -** -** -** Return Values: CFE_PSP_SUCCESS -*/ -/* -** CFE_PSP_MemSet -*/ +/*---------------------------------------------------------------- + * + * Implemented per public API + * See description in header file for argument/return detail + * + *-----------------------------------------------------------------*/ int32 CFE_PSP_MemSet(void *dst, uint8 value, uint32 size) { memset(dst, (int)value, (size_t)size); diff --git a/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c b/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c index 7ded8d9d..2968cf6c 100644 --- a/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c +++ b/unit-test-coverage/mcp750-vxworks/src/coveragetest-cfe-psp-support.c @@ -92,7 +92,7 @@ void Test_CFE_PSP_GetProcessorId(void) { /* * Test Case For: - * uint32 CFE_PSP_GetProcessorId (void) + * uint32 CFE_PSP_GetProcessorId (void) */ /* @@ -106,7 +106,7 @@ void Test_CFE_PSP_GetSpacecraftId(void) { /* * Test Case For: - * uint32 CFE_PSP_GetSpacecraftId (void) + * uint32 CFE_PSP_GetSpacecraftId (void) */ /* diff --git a/ut-stubs/ut_psp_stubs.c b/ut-stubs/ut_psp_stubs.c index 853a67e8..ea45961c 100644 --- a/ut-stubs/ut_psp_stubs.c +++ b/ut-stubs/ut_psp_stubs.c @@ -66,11 +66,7 @@ Target_ConfigData GLOBAL_CONFIGDATA = {.MissionVersion = "MissionUnitTest" ** ** \par Description ** This function is used to mimic the response of the OS API function -** CFE_PSP_Panic. The variable PSPPanicRtn.value is set equal to the -** input variable ErrorCode and the variable PSPPanicRtn.count is -** incremented each time this function is called. The unit tests -** compare these values to expected results to verify proper system -** response. +** CFE_PSP_Panic. ** ** \par Assumptions, External Events, and Notes: ** None @@ -168,7 +164,7 @@ const char *CFE_PSP_GetProcessorName(void) /*****************************************************************************/ /** -v** \brief CFE_PSP_GetTime stub function +** \brief CFE_PSP_GetTime stub function ** ** \par Description ** This function is used as a placeholder for the PSP function @@ -203,13 +199,7 @@ void CFE_PSP_GetTime(OS_time_t *LocalTime) ** ** \par Description ** This function is used to mimic the response of the PSP function -** CFE_PSP_WriteToCDS. The user can adjust the response by setting -** the values in the BSPWriteCDSRtn structure prior to this function -** being called. If the value BSPWriteCDSRtn.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 BSPWriteCDSRtn.value. -** Otherwise, the value of the user-defined variable UT_BSP_Fail -** determines the status returned by the function. +** CFE_PSP_WriteToCDS. ** ** \par Assumptions, External Events, and Notes: ** None @@ -245,13 +235,7 @@ int32 CFE_PSP_WriteToCDS(const void *PtrToDataToWrite, uint32 CDSOffset, uint32 ** ** \par Description ** This function is used to mimic the response of the PSP function -** CFE_PSP_ReadFromCDS. The user can adjust the response by setting -** the values in the BSPReadCDSRtn structure prior to this function -** being called. If the value BSPReadCDSRtn.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 BSPReadCDSRtn.value. -** Otherwise, the value of the user-defined variable UT_BSP_Fail -** determines the status returned by the function. +** CFE_PSP_ReadFromCDS. ** ** \par Assumptions, External Events, and Notes: ** None @@ -354,11 +338,7 @@ int32 CFE_PSP_GetVolatileDiskMem(cpuaddr *PtrToVolDisk, uint32 *SizeOfVolDisk) ** ** \par Description ** This function is used as a placeholder for the PSP function -** CFE_PSP_Restart. The variable PSPRestartRtn.value is set to the -** value passed to the function, reset_type, and the variable -** PSPRestartRtn.count is incremented each time this function is called. -** The unit tests compare these values to expected results to verify -** proper system response. +** CFE_PSP_Restart. ** ** \par Assumptions, External Events, and Notes: ** None