Skip to content

Commit

Permalink
Merge 5056fc0 into cbba08b
Browse files Browse the repository at this point in the history
  • Loading branch information
hjunkes committed Sep 3, 2020
2 parents cbba08b + 5056fc0 commit 30e4493
Show file tree
Hide file tree
Showing 78 changed files with 3,298 additions and 387 deletions.
2 changes: 1 addition & 1 deletion .ci
Submodule .ci updated 1 files
+4 −4 cue.py
9 changes: 6 additions & 3 deletions .travis.yml
Expand Up @@ -73,13 +73,16 @@ jobs:

- env: WINE=32 TEST=NO BCFG=static

- env: WINE=32 TEST=NO
# - env: WINE=32 TEST=NO

# Cross-compilation to RTEMS

- env: RTEMS=4.10
# - env: RTEMS=4.10

- env: RTEMS=4.9
# - env: RTEMS=4.9

- env: RTEMS=5
#

# MacOS build

Expand Down
5 changes: 3 additions & 2 deletions configure/CONFIG_COMMON
Expand Up @@ -142,9 +142,10 @@ BUILDLIB_SUFFIX = $(BUILDLIB_SUFFIX_$(SHARED_LIBRARIES))
#--------------------------------------------------
# vpath directories
POSIX_YES = os/posix
OS_IMPL_DIRS = $(if $(OS_API),os/$(OS_CLASS)-$(OS_API),) os/$(OS_CLASS)
GENERIC_SRC_DIRS = .. $(SRC_DIRS)
OS_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \
$(addprefix $(dir)/, os/$(OS_CLASS) $(POSIX_$(POSIX)) os/default ))
$(addprefix $(dir)/, $(OS_IMPL_DIRS) $(POSIX_$(POSIX)) os/default ))
CMPLR_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \
$(addprefix $(dir)/, compiler/$(CMPLR_CLASS) compiler/default ))
ALL_SRC_DIRS = $(CMPLR_SRC_DIRS) $(OS_SRC_DIRS) $(GENERIC_SRC_DIRS)
Expand Down Expand Up @@ -306,7 +307,7 @@ LDLIBS = $(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS)\
CPPFLAGS = $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\
$(DEBUG_CPPFLAGS) $(WARN_CPPFLAGS) $(BASE_CPPFLAGS) $(TARGET_CPPFLAGS)\
$(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\
$(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS) $(API_CPPFLAGS)
$(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)

#--------------------------------------------------
# ar definition default
Expand Down
40 changes: 37 additions & 3 deletions configure/os/CONFIG.Common.RTEMS
Expand Up @@ -33,7 +33,7 @@ RTEMS_BSP ?= $(subst RTEMS-,,$(T_A))

#-------------------------------------------------------
# Pick up the RTEMS tool/path definitions from the RTEMS BSP directory.
include $(RTEMS_BASE)/$(RTEMS_TARGET_CPU)-rtems$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
include $(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(CONFIG.CC)

Expand Down Expand Up @@ -94,16 +94,50 @@ MODEXT=.obj
# operating system class (include/os/<os_class>)
OS_CLASS = RTEMS

#--------------------------------------------------
#print warning
ifeq ($(RTEMS_HAS_POSIX_API),no)
ifeq ($(EPICS_VERSION),7)
$(error Warning: Epics Version $(EPICS_VERSION) must not be used without POSIX enabled on RTEMS !!!)
endif
endif
# operating system API (src/os/<os_class>-<os-api>)
ifeq ($(RTEMS_HAS_POSIX_API),yes)
OS_API = posix
else
OS_API = kernel
endif

# meantime we still use kernel for 4.9 and 4.10
ifneq ($(RTEMS_API),5)
OS_API = kernel
endif
#--------------------------------------------------
# Operating system flags
OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -lCom -lnfs -lm
OP_SYS_LDFLAGS += $(CPU_CFLAGS) -u Init \
#OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -lCom -lnfs -lm
ifeq ($(RTEMS_API),5)
OP_SYS_CFLAGS += -D__LINUX_ERRNO_EXTENSIONS__
#OP_SYS_LDLIBS += -lrtemsCom -lrtemscpu -lrtemsbsp -ltftpfs -ltelnetd -lbsd -lz -lm
OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -ltftpfs -lbsd -lz -lm
else
OP_SYS_LDLIBS += -lrtemsCom -lrtemscpu -lrtemsbsp
endif

ifeq ($(RTEMS_HAS_NETWORKING),yes)
OP_SYS_CFLAGS += -DRTEMS_LEGACY_STACK
else
OP_SYS_CFLAGS += -DHAVE_SOCKADDR_SA_LEN=1
endif

OP_SYS_LDFLAGS_posix += -u POSIX_Init
OP_SYS_LDFLAGS_kernel += $(CPU_CFLAGS) -u Init \
$(PROJECT_RELEASE)/lib/no-dpmem.rel \
$(PROJECT_RELEASE)/lib/no-mp.rel \
$(PROJECT_RELEASE)/lib/no-part.rel \
$(PROJECT_RELEASE)/lib/no-signal.rel \
$(PROJECT_RELEASE)/lib/no-rtmon.rel

OP_SYS_LDFLAGS += $(CPU_CFLAGS) $(OP_SYS_LDFLAGS_$(OS_API))
MOD_SYS_LDFLAGS += $(CPU_CFLAGS) -Wl,-r -nostdlib

# Do not link against libraries which are part of the Generic Image
Expand Down
18 changes: 18 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-beagleboneblack
@@ -0,0 +1,18 @@
#
# CONFIG.Common.RTEMS-beaglebineblack
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = beagleboneblack
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/beagleboneblack/lib/

include $(CONFIG)/os/CONFIG.Common.RTEMS



8 changes: 6 additions & 2 deletions configure/os/CONFIG.Common.RTEMS-beatnik
Expand Up @@ -8,14 +8,18 @@ EXE = .elf
RTEMS_BSP = beatnik
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
# optimization trouble in postfix.c
ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120

OP_SYS_LDLIBS += -lbspExt
OP_SYS_LDLIBS += -lbspExt #does not use posix stuff ... want to ignore

MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef
Expand Down
9 changes: 5 additions & 4 deletions configure/os/CONFIG.Common.RTEMS-pc386
Expand Up @@ -7,15 +7,16 @@
#
RTEMS_BSP = pc386
RTEMS_TARGET_CPU = i386
GNU_TARGET = i386-rtems

MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RM) $*.bin
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $*.bin
$(BIN2BOOT) $@ 0x00097E00 \
$(PROJECT_RELEASE)/lib/start16.bin 0x00097C00 0 $*.bin 0x00100000 0
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@
endef

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/pc686/lib/

include $(CONFIG)/os/CONFIG.Common.RTEMS

#
Expand Down
3 changes: 2 additions & 1 deletion configure/os/CONFIG.Common.RTEMS-pc386-qemu
Expand Up @@ -6,6 +6,7 @@
#-------------------------------------------------------

# Include definitions from RTEMS-pc386
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc386
# For Tests overwrite it with pc686
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc686

RTEMS_QEMU_FIXUPS = YES
25 changes: 25 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-pc686
@@ -0,0 +1,25 @@
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = pc686
RTEMS_TARGET_CPU = i386
GNU_TARGET = i386-rtems

MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@
endef

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/pc686/lib/

include $(CONFIG)/os/CONFIG.Common.RTEMS

#
# Put text segment where it will work with etherboot
#
OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000
48 changes: 48 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-qoriq_e500
@@ -0,0 +1,48 @@
#
# CONFIG.Common.RTEMS-qoriq_e500
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
EXE = .elf
RTEMS_BSP = qoriq_e500
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
# optimization trouble in postfix.c
#ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL

#ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
#ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120

#netbsdlib
#ARCH_DEP_CFLAGS += -I$(RTEMS_BASE)/powerpc-rtems5/qoriq_e500/lib/include

#OP_SYS_LDLIBS += -lbspExt #does not use posix stuff ... want to ignore
OP_SYS_LDLIBS += -Wl,--gc-sections
#ARCH_DEP_LDFLAGS = -mcpu=8540 -meabi -msdata=sysv -mstrict-align -mspe -mabi=spe -mfloat-gprs=double
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/powerpc-rtems5/qoriq_e500/lib

MUNCH_SUFFIX = .img
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
gzip -9 -f $@
mkimage -A ppc -O linux -T kernel -a 0x4000 -e 0x4000 -n $* -d $@.gz $*.img
endef

include $(CONFIG)/os/CONFIG.Common.RTEMS

RTEMSSYMS=$(PRODNAME:%$(EXE)=%.sym)
RTEMSIMGS=$(PRODNAME:%$(EXE)=%.bin)
INSTALL_RTEMSSYMS=$(RTEMSSYMS:%=$(INSTALL_BIN)/%)
INSTALL_RTEMSIMGS=$(RTEMSIMGS:%=$(INSTALL_BIN)/%)

%.sym: %$(EXE)
$(XSYMS) $^ $@

%.bin: %$(EXE)
$(OBJCOPY) -Obinary $^ $@

#PRODTARGETS+=$(INSTALL_RTEMSSYMS) $(INSTALL_RTEMSIMGS)
20 changes: 20 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-xilinx_zynq_a9_qemu
@@ -0,0 +1,20 @@
#
# CONFIG.Common.RTEMS-xilinx_zynq_a9_qemu
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = xilinx_zynq_a9_qemu
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems

#use dhcp/bootp
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/xilinx_zynq_a9_qemu/lib/


include $(CONFIG)/os/CONFIG.Common.RTEMS

19 changes: 19 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-xilinx_zynq_zedboard
@@ -0,0 +1,19 @@
#
# CONFIG.Common.RTEMS-xilinx_zynq_zedboard
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = xilinx_zynq_zedboard
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/xilinx_zynq_zedboard/lib/


include $(CONFIG)/os/CONFIG.Common.RTEMS



3 changes: 2 additions & 1 deletion configure/os/CONFIG.darwin-x86.Common
Expand Up @@ -3,6 +3,7 @@
# Definitions for darwin-x86 host builds
# Sites may override these definitions in CONFIG_SITE.darwin-x86.Common
#-------------------------------------------------------

#support for IPv6 etc.
OP_SYS_CFLAGS += -DHAVE_SOCKADDR_SA_LEN=1
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common
6 changes: 3 additions & 3 deletions configure/os/CONFIG_SITE.Common.RTEMS
Expand Up @@ -5,9 +5,9 @@

# Where to find RTEMS
#
# APS:
RTEMS_VERSION = 4.10.2
RTEMS_BASE = /usr/local/vw/rtems/rtems-$(RTEMS_VERSION)
# FHI:
RTEMS_VERSION = 5
RTEMS_BASE = /home/h1/GSOC/RTEMS/

# Cross-compile toolchain in $(RTEMS_TOOLS)/bin
#
Expand Down
17 changes: 17 additions & 0 deletions documentation/RELEASE_NOTES.md
Expand Up @@ -17,6 +17,23 @@ should also be read to understand what has changed since earlier releases.

<!-- Insert new items immediately below here ... -->

### Support for RTEMS 5 (5.1 released aug 2020)

The new major release of the RTEMS real-time OS contains many changes including
the ability to support SMP systems. The earlier EPICS support for RTEMS made use
of various RTEMS-specific kernel APIs which cannot be used on an SMP system, so
the changes here required acompletely new port to the Posix real-time APIs that
RTEMS-5 now recommends.
A new RTEMS configuration variable RTEMS_SERIES has been added which should be
set to the first two components of the OS version number, e.g. 4.9. When this
is 4.12 or greater, true for 5.0 as well, the new libCom/osi/os/RTEMS-posix
source files will be used; the older API source files can now be found in
libCom/osi/os/RTEMS-kernel, and those which are common to both installations are
in libCom/osi/os/RTEMS. The compiler options are read from the Makefile.inc of
the corresponding BSP and set in the configuration files. It checks that the BSP
was also built with the --enable-posix option. It also checks if the BSP was built
with the legacy stack or libbsd.

### Add registerAllRecordDeviceDrivers()

Addition of registerAllRecordDeviceDrivers() as an iocsh function
Expand Down
9 changes: 9 additions & 0 deletions modules/libcom/RTEMS/Makefile
Expand Up @@ -11,22 +11,31 @@ TOP = ../../..
include $(TOP)/configure/CONFIG
include $(TOP)/configure/CONFIG_LIBCOM_VERSION

# check check
SRC_DIRS += ../$(OS_API)

PERL_SCRIPTS += epicsMakeMemFs.pl

INC += epicsRtemsInitHooks.h
INC += epicsMemFs.h
INC += epicsNtp.h

ifeq ($(RTEMS_QEMU_FIXUPS),YES)
rtems_init_CPPFLAGS += -DQEMU_FIXUPS
endif
rtemsCom_SRCS += rtems_init.c
rtemsCom_SRCS += rtems_config.c
ifeq ($(RTEMS_HAS_NETWORKING), yes)
rtemsCom_SRCS += rtems_netconfig.c
else
rtemsCom_SRCS += libbsd_netconfig.c
endif
rtemsCom_SRCS += rtems_util.c
rtemsCom_SRCS += setBootConfigFromNVRAM.c
rtemsCom_SRCS += epicsRtemsInitHookPre.c
rtemsCom_SRCS += epicsRtemsInitHookPost.c
rtemsCom_SRCS += epicsMemFs.c
rtemsCom_SRCS += epicsNtp.c

ifeq ($(RTEMS_BSP),pc386)
rtemsCom_SRCS += ne2kpci.c
Expand Down
1 change: 0 additions & 1 deletion modules/libcom/RTEMS/epicsMemFs.c
@@ -1,6 +1,5 @@
/*************************************************************************\
* Copyright (c) 2014 Brookhaven National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
Expand Down
9 changes: 0 additions & 9 deletions modules/libcom/RTEMS/epicsMemFs.h
@@ -1,6 +1,5 @@
/*************************************************************************\
* Copyright (c) 2014 Brookhaven National Laboratory.
* SPDX-License-Identifier: EPICS
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
Expand All @@ -20,14 +19,6 @@ typedef struct {
const epicsMemFile * const *files;
} epicsMemFS;

#ifdef __cplusplus
extern "C" {
#endif

int epicsMemFsLoad(const epicsMemFS *fs);

#ifdef __cplusplus
}
#endif

#endif // EPICSMEMFS_H

0 comments on commit 30e4493

Please sign in to comment.