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

Vxworks7 #193

Closed
wants to merge 6 commits into from
Closed
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
13 changes: 13 additions & 0 deletions fsw/5020-vxworks7/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

include_directories(inc)

# Build the sp0-vxworks implementation as a library
add_library(psp-${CFE_SYSTEM_PSPNAME}-impl OBJECT
src/cfe_psp_exception.c
src/cfe_psp_memory.c
src/cfe_psp_memtab.c
src/cfe_psp_start.c
src/cfe_psp_support.c
src/cfe_psp_timer.c
src/cfe_psp_watchdog.c)

108 changes: 108 additions & 0 deletions fsw/5020-vxworks7/inc/cfe_psp_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
** cfe_psp_config.h
**
** Copyright (c) 2004-2011, United States Government as represented by
** Administrator for The National Aeronautics and Space Administration.
** All Rights Reserved.
**
** This is governed by the NASA Open Source Agreement and may be used,
** distributed and modified only pursuant to the terms of that agreement.
**
*/

#ifndef _cfe_psp_config_
#define _cfe_psp_config_

#include "common_types.h"

#include <stdio.h>
#include <string.h>
#include <vxWorks.h>
#include <sysLib.h>
#include "speLib.h"
#include "excLib.h"
#include "taskLib.h"
#include "arch/ppc/esfPpc.h"
#include "fppLib.h"

/*
** This define sets the number of memory ranges that are defined in the memory range defintion
** table.
*/
#define CFE_PSP_MEM_TABLE_SIZE 10

/**
* This define sets the maximum number of exceptions
* that can be stored.
*
* It must always be a power of two.
*/
#define CFE_PSP_MAX_EXCEPTION_ENTRIES 4

/*
** Typedef for the layout of the vxWorks boot record structure
**
** This is statically placed at the beginning of system memory (sysMemTop)
** which should be reserved in the kernel.
*/
typedef struct
{
uint32 bsp_reset_type;
uint32 spare1;
uint32 spare2;
uint32 spare3;

} CFE_PSP_ReservedMemoryBootRecord_t;


/**
* \brief The data type used by the underlying OS to represent a thread ID.
*/
typedef TASK_ID CFE_PSP_Exception_SysTaskId_t;

/*
** Global variables
*/
typedef struct
{
UINT32 timebase_upper; /* Upper 32 bits of timebase as sampled by hook */
UINT32 timebase_lower; /* Lower 32 bits of timebase as sampled by hook */
int vector; /* vector number */
ESFPPC esf; /* Exception stack frame */
FP_CONTEXT fp; /* floating point registers */

} CFE_PSP_Exception_ContextDataEntry_t;

/*
** Watchdog minimum and maximum values ( in milliseconds )
*/
#define CFE_PSP_WATCHDOG_MIN (0)
#define CFE_PSP_WATCHDOG_MAX (0xFFFFFFFF)

/*
** Number of EEPROM banks on this platform
*/
#define CFE_PSP_NUM_EEPROM_BANKS 1

/*
* The alignment to use for each reserved memory block.
*
* This is a mask to be applied to each block base address
*
* Chosen as the cache line size of the SP0 processor (32 bytes)
* such that the blocks will be cached more efficiently.
*/
#define CFE_PSP_MEMALIGN_MASK ((cpuaddr)0x1F)

/* The task and task priority for existing VxWorks task.
*/
typedef struct
{
const char * VxWorksTaskName;
int32 VxWorksTaskPriority;
} CFE_PSP_OS_Task_and_priority_t;


#endif /* _cfe_psp_config_ */


33 changes: 33 additions & 0 deletions fsw/5020-vxworks7/inc/psp_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
** $Id: psp_version.h 1.1.1.1 2009/08/10 17:11:07BST bmedina Exp $
**
**
** Copyright (c) 2004-2011, United States Government as represented by
** Administrator for The National Aeronautics and Space Administration.
** All Rights Reserved.
**
** This is governed by the NASA Open Source Agreement and may be used,
** distributed and modified only pursuant to the terms of that agreement.
**
**
**
** Purpose:
** Provide version identifiers for the cFE Platform Support Packages (PSP).
**
*/

#ifndef _psp_version_
#define _psp_version_

#define CFE_PSP_IMPL_MAJOR_VERSION 0
#define CFE_PSP_IMPL_MINOR_VERSION 1
#define CFE_PSP_IMPL_REVISION 0
#define CFE_PSP_IMPL_MISSION_REV 0

#define CFE_PSP_IMPL_VERSION "5020 testing"

/*
** Macro Definitions
*/
#endif /* _psp_version_ */

25 changes: 25 additions & 0 deletions fsw/5020-vxworks7/make/build_options.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This indicates where to install target binaries created during the build
set(INSTALL_SUBDIR "cf")

message(STATUS "WIND_BASE IS $ENV{WIND_BASE}")

##
## Target Defines for the OS, Hardware Arch, etc..
##
#add_definitions("-DVOLTAB_PATH=\"/ram0/cf\"")
#add_definitions("-D_VXWORKS_OS_ -D_HAVE_STDINT_ -D_PPC_ -D__PPC__ -D_EMBED_ -DTOOL_FAMILY=gnu -DTOOL=e500v2gnu -D_WRS_KERNEL -DCPU=PPC85XX -DCPU_VARIANT=_ppc85xx_e500v2 \"-D_VSB_CONFIG_FILE=<../lib/h/config/vsbConfig.h>\"")


##
## Endian Defines
##
add_definitions(-D_EB -DENDIAN=_EB -DSOFTWARE_BIG_BIT_ORDER)

##
## Compiler Architecture Switches
##
#add_definitions("-mcpu=8548 -te500v2 -mstrict-align -fno-builtin -fvolatile -mhard-float -fno-implicit-fp -mfloat-gprs=double -mspe=yes -mabi=spe -mlongcall")

#include_directories($ENV{WIND_BASE}/target/h/wrn/coreip)
#include_directories($ENV{WIND_BASE}/target/3rdparty/aitech/sp0)
#include_directories($ENV{WIND_BASE}/target/config/sp0)
114 changes: 114 additions & 0 deletions fsw/5020-vxworks7/make/compiler-opts.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
###############################################################################
## compiler-opts.mak - compiler definitions and options for building the cFE
##
## Target: PPC AiTech SP0 (Freescale 8548, e500 core) COTS board with vxWorks 6.x
###############################################################################

##
## Warning Level Configuration
##
## WARNINGS =-Wall -ansi -pedantic -Wstrict-prototypes
WARNINGS = -Wall

##
## A fix for Windows systems on vxWorks 6.4
## When generating dependancies, the Windows GCC cannot seem to deal
## with the Windows style path separators in the WIND_BASE macro.
##
FIXED_WIND_BASE = $(subst \,/,$(WIND_BASE))

##
## vxWorks system includes
##
VXINCDIR = $(FIXED_WIND_BASE)/target/h \
$(FIXED_WIND_BASE)/target/h/wrn/coreip \
$(FIXED_WIND_BASE)/target/h/drv \
$(FIXED_WIND_BASE)/target/src/config \
$(FIXED_WIND_BASE)/target/src/drv \
$(FIXED_WIND_BASE)/target/config/comps/src \
$(FIXED_WIND_BASE)/target/config/comps/src/dosfs2 \

SYSINCS = $(VXINCDIR:%=-I%)

##
## Target Defines for the OS, Hardware Arch, etc..
##
TARGET_DEFS += -D_VXWORKS_OS_ -D_PPC_ -D__PPC__ $(CFE_SB_NET) -D$(OS) -D_EMBED_ \
-DTOOL_FAMILY=gnu -DTOOL=e500v2gnu -D_WRS_KERNEL -DCPU=PPC85XX \
-DCPU_VARIANT=_ppc85xx_e500v2 \
"-D_VSB_CONFIG_FILE=<../lib/h/config/vsbConfig.h>"

##
## Endian Defines
##
ENDIAN_DEFS = -D_EB -DENDIAN=_EB -DSOFTWARE_BIG_BIT_ORDER

##
## Compiler Architecture Switches
##
ARCH_OPTS = -gstatement-frontiers -mcpu=e500mc -D_WRS_HARDWARE_FP -mabi=elfv2 -mcmodel=medium -fstrength-reduce \
-mtls-size=16 -mhard-float -D__ppc -D__ppc__ -m64 -D__ppc64__ -mstrict-align -std=c11 -D__vxworks \
-D__VXWORKS__ -D__ELF__ -D_HAVE_TOOL_XTORS -ftls-model=local-exec -fno-zero-initialized-in-bss \
-fno-builtin -fno-strict-aliasing -D_USE_INIT_ARRAY -Wall -Wconversion -Wno-sign-conversion -MD -MP \
-mlongcall -DCPU=_VX_PPCE500MC -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL -D_WRS_VX_SMP -D_WRS_CONFIG_SMP \
-D_VSB_CONFIG_FILE="/home/darkwing/work/nasa/582/cfs_5545/workspace/hello2/../vsb_5020/h/config/vsbConfig.h"

##
## Application specific compiler switches
##
ifeq ($(BUILD_TYPE),CFE_APP)
APP_COPTS = -mlongcall
APP_ASOPTS =
else
APP_COPTS =
APP_ASOPTS =
endif

##
## Extra Cflags for Assembly listings, etc.
##
LIST_OPTS = -Wa,-a=$*.lis

##
## gcc options for dependancy generation
##
COPTS_D = $(APP_COPTS) $(ENDIAN_DEFS) $(TARGET_DEFS) $(ARCH_OPTS) $(SYSINCS) $(WARNINGS)

##
## General gcc options that apply to compiling and dependency generation.
##
COPTS = $(LIST_OPTS) $(COPTS_D)

##
## Extra defines and switches for assembly code
##
ASOPTS = $(APP_ASOPTS) -P -xassembler-with-cpp

##---------------------------------------------------------
## Application file extention type
## This is the defined application extention.
## Known extentions: Mac OS X: .bundle, Linux: .so,
## RTEMS: .s3r, vxWorks: .o etc..
##---------------------------------------------------------
APP_EXT = o

####################################################
## Host Development System and Toolchain definitions
##
## Host OS utils
##
RM = rm -f
CP = cp

##
## Compiler tools
##
COMPILER = ccppc
ASSEMBLER = ccppc
LINKER = ldppc
AR = arppc
NM = nmppc
OBJCPY = objcopyppc
TABLE_BIN = elf2cfetbl


37 changes: 37 additions & 0 deletions fsw/5020-vxworks7/make/link-rules.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###############################################################################
# File: link-rules.mak
#
# Purpose:
# Makefile for linking code and producing the cFE Core executable image.
###############################################################################
##
## Executable target. This is target specific
##
EXE_TARGET=cfe-core.o

CORE_INSTALL_FILES = $(EXE_TARGET)


##
## Linker flags that are needed
##
LDFLAGS =

##
## Libraries to link in
##
LIBS =

##
## cFE Core Link Rule
##
$(EXE_TARGET): $(CORE_OBJS)
$(COMPILER) $(DEBUG_FLAGS) -r -nostdlib -o $(EXE_TARGET) $(CORE_OBJS)

##
## Application Link Rule
##
$(APPTARGET).$(APP_EXT): $(OBJS)
$(LINKER) -r $(OBJS) -o $@


Loading