Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix #165, Add CFE_PSP_GetProcessorName #189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions fsw/inc/cfe_psp.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ extern uint32 CFE_PSP_GetSpacecraftId ( void );
** CFE_PSP_GetSpacecraftId retuns the Spacecraft ID (if any )
*/

extern const char * CFE_PSP_GetProcessorName(void);
/*
** CFE_PSP_GetProcessorName returns the processor name
*/

extern uint32 CFE_PSP_Get_Timer_Tick(void);
/*
Expand Down
21 changes: 21 additions & 0 deletions fsw/mcp750-vxworks/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include <target_config.h>

#define CFE_PSP_CPU_ID (GLOBAL_CONFIGDATA.Default_CpuId)
#define CFE_PSP_CPU_NAME (GLOBAL_CONFIGDATA.Default_CpuName)
#define CFE_PSP_SPACECRAFT_ID (GLOBAL_CONFIGDATA.Default_SpacecraftId)

/*
Expand Down Expand Up @@ -192,3 +193,23 @@ uint32 CFE_PSP_GetSpacecraftId (void)
return CFE_PSP_SPACECRAFT_ID;
}

/*
** Name: CFE_PSP_GetProcessorName
**
** Purpose:
** return the processor name.
**
** Parameters:
**
** Global Inputs: None
**
** Global Outputs: None
**
**
** Return Values: Processor name
*/
const char *CFE_PSP_GetProcessorName (void)
{
return CFE_PSP_CPU_NAME;
}

22 changes: 22 additions & 0 deletions fsw/pc-linux/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
*/
extern uint32 CFE_PSP_SpacecraftId;
extern uint32 CFE_PSP_CpuId;
extern char CFE_PSP_CpuName[];


/******************************************************************************
Expand Down Expand Up @@ -200,3 +201,24 @@ uint32 CFE_PSP_GetSpacecraftId (void)
{
return(CFE_PSP_SpacecraftId);
}

/*
** Name: CFE_PSP_GetProcessorName
**
** Purpose:
** return the processor name.
**
** Parameters:
**
** Global Inputs: None
**
** Global Outputs: None
**
**
** Return Values: Processor name
*/
const char *CFE_PSP_GetProcessorName (void)
{
return(CFE_PSP_CpuName);
}

20 changes: 20 additions & 0 deletions fsw/pc-rtems/src/cfe_psp_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,23 @@ uint32 CFE_PSP_GetSpacecraftId (void)
return(CFE_PSP_SPACECRAFT_ID);
}

/*
** Name: CFE_PSP_GetProcessorName
**
** Purpose:
** return the processor name.
**
** Parameters:
**
** Global Inputs: None
**
** Global Outputs: None
**
**
** Return Values: Processor name
*/
const char *CFE_PSP_GetProcessorName (void)
{
return(CFE_PSP_CPU_NAME);
}

31 changes: 31 additions & 0 deletions ut-stubs/ut_psp_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,37 @@ uint32 CFE_PSP_GetSpacecraftId(void)
return status;
}

/*****************************************************************************/
/**
** \brief CFE_PSP_GetProcessorName stub function
**
** \par Description
** This function is used as a placeholder for the PSP function
** CFE_PSP_GetProcessorName. It is set to return a fixed value for the
** unit tests.
**
** \par Assumptions, External Events, and Notes:
** None
**
** \returns
** Returns Default_CpuName or passed in address from buffer
**
******************************************************************************/
const char *CFE_PSP_GetProcessorName(void)
{
int32 status;
const char *ptr = GLOBAL_CONFIGDATA.Default_CpuName;

status = UT_DEFAULT_IMPL(CFE_PSP_GetProcessorName);

if (status >= 0)
{
UT_Stub_CopyToLocal(UT_KEY(CFE_PSP_GetProcessorName), &ptr, sizeof(ptr));
}

return ptr;
}

/*****************************************************************************/
/**
v** \brief CFE_PSP_GetTime stub function
Expand Down