Skip to content

Commit

Permalink
Merge pull request #149 from jphickey/fix-121-unify-osal-bsp-psp
Browse files Browse the repository at this point in the history
Fix #121, Unify CFE PSP with OSAL BSP
  • Loading branch information
astrogeco authored Apr 14, 2020
2 parents 78af2db + ab6aa2a commit 801bf27
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 231 deletions.
17 changes: 11 additions & 6 deletions fsw/mcp750-vxworks/make/build_options.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
##########################################################################
#
# Build options for "mcp750-vxworks" PSP
# This file specifies any global-scope compiler options when using this PSP
#
##########################################################################

# This indicates where to install target binaries created during the build
# Note - this should be phased out in favor of the staging dir from OSAL BSP
set(INSTALL_SUBDIR "cf")

# Additional preprocessor macro definitions to identify this platform
# Some upper-level code may be gated on _VXWORKS_OS_ being defined
# This is for compatibility with older build scripts which defined this symbol,
# but no CFE/OSAL framework code depends on this symbol.
add_definitions("-D_VXWORKS_OS_")
add_definitions("-D__PPC__")
add_definitions("-DMCP750")

include_directories($ENV{WIND_BASE}/target/h)
include_directories($ENV{WIND_BASE}/target/h/wrn/coreip)
include_directories($ENV{WIND_BASE}/target/config/mcp750)
25 changes: 21 additions & 4 deletions fsw/mcp750-vxworks/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,18 @@ IMPORT void sysPciWrite32 (UINT32, UINT32);


/******************************************************************************
** Function: CFE_PSP_Main()
** Function: OS_Application_Startup()
**
** Purpose:
** vxWorks/BSP Application entry point.
** Application startup entry point from OSAL BSP.
**
** Arguments:
** (none)
**
** Return:
** (none)
*/

void CFE_PSP_Main( void )
void OS_Application_Startup(void)
{
int TicksPerSecond;
uint32 reset_type;
Expand Down Expand Up @@ -216,6 +215,24 @@ void CFE_PSP_Main( void )
*/
CFE_PSP_MAIN_FUNCTION(reset_type,reset_subtype, 1, CFE_PSP_NONVOL_STARTUP_FILE);

}

/******************************************************************************
** Function: OS_Application_Run()
**
** Purpose:
** Idle Loop entry point from OSAL BSP.
**
** Arguments:
** (none)
**
** Return:
** (none)
*/
void OS_Application_Run(void)
{
int TicksPerSecond;

/*
** Main loop for default task and simulated 1hz
*/
Expand Down
10 changes: 10 additions & 0 deletions fsw/pc-linux/make/build_options.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
##########################################################################
#
# Build options for "pc-linux" PSP
# This file specifies any global-scope compiler options when using this PSP
#
##########################################################################

# This indicates where to install target binaries created during the build
# Note - this should be phased out in favor of the staging dir from OSAL BSP
set(INSTALL_SUBDIR "cf")

# Some upper-level code may be gated on _LINUX_OS_ being defined
# This is for compatibility with older build scripts which defined this symbol,
# but no CFE/OSAL framework code depends on this symbol.
add_definitions("-D_LINUX_OS_")

13 changes: 9 additions & 4 deletions fsw/pc-linux/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static const struct option longOpts[] = {
** Return:
** (none)
*/
int main(int argc, char *argv[])
void OS_Application_Startup(void)
{
uint32 reset_type;
uint32 reset_subtype;
Expand All @@ -166,6 +166,8 @@ int main(int argc, char *argv[])
int opt = 0;
int longIndex = 0;
int32 Status;
char * const * argv;
int argc;

/*
** Initialize the CommandData struct
Expand All @@ -176,6 +178,8 @@ int main(int argc, char *argv[])
** Process the arguments with getopt_long(), then
** start the cFE
*/
argc = OS_BSP_GetArgC();
argv = OS_BSP_GetArgV();
opt = getopt_long( argc, argv, optString, longOpts, &longIndex );
while( opt != -1 )
{
Expand Down Expand Up @@ -356,6 +360,10 @@ int main(int argc, char *argv[])
CFE_PSP_SetupLocal1Hz();
}

}

void OS_Application_Run(void)
{
/*
** Let the main thread sleep.
**
Expand All @@ -377,9 +385,6 @@ int main(int argc, char *argv[])
OS_printf(" with a Poweron Reset ( --reset PO ). \n");

OS_DeleteAllObjects();


return(0);
}

/******************************************************************************
Expand Down
14 changes: 14 additions & 0 deletions fsw/pc-rtems/make/build_options.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
##########################################################################
#
# Build options for "pc-rtems" PSP
# This file specifies any global-scope compiler options when using this PSP
#
##########################################################################

# This indicates where to install target binaries created during the build
# Note - this should be phased out in favor of the staging dir from OSAL BSP
set(INSTALL_SUBDIR "eeprom")

# Some upper-level code may be gated on _RTEMS_OS_ being defined
# This is for compatibility with older build scripts which defined this symbol,
# but no CFE/OSAL framework code depends on this symbol.
add_definitions("-D_RTEMS_OS_")


Loading

0 comments on commit 801bf27

Please sign in to comment.