Skip to content

Commit

Permalink
Imported Upstream version 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
aderbenev committed Nov 8, 2018
1 parent 3622ecf commit b52882f
Show file tree
Hide file tree
Showing 40 changed files with 664 additions and 539 deletions.
14 changes: 14 additions & 0 deletions .ci/travis-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -x -e

export EPICS_HOST_ARCH=`sh $HOME/epics-base/startup/EpicsHostArch`

make -j2

[ "$TEST" = "YES" ] || exit 0

lspci

make tapfiles

make -s test-results || find . -name '*.tap' -print0 | xargs -0 -n1 prove -e cat -f
66 changes: 66 additions & 0 deletions .ci/travis-prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh
set -e -x

cat << EOF > configure/RELEASE
EPICS_BASE=$HOME/epics-base
EOF

git clone --depth 10 --branch $BASE https://github.com/epics-base/epics-base.git $HOME/epics-base

export EPICS_HOST_ARCH=`sh $HOME/epics-base/startup/EpicsHostArch`

case "$STATIC" in
static)
cat << EOF >> "$HOME/epics-base/configure/CONFIG_SITE"
SHARED_LIBRARIES=NO
STATIC_BUILD=YES
EOF
;;
*) ;;
esac

case "$CMPLR" in
clang)
echo "Host compiler is clang"
cat << EOF >> $HOME/epics-base/configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH
GNU = NO
CMPLR_CLASS = clang
CC = clang
CCC = clang++
EOF
;;
*) echo "Host compiler is default";;
esac

# requires wine and g++-mingw-w64-i686
if [ "$WINE" = "32" ]
then
echo "Cross mingw32"
sed -i -e '/CMPLR_PREFIX/d' $HOME/epics-base/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
cat << EOF >> $HOME/epics-base/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
CMPLR_PREFIX=i686-w64-mingw32-
EOF
cat << EOF >> $HOME/epics-base/configure/CONFIG_SITE
CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw
EOF
fi

# set RTEMS to eg. "4.9" or "4.10"
if [ -n "$RTEMS" ]
then
echo "Cross RTEMS${RTEMS} for pc386"
curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
| tar -C / -xmj

sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' $HOME/epics-base/configure/os/CONFIG_SITE.Common.RTEMS
cat << EOF >> $HOME/epics-base/configure/os/CONFIG_SITE.Common.RTEMS
RTEMS_VERSION=$RTEMS
RTEMS_BASE=$HOME/.rtems
EOF
cat << EOF >> $HOME/epics-base/configure/CONFIG_SITE
CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386-qemu
EOF

fi

make -C "$HOME/epics-base" -j2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
/dbd/
/include/
/lib/
/cfg/
O.*/
*.local
28 changes: 19 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
sudo: false
dist: trusty
language: c
compiler:
- gcc
addons:
apt:
packages:
- libreadline6-dev
- libncurses5-dev
- perl
- clang
- qemu-system-x86
env:
- BASE=3.14 STATIC=shared
- BASE=3.14 STATIC=static
- BASE=7.0 STATIC=shared RTEMS=4.9 TEST=YES
- BASE=3.16 STATIC=shared TEST=YES
- BASE=3.16 STATIC=static RTEMS=4.9
- BASE=3.16 STATIC=shared CMPLR=clang RTEMS=4.10
- BASE=3.15 STATIC=shared
- BASE=3.15 STATIC=static
- BASE=3.16 STATIC=shared
- BASE=3.16 STATIC=static
install: ./build-deps.sh
script:
- make -j2
- make -s runtests
- BASE=3.14 STATIC=shared
- BASE=R3.14.12.2 STATIC=shared
install: .ci/travis-prepare.sh
script: .ci/travis-build.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ VCS sources
git clone https://github.com/epics-modules/devlib2.git
```

This is file is generated from git revision bc6c46921f5ae3cf367dac5ab22b15c8c05ce1a2
This is file is generated from git revision 20b84595e899bc5be4ee37f967c973dd7c051e7c

<a href="https://travis-ci.org/epics-modules/devlib2"><img src="https://travis-ci.org/epics-modules/devlib2.svg">CI Build Status</img></a>
43 changes: 0 additions & 43 deletions build-deps.sh

This file was deleted.

11 changes: 11 additions & 0 deletions common/devlibversion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef DEVLIBVERSION_H
#define DEVLIBVERSION_H

#include <epicsVersion.h>

#ifndef VERSION_INT
# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
# define EPICS_VERSION_INT VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL)
#endif

#endif // DEVLIBVERSION_H
2 changes: 2 additions & 0 deletions configure/CONFIG_DEVLIB2_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DEVLIB2_MAJOR_VERSION = 2
DEVLIB2_MINOR_VERSION = 10
19 changes: 19 additions & 0 deletions configure/CONFIG_SITE
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,22 @@
# If you don't want to install into $(TOP) then
# define INSTALL_LOCATION here
#INSTALL_LOCATION=<fullpathname>

# we don't actually use 'rset' directly,
# but want to suppress deprecation warnings
USR_CPPFLAGS += -DUSE_TYPED_RSET

# A epicsMMIO.h is included in Base >=3.15.
# By default we don't install our epicsMMIO.h when this is true.
# Set to YES to always install our epicsMMIO.h
#REPLACE_MMIO=NO

# Uncomment the following to enable strict treatment of warnings
#USR_CFLAGS += -Wall -Wextra -Werror -Wno-error=unused-parameter
#USR_CXXFLAGS += -Wall -Wextra -Werror -Wno-error=unused-parameter -Wno-error=deprecated-declarations

# Set to YES to link executable (mostly) statically
#STATIC_BUILD=NO

-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local
2 changes: 2 additions & 0 deletions configure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ CHECK_RELEASE = YES
TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))

CFG += CONFIG_DEVLIB2_VERSION

include $(TOP)/configure/RULES

2 changes: 1 addition & 1 deletion documentation/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PROJECT_NAME = devLib2
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 2.9
PROJECT_NUMBER = 2.10

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
Expand Down
118 changes: 118 additions & 0 deletions documentation/explore.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

/** @page exploreapp PCI driver/hardware development tool
@section exploreintro Purpose
The exploreApp support is intended as a tool to explore new PCI devices.
This may be useful when preparing to write a dedicated driver and/or
during development of PCI/PCIe device firmware.
exploreApp allows a PCI register to be read and/or written an EPICS record.
For example:
@code
record(longout, "pcitestout") {
field(DTYP, "Explore Write32 LSB")
field(OUT , "@8:0.0 bar=0 offset=0xc")
}
@endcode
The record @b pcitestout will be connected to the PCI device 8:0.0 (bus 8, device 0, function 0) with the first BAR.
A single write of 4 bytes is made when the record is processed.
The following can be added to some @b xyzApp/src/Makefile to include exploreApp.
@code
PROD_IOC += myioc
DBD += myioc.dbd
myioc_DBD += exploreSupport.dbd
myioc_LIBS += explorepci epicspci
@endcode
@section exploreopts Options
@b INP/OUT link strings may contain the following components
@li "bar=#" (default: 0)
@li "offset=#" in bytes (default: 0)
@li "mask=#" bit mask (default: 0 aka. no mask)
@li "shift=#" in bits (default: 0)
@li "step=#" in bytes (default: read size. eg Read32 defaults to step=4)
@li "initread=1|0" bool (default: 1 for .OUT recordtypes, 0 otherwise)
For record types: @b longout, @b bo, @b mbbo, @b mbboDirect, @b ao
allowed @b DTYP are:
@li Explore Write8
@li Explore Write16 NAT
@li Explore Write16 LSB
@li Explore Write16 MSB
@li Explore Write32 NAT
@li Explore Write32 LSB
@li Explore Write32 MSB
For record types: @b longin, @b longout, @b bi, @b bo, @b mbbi, @b mbbo, @b mbbiDirect, @b mbboDirect, @b ai, @b ao
@li Explore Read8
@li Explore Read16 NAT
@li Explore Read16 LSB
@li Explore Read16 MSB
@li Explore Read32 NAT
@li Explore Read32 LSB
@li Explore Read32 MSB
The @b ao record type also accepts
@li Explore WriteF32 LSB
@li Explore WriteF32 MSB
The @b ai record type also accepts
@li Explore ReadF32 LSB
@li Explore ReadF32 MSB
The @b waveform record type accepts both integer Read and Write @b DTYP.
The @b step= link option may be applied to change how the address counter is incremented.
The default step size is the read size (eg. 4 for Read32).
A step size of 0 will read the base address @b NELM times.
@section exploreirq PCI Interrupt
Limited support of PCI interrupts is available on Linux only.
A @b longin record with DTYP="Explore IRQ Count" and SCAN="I/O Intr"
will be processed each time an interrupt occurs.
This requires that a UIO kernel module be installed.
@section explorefrib FRIB Specific
The DTYP="Explore FRIB Flash" support implements a FRIB specific protocol
for accessing a SPI flash chip over PCI.
The @b frib-flash.db file demonstrates use.
*/

/** @page iocsh IOC shell functions
Several IOC shell functions are provided to access PCI and VME devices
@section iocshpci IOCsh functions for PCI devices
- devPCIShow() List PCI devices present
- devLibPCIUse() Select PCI system access implementation
- pcidiagset() Select device for read/write functions
- pciwrite()
- pciread()
- pciconfread()
To use, begin by calling pcidiagset() to select the device and BAR that subsequent
read/write calls will operate on.
@section iocshvme IOCsh functions for VME devices
- vmeread()
- vmewrite()
- vmeirqattach()
- vmeirq()
*/
Loading

0 comments on commit b52882f

Please sign in to comment.