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 #261, #312, and #362, OSAL build cleanup (multiple issues) #404

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
503 changes: 258 additions & 245 deletions CMakeLists.txt

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions src/bsp/mcp750-vxworks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
######################################################################
#
# CMAKE build recipe for MCP750 Board Support Package (BSP)
#
######################################################################

add_library(osal_mcp750-vxworks_impl OBJECT
src/bsp_start.c
src/bsp_voltab.c
src/bsp_console.c
)

target_include_directories(osal_mcp750-vxworks_impl PUBLIC
$ENV{WIND_BASE}/target/h
$ENV{WIND_BASE}/target/h/wrn/coreip
$ENV{WIND_BASE}/target/config/mcp750
)

# NOTE: the __PPC__ and MCP750 macros are referenced in some system headers.
# therefore all code compiled for this platform should always define these symbols.
target_compile_definitions(osal_mcp750-vxworks_impl PUBLIC
"__PPC__"
"MCP750"
)


8 changes: 8 additions & 0 deletions src/bsp/mcp750-vxworks/build_options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##########################################################################
#
# Build options for "mcp750-vxworks" BSP
#
##########################################################################

# This indicates where to stage target binaries created during the build
set(OSAL_BSP_STAGING_INSTALL_DIR "CF:0")
97 changes: 0 additions & 97 deletions src/bsp/mcp750-vxworks/make/compiler-opts.mak

This file was deleted.

35 changes: 0 additions & 35 deletions src/bsp/mcp750-vxworks/make/link-rules.mak

This file was deleted.

52 changes: 52 additions & 0 deletions src/bsp/mcp750-vxworks/src/bsp_console.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/******************************************************************************
** File: bsp_console.c
**
**
** This is governed by the NASA Open Source Agreement and may be used,
** distributed and modified only pursuant to the terms of that agreement.
**
** Copyright (c) 2004-2006, United States government as represented by the
** administrator of the National Aeronautics Space Administration.
** All rights reserved.
**
**
** Purpose:
** OSAL BSP debug console abstraction
**
******************************************************************************/

#include <string.h>
#include <unistd.h>
#include <stdio.h>

#include "mcp750_bsp_internal.h"
#include "bsp-impl.h"

/****************************************************************************************
BSP CONSOLE IMPLEMENTATION FUNCTIONS
****************************************************************************************/

/*----------------------------------------------------------------
OS_BSP_ConsoleOutput_Impl
See full description in header
------------------------------------------------------------------*/
void OS_BSP_ConsoleOutput_Impl(const char *Str, uint32 DataLen)
{
while (DataLen > 0)
{
putchar(*Str);
++Str;
--DataLen;
}
}

/*----------------------------------------------------------------
OS_BSP_ConsoleSetMode_Impl() definition
See full description in header
------------------------------------------------------------------*/
void OS_BSP_ConsoleSetMode_Impl(uint32 ModeBits)
{
/* ignored; not implemented */
}


71 changes: 30 additions & 41 deletions src/bsp/mcp750-vxworks/src/bsp_start.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/******************************************************************************
** File: bsp_start.c
**
** This is governed by the NASA Open Source Agreement and may be used,
** distributed and modified only pursuant to the terms of that agreement.
** This is governed by the NASA Open Source Agreement and may be used,
** distributed and modified only pursuant to the terms of that agreement.
**
** Copyright (c) 2004-2006, United States government as represented by the
** administrator of the National Aeronautics Space Administration.
** All rights reserved.
** Copyright (c) 2004-2006, United States government as represented by the
** administrator of the National Aeronautics Space Administration.
** All rights reserved.
**
** Purpose:
**
**
** OSAL main entry point.
**
** History:
Expand All @@ -19,23 +19,10 @@
/*
** Include Files
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "vxWorks.h"
#include "sysLib.h"
#include "taskLib.h"

/*
** OSAL includes
*/
#include "common_types.h"
#include "osapi.h"
#include <string.h>

/*
** External Declarations
*/
void OS_Application_Startup(void);
#include "mcp750_bsp_internal.h"

/******************************************************************************
** Function: OS_BSPMain()
Expand All @@ -47,30 +34,32 @@ void OS_Application_Startup(void);
** (none)
**
** Return:
** (none)
** integer return code, with zero indicating normal exit, nonzero
** indicating an off-nominal condition
*/

void OS_BSPMain( void )
int OS_BSPMain(void)
{
int TicksPerSecond;

/*
** Delay for one second.
*/
TicksPerSecond = sysClkRateGet();
(void) taskDelay( TicksPerSecond );
/*
* Initially clear the global object (this contains return code)
*/
memset(&OS_BSP_Global, 0, sizeof(OS_BSP_Global));

OS_printf("Starting Up OSAPI App.\n");

/*
** Call OSAL entry point.
*/
OS_Application_Startup();
/*
* Call application specific entry point.
* This should set up all user tasks and resources, then return
*/
OS_Application_Startup();

/*
** Exit the main thread.
** in VxWorks we can delete all of the OS tasks if we want.
*/
/*
* OS_Application_Run() implements the background task.
* The user application may provide this, or a default implementation
* is used which just calls OS_IdleLoop().
*/
OS_Application_Run();

/*
* Return to shell with the current status code
*/
return OS_BSP_Global.AppStatus;
}

27 changes: 27 additions & 0 deletions src/bsp/mcp750-vxworks/src/mcp750_bsp_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/******************************************************************************
** File: mcp750_bsp_internal.h
**
**
** This is governed by the NASA Open Source Agreement and may be used,
** distributed and modified only pursuant to the terms of that agreement.
**
** Copyright (c) 2004-2006, United States government as represented by the
** administrator of the National Aeronautics Space Administration.
** All rights reserved.
**
**
** Purpose:
** Header file for internal data to the MCP750 BSP
**
******************************************************************************/

#ifndef _MCP750_BSP_INTERNAL_H_
#define _MCP750_BSP_INTERNAL_H_

/*
** OSAL includes
*/
#include "osapi.h"
#include "bsp-impl.h"

#endif /* _MCP750_BSP_INTERNAL_H_ */
Loading