Compare commits

..

55 Commits

Author SHA1 Message Date
Janet B. Anderson
e4f741f97c Changed release to R3.14.10. 2008-10-27 19:41:22 +00:00
Janet B. Anderson
0e08b62f34 R3.14.10 2008-10-27 19:39:04 +00:00
Janet B. Anderson
2b37a8f746 Added make -j option ifeq before creating arch dependancies on host_arch. 2008-10-27 19:24:45 +00:00
Andrew Johnson
f5967d268c False assertion removed. 2008-10-24 23:04:11 +00:00
Andrew Johnson
078e30b7b9 Mantis #311 fix; generate an interactive flex scanner. 2008-10-23 21:21:43 +00:00
Andrew Johnson
01349a9448 Add epicsShare decorators for visibility in a Cygwin DLL. 2008-10-23 19:27:24 +00:00
Andrew Johnson
dd2ef6d47a Reformatting, wording improvements. 2008-10-22 15:20:50 +00:00
Jeff Hill
2d51fbc3c7 fixed mantis 325 2008-10-21 20:50:26 +00:00
Jeff Hill
c5f15a3e17 fixed bug introduced after R3.14.9, but before R3.14.10-RC1 and R3.14.10-RC2 2008-10-21 20:26:48 +00:00
Andrew Johnson
cdd2748c98 Allow multiple slashes as path seperators, since we used to.
Also fixed perldoc comment formatting.
2008-10-20 18:32:47 +00:00
Andrew Johnson
6789814826 Remove space after -I option for osf-alpha. 2008-10-20 15:39:32 +00:00
Andrew Johnson
b3abcbb52e Don't fail if epicsSnprintf returns less than the buffer size needed. 2008-10-20 15:35:10 +00:00
W. Eric Norum
3274519a82 Add note about RTEMS version. 2008-10-20 15:33:27 +00:00
Janet B. Anderson
95b708a40b post-RC1 versions... 2008-10-17 19:45:00 +00:00
W. Eric Norum
3b2bbd50e5 Cleaner version of wait with timeout fix. 2008-10-16 13:38:14 +00:00
W. Eric Norum
ab765613ec Add note about RTEMS epicsEventWaitWithTimeout. 2008-10-16 13:17:57 +00:00
W. Eric Norum
ba5080d6f4 Return TIMEOUT status even when delay time is 0. 2008-10-15 19:40:57 +00:00
W. Eric Norum
a6ed0d3a53 RTEMS newlib version of strtod handles INF/NAN. 2008-10-15 19:40:00 +00:00
Andrew Johnson
edc141f98a Added checks for NULL callbacks and record pointers. 2008-10-13 14:08:35 +00:00
W. Eric Norum
7245f8127c Arrange for compatability with compile-time and run-time linking. 2008-10-11 16:40:46 +00:00
Andrew Johnson
ba37f17c89 Updated version number in title. 2008-10-10 15:50:08 +00:00
Janet B. Anderson
e6e9b9a266 -RC2 release. 2008-10-10 15:01:51 +00:00
Janet B. Anderson
570825f693 Removed old commented override lines. They are no longer valid. 2008-10-09 21:33:35 +00:00
Andrew Johnson
2c020ffac4 Make aitGen take an output filename, needed for win32. 2008-10-09 20:14:44 +00:00
Andrew Johnson
bf829e0f48 Extended testing to trigger callbacks from multiple threads, more tests. 2008-10-09 15:01:53 +00:00
Ralph Lange
9239b50615 DST changes for 2008 2008-10-09 10:13:22 +00:00
Andrew Johnson
2eb849b91c Fix segfault on linux - catch(...) must not call std::unexpected() 2008-10-08 22:44:32 +00:00
Andrew Johnson
0fff507aea Cleanup, fix an issue reported by Kazuro Furukawa. 2008-10-08 22:42:49 +00:00
Janet B. Anderson
49687e27b2 Fixed include lines. 2008-10-08 21:18:27 +00:00
Andrew Johnson
98e09831fa _APPNAME__SNCFLAGS doesn't get used... 2008-10-08 21:11:55 +00:00
Janet B. Anderson
36af6418db Removed bad include line. 2008-10-08 20:04:46 +00:00
Janet B. Anderson
cd84a4cfd0 Fixed comments. 2008-10-08 19:51:35 +00:00
Janet B. Anderson
76af265f0d Make CONFIG.Common.win32-x86 and aopional include. 2008-10-08 18:17:56 +00:00
Janet B. Anderson
7558e0a468 Fixed typo. 2008-10-08 17:31:34 +00:00
Janet B. Anderson
925dcfd634 Added WARN_CPPFLAGS,OPT_CPPFLAGS,DEBUG_CPPFLAGS
Added POSIX_CFLAGS, POSIX_CXXFLAGS, POSIX_LDFLAGS
2008-10-08 17:11:10 +00:00
Ralph Lange
1d6bea83de This is included from epicsEndian.h, so it must be usable from C and C++. 2008-10-08 10:31:44 +00:00
Andrew Johnson
2dad57f1da Link with Solaris libumem.so for better threaded malloc/free performance. 2008-10-07 22:17:17 +00:00
Janet B. Anderson
2e4d1f0d60 REMOVED file type IDL. IDL install already exists in extensions/configure. 2008-10-07 20:33:29 +00:00
Janet B. Anderson
708b0be486 Create aitConvertGenerated.cc in O.Common. Makefile cleanup. 2008-10-07 18:05:58 +00:00
Andrew Johnson
f58002e1fd Exception classes don't need to derive from std::exception,
this can cause build faults on some architectures.
2008-10-07 15:19:35 +00:00
W. Eric Norum
980d790638 Fix some typos. 2008-10-07 13:19:37 +00:00
W. Eric Norum
d579e30210 Prevent warnings -- test show that this still generates correct code. 2008-10-07 12:18:43 +00:00
W. Eric Norum
48257aec7c Fix race condition exposed by compilers with more agressive optimization.
Add test procedure for epicsRingBytes.
2008-10-07 11:05:41 +00:00
Ralph Lange
af2b7a3ef2 Fix: Don't print space after single value, only between values of an array 2008-10-06 15:51:51 +00:00
Andrew Johnson
fd9867e973 Cleanup. 2008-10-03 20:27:13 +00:00
Andrew Johnson
e97439c7df Ensure the last test actually completes and reports... 2008-10-03 19:28:34 +00:00
Andrew Johnson
150c4ff002 A proper fix for the xsubpp problems on Perl 5.8.0. 2008-10-03 18:28:56 +00:00
Andrew Johnson
86740c98d7 Updated the lists of supported architectures. 2008-10-02 21:33:23 +00:00
Andrew Johnson
d14713d675 Fix from Kazuro FURUKAWA. 2008-10-02 16:29:34 +00:00
Jeff Hill
11180d0c9c patch for DECXX compiler detected issues (found by Kazuro FURUKAWA)
see <URL:http://www-linac.kek.jp/epics/osf/>
2008-10-02 15:43:04 +00:00
Andrew Johnson
ec8761185d Another fix, for the SunPro compiler this time. 2008-09-30 17:24:11 +00:00
Jeff Hill
67e9d89ebd extended comment 2008-09-30 16:31:09 +00:00
Andrew Johnson
d3eb8170ff Fix for vxWorks 6.x - don't use std::min/max. 2008-09-30 15:29:57 +00:00
Andrew Johnson
80eca1fafa R3.14.10-RC1 update. 2008-09-29 21:55:20 +00:00
Andrew Johnson
3947594fe3 post-RC1 versions... 2008-09-29 21:16:30 +00:00
58 changed files with 719 additions and 580 deletions

View File

@@ -36,9 +36,11 @@ EPICS_PATCH_LEVEL = 0
#EPICS_CVS_SNAPSHOT=-CVS
#EPICS_CVS_SNAPSHOT=-pre1
#EPICS_CVS_SNAPSHOT=-pre1-CVS
EPICS_CVS_SNAPSHOT=-RC1
#EPICS_CVS_SNAPSHOT=-RC1
#EPICS_CVS_SNAPSHOT=-RC1-CVS
#EPICS_CVS_SNAPSHOT=
#EPICS_CVS_SNAPSHOT=-RC2
#EPICS_CVS_SNAPSHOT=-RC2-CVS
EPICS_CVS_SNAPSHOT=
# No changes should be needed below here

View File

@@ -231,10 +231,12 @@ CONFORM_CFLAGS = $(CONFORM_CFLAGS_$(CMPLR))
CONFORM_CXXFLAGS = $(CONFORM_CXXFLAGS_$(CXXCMPLR))
# Warnings flags
WARN_CPPFLAGS = $(WARN_CPPFLAGS_$($(BUILD_CLASS)_WARN))
WARN_CFLAGS = $(WARN_CFLAGS_$($(BUILD_CLASS)_WARN))
WARN_CXXFLAGS = $(WARN_CXXFLAGS_$($(BUILD_CLASS)_WARN))
# Optimization flags
OPT_CPPFLAGS = $(OPT_CPPFLAGS_$($(BUILD_CLASS)_OPT))
OPT_CFLAGS = $(OPT_CFLAGS_$($(BUILD_CLASS)_OPT))
OPT_CXXFLAGS = $(OPT_CXXFLAGS_$($(BUILD_CLASS)_OPT))
@@ -267,15 +269,15 @@ OP_SYS_LDFLAGS += $(LDFLAGS_$(COMMANDLINE_LIBRARY))
INCLUDES = -I. $(SRC_INCLUDES) $(INSTALL_INCLUDES) $(RELEASE_INCLUDES)\
$(TARGET_INCLUDES) $(USR_INCLUDES) $(OP_SYS_INCLUDES) $($(BUILD_CLASS)_INCLUDES)
CFLAGS = $(CONFORM_CFLAGS) $($(BUILD_CLASS)_CFLAGS) $(OPT_CFLAGS) $(DEBUG_CFLAGS)\
CFLAGS = $(CONFORM_CFLAGS) $($(BUILD_CLASS)_CFLAGS) $(POSIX_CFLAGS) $(OPT_CFLAGS) $(DEBUG_CFLAGS)\
$(PIPE_CFLAGS) $(WARN_CFLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS)\
$(CODE_CFLAGS) $(STATIC_CFLAGS) $(OP_SYS_CFLAGS) $(LIBRARY_SRC_CFLAGS)
CXXFLAGS = $(CONFORM_CXXFLAGS) $($(BUILD_CLASS)_CXXFLAGS) $(OPT_CXXFLAGS) $(DEBUG_CXXFLAGS)\
CXXFLAGS = $(CONFORM_CXXFLAGS) $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS) $(DEBUG_CXXFLAGS)\
$(PIPE_CFLAGS) $(WARN_CXXFLAGS) $(TARGET_CXXFLAGS) $(USR_CXXFLAGS) $(ARCH_DEP_CXXFLAGS)\
$(CODE_CXXFLAGS) $(STATIC_CXXCFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS)
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) \
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(POSIX_LDFLAGS) \
$(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS) $($(BUILD_CLASS)_LDFLAGS)\
$(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
@@ -283,6 +285,7 @@ LDLIBS = $(STATIC_LDLIBS)\
$(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS) $(GNU_LDLIBS_$(GNU))
CPPFLAGS += $(CONFORM_CPPFLAGS) $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS)\
$(OPT_CPPFLAGS) $(DEBUG_CPPFLAGS) $(WARN_CPPFLAGS)\
$(BASE_CPPFLAGS) $(TARGET_CPPFLAGS) $(USR_CPPFLAGS) $(ARCH_DEP_CPPFLAGS)\
$(OP_SYS_CPPFLAGS) $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
@@ -296,10 +299,12 @@ ARCMD = $(AR) $(ARFLAGS) $(USR_ARFLAGS) $@ $(LIBRARY_LD_OBJS)
MUNCH_CMD = $(LD) -o $@ $^
#--------------------------------------------------
# LEX default option (valid for EPICS base 3.13.0.beta12 and later)
# LEX default options
#
# to allow characters that are not plain 7bit standard ASCII
LEXOPT += -8
# Allow 8-bit characters
LEXOPT += -8
# Generate an "interactive" scanner, solves problems at EOF.
LEXOPT += -I
#--------------------------------------------------
# Build compile line here

View File

@@ -56,9 +56,6 @@ INSTALL_CFG = $(INSTALL_LOCATION)/cfg
FILE_TYPE += EDL
INSTALL_EDL = $(INSTALL_LOCATION)/edl
FILE_TYPE += IDL
INSTALL_IDL = $(INSTALL_LOCATION_LIB)/idl
FILE_TYPE += PERL_MODULES
INSTALL_PERL_MODULES = $(INSTALL_LOCATION_LIB)/perl

View File

@@ -30,15 +30,14 @@
# linux-x86 (GNU compiler used for host builds)
# linux-x86_64 (GNU compiler used for host builds)
# linux-x86-borland (Borland C++ compiler used for host builds)
# solaris-sparc (sun compiler used for host builds)
# solaris-sparc (Sun compiler used for host builds)
# solaris-sparc-gnu (GNU compiler used for host builds)
# solaris-sparc64 (sun compiler used for host builds)
# solaris-sparc64 (Sun compiler used for host builds)
# solaris-sparc64-gnu (GNU compiler used for host builds)
# solaris-x86 (sun compiler used for host builds)
# solaris-x86 (Sun compiler used for host builds)
# solaris-x86-gnu (GNU compiler used for host builds)
# win32-x86 (MS Visual C++ compiler used for host builds)
# win32-x86-mingw (MinGW compiler used for host builds)
# win32-x86-borland (Borland C++ compiler used for host builds)
# win32-x86-cygwin (WIN32 API with cygwin GNU compiler used for host builds)
# Debugging builds
@@ -56,15 +55,18 @@
# The cross-compiler architectures to build EPICS for
#
# Currently Supporting:
# linux-386 (linux-x86 host)
# linux-486 (linux-x86 host)
# linux-586 (linux-x86 host)
# linux-686 (linux-x86 host)
# linux-athlon (linux-x86 host)
# linux-cris (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v10 (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v32 (Axis GNU crosscompiler on linux-x86 host)
# linux-386 (linux-x86 host)
# linux-486 (linux-x86 host)
# linux-586 (linux-x86 host)
# linux-686 (linux-x86 host)
# linux-arm
# linux-arm_eb
# linux-arm_el
# linux-athlon (linux-x86 host)
# linux-cris (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v10 (Axis GNU crosscompiler on linux-x86 host)
# linux-cris_v32 (Axis GNU crosscompiler on linux-x86 host)
# linux-xscale_be
# vxWorks-486
# vxWorks-68040
# vxWorks-68040lc
@@ -76,10 +78,13 @@
# vxWorks-ppc604_long
# vxWorks-ppc604_altivec
# vxWorks-mpc8540
# RTEMS-at91rm9200ek
# RTEMS-beatnik
# RTEMS-gen68360
# RTEMS-mcp750
# RTEMS-mvme167
# RTEMS-mvme2100
# RTEMS-mvme3100
# RTEMS-mvme5500
# RTEMS-pc386
# RTEMS-psim

View File

@@ -33,15 +33,15 @@
# where the start and end are mmddhh - that is month,day,hour
# eg EPICS_TIMEZONE=CUS::360:033102:102802
#
# DST for 2007 US: Mar 11 - Nov 04
# EU: Mar 25 - Oct 28
# DST for 2008 US: Mar 09 - Nov 02
# EU: Mar 30 - Oct 26
# (see: http://www.worldtimezone.org/daylight.html)
#
# EPICS_TS_NTP_INET
# NTP or Unix time server ip address. Uses boot host if not set.
EPICS_TIMEZONE=CUS::360:031102:110402
#EPICS_TIMEZONE=MET::-60:032502:102802
EPICS_TIMEZONE=CUS::360:030902:110202
#EPICS_TIMEZONE=MET::-60:033002:102602
EPICS_TS_NTP_INET=
# IOC Shell:

View File

@@ -42,6 +42,8 @@ buildDirs = $(addprefix O.,$(BUILD_ARCHS))
CROSS_ARCHS += $(CROSS1) $(CROSS2)
ifeq ($(findstring j,$(MAKEFLAGS)),j)
define DEP_template
$(2): $$(EPICS_HOST_ARCH)
$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH)
@@ -50,6 +52,8 @@ endef
$(foreach action, $(ACTIONS), $(foreach arch,\
$(CROSS_ARCHS),$(eval $(call DEP_template,$(action),$(arch)))))
endif
#*************************************************************************
$(actionArchTargets) : $(buildDirs) O.Common

View File

@@ -16,7 +16,8 @@ ARCH_CLASS = alpha
CODE_CPPFLAGS =
POSIX_CPPFLAGS += -pthread -ieee
POSIX_LDFLAGS += -pthread -ieee
# Unknown reason why this doesn't work in POSIX_LDFLAGS:
POSIX_LDLIBS += -pthread -ieee
OP_SYS_CPPFLAGS += -D_OSF_SOURCE
OP_SYS_LDLIBS += -lrt

View File

@@ -48,10 +48,11 @@ USE_STLPORT=NO
OP_SYS_CFLAGS+=$(STLPORT_CFLAGS_$(USE_STLPORT))
OP_SYS_LDFLAGS+=$(STLPORT_CFLAGS_$(USE_STLPORT))
# OS libraries used when generating shared libraries or static binaries
OP_SYS_LDLIBS += -lsocket -lnsl
OP_SYS_LDLIBS_8 += -lCrun -lc
OP_SYS_LDLIBS_9 += -lCrun -lc
OP_SYS_LDLIBS_10 += -lCrun -lc
OP_SYS_LDLIBS_9 += -lumem -lCrun -lc
OP_SYS_LDLIBS_10 += -lumem -lCrun -lc
OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_$(SOLARIS_VERSION))
OP_SYS_LDLIBS += $(STLPORT_LDLIBS_$(USE_STLPORT))

View File

@@ -7,8 +7,8 @@
# Sites may override these definitions in CONFIG_SITE.darwin-ppc.darwin-ppc-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.Common.darwin-ppc
include $(CONFIG)/os/CONFIG.darwin-ppc.darwin-ppc
-include $(CONFIG)/os/CONFIG.Common.darwin-ppc
-include $(CONFIG)/os/CONFIG.darwin-ppc.darwin-ppc
# This will cause build failure when used with make -j option
#BUILD_CLASS = HOST

View File

@@ -7,8 +7,8 @@
# Sites may override these definitions in CONFIG_SITE.darwin-x86.darwin-x86-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.Common.darwin-x86
include $(CONFIG)/os/CONFIG.darwin-x86.darwin-x86
-include $(CONFIG)/os/CONFIG.Common.darwin-x86
-include $(CONFIG)/os/CONFIG.darwin-x86.darwin-x86
# This will cause build failure when used with make -j option
#BUILD_CLASS = HOST

View File

@@ -7,7 +7,7 @@
# Sites may override these definitions in CONFIG_SITE.solaris-x86.solaris-x86-debug
#-------------------------------------------------------
include $(CONFIG)/os/Common.solaris-x86
include $(CONFIG)/os/CONFIG.Common.solaris-x86
include $(CONFIG)/os/CONFIG.solaris-x86.solaris-x86
#BUILD_CLASS = HOST

View File

@@ -1,10 +1,10 @@
# CONFIG.solaris-x86-debug.solaris-x86-debug
# CONFIG.win32-x86-debug.win32-x86-debug
#
# $Id$
# This file is maintained by the build community.
#
# Definitions for solaris-x86 debug compiler host - solaris-x86 debug compiler target builds
# Sites may override these definitions in CONFIG_SITE.solaris-x86-debug.solaris-x86-debug
# Definitions for win32-x86 debug compiler host - win32-x86 debug compiler target builds
# Sites may override these definitions in CONFIG_SITE.win32-x86-debug.win32-x86-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.win32-x86.win32-x86

View File

@@ -7,7 +7,7 @@
# Sites may override these definitions in CONFIG_SITE.win32-x86.win32-x86-debug
#-------------------------------------------------------
include $(CONFIG)/os/CONFIG.Common.win32-x86
-include $(CONFIG)/os/CONFIG.Common.win32-x86
include $(CONFIG)/os/CONFIG.win32-x86.win32-x86
GNU = NO

View File

@@ -6,16 +6,3 @@
# Only the local epics system manager should modify this file
#-------------------------------------------------------
# JBA test override values
#CMPLR_SUFFIX=
#GNU_TARGET=m68k-wrs-vxworks
#CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET))
# ORNL SNS overrides for cross compilers
#VX_DIR_YES = /opt/tornado20/
#VX_CONFIG_DIR_YES = $(VX_DIR)/target/config
#VX_INCLUDE_YES = /usr/local/crossgcc/m68k/m68k-wrs-vxworks/sys-include
#VX_GNU_YES = /usr/local/crossgcc/m68k/
#VX_GNU_BIN_YES = $(VX_GNU)/bin
#VX_GNU_LIB_YES = /usr/local/crossgcc/m68k/lib/gcc-lib/m68k-wrs-vxworks/2.95.2

View File

@@ -6,9 +6,4 @@
# Definitions for linux-x86 host - vxWorks target builds
#-------------------------------------------------------
# Example override lines for user built cross-compiler
#GNU_DIR=/home/phoebus/JBA/gnu
#GNU_TARGET_INCLUDE_DIR=$(GNU_DIR)/$(GNU_TARGET)/include
#CMPLR_SUFFIX=
#CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET))

View File

@@ -6,16 +6,3 @@
# Only the local epics system manager should modify this file
#-------------------------------------------------------
# JBA test override values
#CMPLR_SUFFIX=
#GNU_TARGET=m68k-wrs-vxworks
#CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET))
# ORNL SNS overrides for cross compilers
#VX_DIR = /opt/tornado20/
#VX_CONFIG_DIR_YES = $(VX_DIR)/target/config
#VX_INCLUDE_YES = /usr/local/crossgcc/m68k/m68k-wrs-vxworks/sys-include
#VX_GNU_YES = /usr/local/crossgcc/m68k/
#VX_GNU_BIN_YES = $(VX_GNU)/bin
#VX_GNU_LIB_YES = /usr/local/crossgcc/m68k/lib/gcc-lib/m68k-wrs-vxworks/2.95.2

View File

@@ -4,33 +4,35 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Known Problems R3.14.x</title>
<meta name="GENERATOR" content="amaya 5.1" />
<title>Known Problems R3.14.10-RC1</title>
</head>
<body>
<h1 style="text-align: center">EPICS Base R3.14.9: Known Problems</h1>
<h1 style="text-align: center">EPICS Base R3.14.10: Known Problems</h1>
<ul>
<li>It is not possible to build this version of base on HP-UX due to C++
issues which appear to be bugs in the HP-UX compiler.</li>
<li>Parallel make (<tt>make -j</tt>) does not work on cygwin-x86 targets,
probably due to a missing dependency in the EPICS build rules.</li>
<li>When shutting down an IOC on a recent version of GNU/Linux (one that
includes the NPTL threading library) various messages may appear, such as:
<li>Some older Perl versions do not properly install the xsubpp program. This
will prevent the build in src/cap5 from completing &mdash; the build will
finish with an error like this:
<blockquote>
<pre>FATAL: exception not rethrown</pre></blockquote>
<blockquote><pre>/bin/sh: /bin/xsubpp: not found
make[3]: *** [Cap5.c] Error 1
make[3]: Leaving directory `/home/phoebus3/ANJ/epics/base/3-14-dev/src/cap5/O.solaris-x86'
make[2]: *** [install.solaris-x86] Error 2
make[2]: Leaving directory `/home/phoebus3/ANJ/epics/base/3-14-dev/src/cap5'
make[1]: *** [cap5.install] Error 2
make[1]: Leaving directory `/home/phoebus3/ANJ/epics/base/3-14-dev/src'
make: *** [src.install] Error 2</pre></blockquote>
<blockquote>
<pre>epicsThread: Unknown C++ exception in thread "CAC-UDP" at ...</pre>
<pre>terminate called after throwing an instance of ''</pre>
</blockquote>
As long as you don't intend to use the Perl5 CA interface this error is
harmless, as cap5 is the last directory to be compiled in Base. If you need
the Perl5 CA inteface, fix your Perl installation so that the perl binary
and the xsubpp program (or soft links to them) are both found in the same
directory.</li>
These errors are caused by the implementation of the pthread_cancel()
mechanism in NPTL, which uses the C++ exception mechanism without providing
any means to distinguish the cancel exception to regular C++ exception
handlers. It is possible that they might also occur when a CA client
application exits (or closes its connection to the CA library).</li>
</ul>
</body>

View File

@@ -39,16 +39,19 @@ Supported platforms
configuration files in the configure/os directory and then make changes
for your new platforms.
Host platforms (operating system - architecture - <alternate c++ compiler>)
Host platforms (operating system - architecture [- alternate toolset])
aix-ppc
aix-ppc-gnu
cygwin-x86
darwin-ppc (Mac OS X)
darwin-ppc
darwin-x86
darwin-ppcx86
freebsd-x86
freebsd-x86_64
hpux-parisc
hpux-parisc-gnu
linux-ppc
linux-ppc-bgl
linux-x86
linux-x86_64
linux-x86-borland
@@ -59,25 +62,23 @@ Supported platforms
solaris-x86
solaris-x86-gnu
win32-x86
win32-x86-borland
win32-x86-cygwin
win32-x86-mingw
Debugging builds
linux-x86-debug
linux-x86_64-debug
solaris-sparc-debug
win32-x86-debug
win32-x86-cygwin
Cross compile target platforms (operating system - architecture)
linux-386 (linux-x86 host)
linux-486 (linux-x86 host)
linux-586 (linux-x86 host)
linux-686 (linux-x86 host)
linux-althon (linux-x86 host)
linuxRT-mvme2100
linux-386
linux-486
linux-586
linux-686
linux-arm
linux-arm_eb
linux-arm_el
linux-athlon
linux-cris
linux-cris_v10
linux-cris_v32
linux-xscale_be
vxWorks-486
vxWorks-68040
vxWorks-68040lc
@@ -87,19 +88,20 @@ Supported platforms
vxWorks-ppc603_long
vxWorks-ppc604
vxWorks-ppc604_long
vxWorks6-mv2100
vxWorks6-mv5100
vxWorks-ppc604_altivec
vxWorks-mpc8540
RTEMS-at91rm9200ek
RTEMS-beatnik
RTEMS-gen68360
RTEMS-mcp750
RTEMS-mvme167
RTEMS-mvme2100
RTEMS-mvme3100
RTEMS-mvme5500
RTEMS-pc386
RTEMS-psim
RTEMS-uC5282
Debugging builds
vxWorks-68040-debug
Supported compilers
This version of EPICS base has been built and tested using the host
@@ -116,7 +118,7 @@ Software requirements
path so that a gnumake version 3.81 or later is available.
Perl
You must have perl version 5.6 or later installed. The configure files do
You must have perl version 5.8 or later installed. The configure files do
not specify the perl full pathname. You need the perl executable in
your search path.

View File

@@ -55,86 +55,73 @@ to create and add the appropriate new configure files to the base/configure/os/d
You can start by copying existing configuration files in the configure/os
directory and then make changes for your new platforms.</blockquote>
<blockquote><b>Host platforms (operating system - architecture - &lt;alternate
c++ compiler>)</b>
<blockquote>
<h4>Host platforms (operating system - architecture [- alternate toolset])</h4>
<blockquote>
<tt>aix-ppc</tt>
<br><tt>aix-ppc-gnu</tt>
<br><tt>cygwin-x86</tt>
<br><tt>darwin-ppc (Mac OS X)</tt>
<br><tt>hpux-parisc</tt>
<br><tt>hpux-parisc-gnu</tt>
<br><tt>linux-ppc</tt>
<br><tt>linux-ppc-bgl</tt>
<br><tt>linux-x86</tt>
<br><tt>linux-x86_64</tt>
<br><tt>linux-x86-borland</tt>
<br><tt>solaris-sparc</tt>
<br><tt>solaris-sparc-gnu</tt>
<br><tt>solaris-sparc64</tt>
<br><tt>solaris-sparc64-gnu</tt>
<br><tt>solaris-x86</tt>
<br><tt>solaris-x86-gnu</tt>
<br><tt>win32-x86</tt>
<br><tt>win32-x86-borland</tt>
<br><tt>win32-x86-cygwin</tt>
<br><tt>win32-x86-mingw</tt>
</blockquote>
<pre>aix-ppc
aix-ppc-gnu
cygwin-x86
darwin-ppc
darwin-x86
darwin-ppcx86
freebsd-x86
freebsd-x86_64
hpux-parisc
hpux-parisc-gnu
linux-ppc
linux-x86
linux-x86_64
linux-x86-borland
solaris-sparc
solaris-sparc-gnu
solaris-sparc64
solaris-sparc64-gnu
solaris-x86
solaris-x86-gnu
win32-x86
win32-x86-mingw
win32-x86-cygwin
</pre></blockquote>
</blockquote>
<blockquote><b>Debugging builds</b>
<blockquote>
<tt>linux-x86-debug</tt>
<br><tt>linux-x86_64-debug</tt>
<br><tt>solaris-sparc-debug</tt>
<br><tt>win32-x86-debug</tt>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<h4>
Cross compile target platforms (operating system - architecture)</h4>
</blockquote>
<blockquote>
<blockquote>
<tt>linux-386 (linux-x86 host)</tt>
<br><tt>linux-486 (linux-x86 host)</tt>
<br><tt>linux-586 (linux-x86 host)</tt>
<br><tt>linux-686 (linux-x86 host)</tt>
<br><tt>linux-althon (linux-x86 host)</tt>
<br><tt>linuxRT-mvme2100</tt>
<br><tt>vxWorks-486</tt>
<br><tt>vxWorks-68040</tt>
<br><tt>vxWorks-68040lc</tt>
<br><tt>vxWorks-68060</tt>
<br><tt>vxWorks-pentium</tt>
<br><tt>vxWorks-ppc603</tt>
<br><tt>vxWorks-ppc603_long</tt>
<br><tt>vxWorks-ppc604</tt>
<br><tt>vxWorks-ppc604_long</tt>
<br><tt>vxWorks6-mv2100</tt>
<br><tt>vxWorks6-mv5100</tt>
<br><tt>RTEMS-gen68360</tt>
<br><tt>RTEMS-mcp750</tt>
<br><tt>RTEMS-mvme167</tt>
<br><tt>RTEMS-pc386</tt>
<br><tt>RTEMS-psim</tt>
<br><tt>RTEMS-uC5282</tt>
</blockquote>
</blockquote>
<blockquote><b>Debugging builds</b>
<blockquote>
<tt>vxWorks-68040-debug</tt>
</blockquote>
</blockquote>
<pre>linux-386
linux-486
linux-586
linux-686
linux-arm
linux-arm_eb
linux-arm_el
linux-athlon
linux-cris
linux-cris_v10
linux-cris_v32
linux-xscale_be
vxWorks-486
vxWorks-68040
vxWorks-68040lc
vxWorks-68060
vxWorks-pentium
vxWorks-ppc603
vxWorks-ppc603_long
vxWorks-ppc604
vxWorks-ppc604_long
vxWorks-ppc604_altivec
vxWorks-mpc8540
RTEMS-at91rm9200ek
RTEMS-beatnik
RTEMS-gen68360
RTEMS-mcp750
RTEMS-mvme167
RTEMS-mvme2100
RTEMS-mvme3100
RTEMS-mvme5500
RTEMS-pc386
RTEMS-psim
RTEMS-uC5282
</pre></blockquote>
<h3>
Supported compilers</h3>
@@ -155,7 +142,7 @@ path so that a gnumake version 3.81 or later is available.
<p><b>gcc</b>
<br>You must have gcc version 3.4.2 or later.
<p><b>Perl</b>
<br>You must have perl version 5.6 or later installed. The configure files
<br>You must have perl version 5.8 or later installed. The configure files
do not specify the perl full pathname. You need the perl executable
in your search path.
<p><b>Unzip and tar (Winzip on WIN32 systems)</b>

View File

@@ -7,11 +7,24 @@
</head>
<body lang="en">
<h1 align="center">EPICS Base Release 3.14.10-RC1</h1>
<h1 align="center">EPICS Base Release 3.14.10</h1>
<h2 align="center">Changes between 3.14.9 and 3.14.10</h2>
<!-- Insert new items below here ... -->
<h4>RTEMS Release</h4>
<p>RTEMS release 4.9 or newer is required. If you are using the RTEMS NFS time provider you need to use RTEMS 4.9.1 or newer.</p>
<h4>RTEMS epicsEventWaitWithTimeout</h4>
<p>Correctly return epicsEventWaitTimeout when event is not pending and timeout value is 0.0 secondsmore agressive.</p>
<h4>epicsRingPointer, epicsRingBytes</h4>
<p>Fixed a race condition exposed by compilers with more agressive
optimization.</p>
<h4>camonitor timestamp support</h4>
<p>The <tt>camonitor</tt> program now supports the ability to display both
@@ -55,11 +68,11 @@ have their own separate report commands.</p>
providers in Base. The Unix-like architectures rely on the underlying operating
system clock, which normally involves running something like ntpd as a separate
process. The real-time operating systems vxWorks and RTEMS install two Current
Time providers; the native OS Clock at the lowest priority (this provider
includes a task to periodically reset the OS Clock from a higher priority time
provider), and an NTP time provider which synchronizes the underlying OS' tick
Time providers; the native operating system clock at the lowest priority (this provider
includes a task to periodically reset the operating system clock from a higher priority time
provider), and an NTP time provider which synchronizes the underlying operating sytem tick
timer with an NTP server. Microsoft Windows targets using the Win32 API use a
Windows-specific time provider which contains a built-in PLL</p>
Windows-specific time provider which contains a built-in PLL.</p>
<p>There are no Event Time providers included with Base except for an optional
"Last Resort" Event provider which can be installed if a site wants to be sure
@@ -217,7 +230,7 @@ noticed that an empty string converts to the value 0 for all types other than
character <tt>'0'</tt>, value 0x30. Since these types are usually used for
storing small integers or boolean values rather than ASCII characters, it was
decided that this conversion is wrong so it has been changed to match the other
nmeric conversions.</p>
numeric conversions.</p>
<h4>epicsShareAPI deprecated inside IOC</h4>
@@ -236,10 +249,10 @@ implementations have been converted from K&amp;R to ANSI C prototypes.</p>
<h4>Added Perl5 CA library</h4>
<p>Base now provides a CA client library interface for Perl5 scripts in
<tt>src/cap5</tt> and includes some alternative implementations of the catools
programs written in Perl (for demonstration purposes mainly). Documentation on
how to use the library is available in html/CA.html after the build
completes.</p>
<tt>src/cap5</tt> and includes as examples some implementations of the catools
programs written in Perl. Documentation on how to use the Perl library is
available in <tt>base/html/CA.html</tt> after the build completes. This library
cannot currently be built on Windows targets.</p>
<h4>IOC ignores SIGHUP</h4>
@@ -255,14 +268,18 @@ should not affect the contents of <tt>Makefile</tt>s or any applications
using Base. They do however require that the version of GNU Make used be 3.81
or later. These changes are briefly:</p>
<ul>
<li><p>A new tool is provided that expands out <tt>@VAR@</tt> macros. By
default it knows the value of <tt>@TOP@</tt>, <tt>@ARCH@</tt> and any
paths defined in the application's <tt>configure/RELEASE</tt> file, but
additional macros can be defined in the <tt>Makefile</tt> that uses it by
adding to the <tt>EXPAND_VARS</tt> macro like the example following,
which creates an <tt>@EXE@</tt> macro that expands out to <tt>.exe</tt>
on windows and to nothing on other platforms:</p>
paths defined in the application's <tt>configure/RELEASE</tt> file such
as @EPICS_BASE@, but additional macros can be defined in the
<tt>Makefile</tt> that uses it by adding to the <tt>EXPAND_VARS</tt>
variable like the example following, which creates an <tt>@EXE@</tt>
macro that expands out to <tt>.exe</tt> on windows targets and to
nothing on other platforms:</p>
<pre> EXPAND_VARS += EXE=$(EXE)</pre>
<p>Files that contain <tt>@VAR@</tt> macros to be substituted must have
an at sign <tt><b>@</b></tt> as the last character of their name and be
listed in the <tt>EXPAND</tt> variable of their <tt>Makefile</tt>. The
@@ -270,24 +287,29 @@ or later. These changes are briefly:</p>
<tt><b>@</b></tt> suffix removed, and is then available for compiling or
installing using any other build mechanism.</p>
</li>
<li><p>Support has been added for installing Perl library modules. The
<tt>Makefile</tt> variable <tt>PERL_MODULES</tt> can be set to a list of
names of files to be installed into the <tt>$(TOP)/lib/perl</tt>
directory. The above macro expansion facility can then be used in perl
programs that use these libraries to set the perl search path to include
that directory. The syntax for this is as follows:</p>
<pre> use lib '@TOP@/lib/perl';
use MyModule;</pre>
<p>The filenames listed in <tt>PERL_MODULES</tt> can include subdirectory
path components and the build system will preserve these in the installed
result.</p>
</li>
<li>The Perl scripts that were in <tt>configure/tools</tt> are now found in
the new <tt>src/tools</tt> directory, and get installed into the
appropriate <tt>bin/<i>hostarch</i></tt> directory at build time. Some of
these scripts are no longer required and have been removed, and others
are being modified to make them more modular, extracting common routines
into perl library modules.</li>
<li>The generated files that were created by running make in the
<tt>configure</tt> directory are no longer required, having been replaced
by additional mechanisms inside the build system files. This removes a
@@ -333,6 +355,7 @@ although the core developers lack the ability to test all of them:</p>
<li>linux-cris_v32</li>
</ul>
</li>
<li>linux-xscale_be (tested with MOXA UC-7408 Plus)
</ul>
<h4>Added compile line header search directories</h4>
@@ -402,7 +425,7 @@ settting.</p>
<p>The -ansi flag has been removed from CONFORM_FLAGS_STRICT and
CONFORM_CXXFLAGS_STRICT -- there are many useful library functions whose
prototypes are disabled when -ansi is used..</p>
prototypes are disabled when -ansi is used.</p>
<h4>SEL record (Mantis #295)</h4>

View File

@@ -51,9 +51,6 @@ void tzset(void);
int fileno(FILE *);
int main(int argc, char **argv);
rtems_interval rtemsTicksPerSecond;
double rtemsTicksPerSecond_double, rtemsTicksPerTwoSeconds_double;
static void
logReset (void)
{
@@ -81,6 +78,8 @@ logReset (void)
static void
delayedPanic (const char *msg)
{
extern rtems_interval rtemsTicksPerSecond;
rtems_task_wake_after (rtemsTicksPerSecond);
rtems_panic (msg);
}
@@ -421,13 +420,6 @@ Init (rtems_task_argument ignored)
rtems_status_code sc;
rtems_time_of_day now;
/*
* Get configuration
*/
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtemsTicksPerSecond);
rtemsTicksPerSecond_double = rtemsTicksPerSecond;
rtemsTicksPerTwoSeconds_double = rtemsTicksPerSecond_double * 2.0;
/*
* Explain why we're here
*/

View File

@@ -116,6 +116,8 @@ private:
epicsUInt8 buf [ comBufSize ];
void * operator new ( size_t size );
void operator delete ( void * );
template < class T >
bool push ( const T * ); // disabled
};
inline void * comBuf::operator new ( size_t size,

View File

@@ -106,10 +106,7 @@ void comQueSend::clear ()
void comQueSend::copy_dbr_string ( const void * pValue )
{
// this extra step is required by Borland BCC 5.5
const dbr_string_t & str =
* static_cast <const dbr_string_t *> ( pValue );
this->push ( str );
this->push ( static_cast < const char * > ( pValue ), MAX_STRING_SIZE );
}
void comQueSend::copy_dbr_short ( const void * pValue )
@@ -186,7 +183,7 @@ const comQueSend::copyScalarFunc_t comQueSend::dbrCopyScalar [39] = {
void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem )
{
this->push ( static_cast <const dbr_string_t *> ( pValue ), nElem );
this->push ( static_cast < const char * > ( pValue ), nElem * MAX_STRING_SIZE );
}
void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem )

View File

@@ -149,6 +149,9 @@ private:
this->pushComBuf ( *pComBuf );
}
template < class T >
inline void push ( const T * ); // disabled
comQueSend ( const comQueSend & );
comQueSend & operator = ( const comQueSend & );
};

View File

@@ -13,9 +13,6 @@ ifneq ($(findstring darwin,$(T_A)),)
LOADABLE_SHRLIB_PREFIX =
LOADABLE_SHRLIB_SUFFIX = .bundle
endif
ifneq ($(findstring win32,$(T_A)),)
BAT = .bat
endif
ifeq ($(findstring $(OS_CLASS),WIN32 cygwin32),)
# Doesn't build on WIN32
@@ -31,7 +28,7 @@ endif
Cap5_SRCS = Cap5.xs
Cap5_LIBS = ca Com
Cap5_INCLUDES = -I $(shell $(PERL) ../perlConfig.pl archlib)/CORE
Cap5_INCLUDES = -I$(shell $(PERL) ../perlConfig.pl archlib)/CORE
Cap5_CFLAGS = $(shell $(PERL) ../perlConfig.pl ccflags)
ifeq ($(findstring Host,$(VALID_BUILDS)),Host)
@@ -43,18 +40,15 @@ endif
include $(TOP)/configure/RULES
ifdef T_A
PERL5_DIR = $(dir $(shell $(PERL) ../perlConfig.pl perl5))
XSUBPP = $(PERL5_DIR)xsubpp$(BAT)
PODCHECKER = $(PERL5_DIR)podchecker$(BAT)
TYPEMAP = $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils/typemap
EXTUTILS = $(shell $(PERL) ../perlConfig.pl privlib)/ExtUtils
%.c: ../%.xs
$(RM) $@ $@_new
$(XSUBPP) -typemap $(TYPEMAP) $< > $@_new && $(MV) $@_new $@
$(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap $< > $@_new && $(MV) $@_new $@
%.html: %.pm
%.html: ../%.pm
$(RM) $@
$(PODCHECKER) $< && pod2html --infile=$< --outfile=$@
podchecker $< && pod2html --infile=$< --outfile=$@
clean::
$(RM) Cap5.c

View File

@@ -1413,8 +1413,9 @@ caStatus casStrmClient::createChanResponse (
this->chanTable.remove ( *pChan->pChanI );
this->chanList.remove ( *pChan->pChanI );
pChan->pChanI->uninstallFromPV ( this->eventSys );
pChan->getPV()->pPVI->deleteSignal ();
casPVI * pPVI = pChan->getPV()->pPVI;
delete pChan->pChanI;
pPVI->deleteSignal ();
}
return status;

View File

@@ -256,8 +256,10 @@ int caget (pv *pvs, int nPvs, RequestT request, OutputT format,
else
{
if (reqElems > 1) printf(" %lu ", reqElems);
for (i=0; i<reqElems; ++i)
printf("%s ", val2str(pvs[n].value, pvs[n].dbrType, i));
for (i=0; i<reqElems; ++i) {
if (i) printf (" ");
printf("%s", val2str(pvs[n].value, pvs[n].dbrType, i));
}
printf("\n");
}
break;
@@ -285,8 +287,10 @@ int caget (pv *pvs, int nPvs, RequestT request, OutputT format,
printf(" Element count: %lu\n"
" Value: ",
reqElems);
for (i=0; i<reqElems; ++i) /* Print value(s) */
printf("%s ", val2str(pvs[n].value, pvs[n].dbrType, i));
for (i=0; i<reqElems; ++i) { /* Print value(s) */
if (i) printf (" ");
printf(" %s", val2str(pvs[n].value, pvs[n].dbrType, i));
}
printf("\n");
if (pvs[n].dbrType > DBR_DOUBLE) /* Extended type extra info */
printf("%s\n", dbr2str(pvs[n].value, pvs[n].dbrType));

View File

@@ -147,10 +147,15 @@ void callbackInit(void)
/* This routine can be called from interrupt context */
void callbackRequest(CALLBACK *pcallback)
{
int priority = pcallback->priority;
int priority;
int pushOK;
int lockKey;
if (!pcallback) {
epicsPrintf("callbackRequest called with NULL pcallback\n");
return;
}
priority = pcallback->priority;
if (priority < 0 || priority >= NUM_CALLBACK_PRIORITIES) {
epicsPrintf("callbackRequest called with invalid priority\n");
return;
@@ -174,6 +179,7 @@ static void ProcessCallback(CALLBACK *pcallback)
dbCommon *pRec;
callbackGetUser(pRec, pcallback);
if (!pRec) return;
dbScanLock(pRec);
(*pRec->rset->process)(pRec);
dbScanUnlock(pRec);

View File

@@ -234,7 +234,7 @@ void epicsShareAPI dbCaRemoveLink(struct link *plink)
{
caLink *pca = (caLink *)plink->value.pv_link.pvt;
assert(pca);
if (!pca) return;
epicsMutexMustLock(pca->lock);
pca->plink = 0;
plink->value.pv_link.pvt = 0;

View File

@@ -1,13 +1,12 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* callbackTest.c */
/* $Id$ */
/* Author: Marty Kraimer Date: 26JAN2000 */
@@ -18,66 +17,107 @@
#include <stdio.h>
#include <math.h>
#include "epicsThread.h"
#include "errlog.h"
#include "callback.h"
#include "taskwd.h"
#include "cantProceed.h"
#include "epicsThread.h"
#include "epicsEvent.h"
#include "epicsTime.h"
#include "epicsUnitTest.h"
#include "testMain.h"
#define NCALLBACKS 168
#define DELAY_QUANTUM 0.25
#define TEST_DELAY(i) ((i / NUM_CALLBACK_PRIORITIES) * DELAY_QUANTUM)
typedef struct myPvt {
CALLBACK callback;
double requestedDiff;
CALLBACK cb1;
CALLBACK cb2;
epicsTimeStamp start;
}myPvt;
double delay;
int pass;
} myPvt;
epicsEventId finished;
static void myCallback(CALLBACK *pCallback)
{
myPvt *pmyPvt;
epicsTimeStamp end;
double diff, error;
epicsTimeStamp now;
double delay, error;
callbackGetUser(pmyPvt,pCallback);
epicsTimeGetCurrent(&end);
diff = epicsTimeDiffInSeconds(&end,&pmyPvt->start);
error = fabs(pmyPvt->requestedDiff - diff);
testOk(error < 0.05, "callback time error %f", error);
epicsTimeGetCurrent(&now);
callbackGetUser(pmyPvt, pCallback);
if (pmyPvt->pass++ == 0) {
delay = 0.0;
error = epicsTimeDiffInSeconds(&now, &pmyPvt->start);
pmyPvt->start = now;
callbackRequestDelayed(&pmyPvt->cb2, pmyPvt->delay);
} else if (pmyPvt->pass == 2) {
double diff = epicsTimeDiffInSeconds(&now, &pmyPvt->start);
delay = pmyPvt->delay;
error = fabs(delay - diff);
} else {
testFail("pass = %d for delay = %f", pmyPvt->pass, pmyPvt->delay);
return;
}
testOk(error < 0.05, "delay %f seconds, callback time error %f",
delay, error);
}
static void finalCallback(CALLBACK *pCallback)
{
myCallback(pCallback);
epicsEventSignal(finished);
}
#define ncallbacks 5
MAIN(callbackTest)
{
myPvt *nowait[ncallbacks];
myPvt *wait[ncallbacks];
epicsTimeStamp start;
myPvt *pcbt[NCALLBACKS];
myPvt *pfinal;
int i;
testPlan(ncallbacks * 2);
testPlan(NCALLBACKS * 2 + 2);
taskwdInit();
errlogInit(4096);
callbackInit();
epicsThreadSleep(1.0);
for(i=0; i<ncallbacks ; i++) {
nowait[i] = calloc(1,sizeof(myPvt));
callbackSetCallback(myCallback,&nowait[i]->callback);
callbackSetUser(nowait[i],&nowait[i]->callback);
callbackSetPriority(i%3,&nowait[i]->callback);
epicsTimeGetCurrent(&start);
nowait[i]->start = start;
nowait[i]->requestedDiff = 0.0;
callbackRequest(&nowait[i]->callback);
wait[i] = calloc(1,sizeof(myPvt));
callbackSetCallback(myCallback,&wait[i]->callback);
callbackSetUser(wait[i],&wait[i]->callback);
callbackSetPriority(i%3,&wait[i]->callback);
epicsTimeGetCurrent(&start);
wait[i]->start = start;
wait[i]->requestedDiff = (double)i;
callbackRequestDelayed(&wait[i]->callback,wait[i]->requestedDiff);
finished = epicsEventMustCreate(epicsEventEmpty);
for (i = 0; i < NCALLBACKS ; i++) {
pcbt[i] = callocMustSucceed(1, sizeof(myPvt), "pcbt");
callbackSetCallback(myCallback, &pcbt[i]->cb1);
callbackSetCallback(myCallback, &pcbt[i]->cb2);
callbackSetUser(pcbt[i], &pcbt[i]->cb1);
callbackSetUser(pcbt[i], &pcbt[i]->cb2);
callbackSetPriority(i % NUM_CALLBACK_PRIORITIES, &pcbt[i]->cb1);
callbackSetPriority(i % NUM_CALLBACK_PRIORITIES, &pcbt[i]->cb2);
pcbt[i]->delay = TEST_DELAY(i);
pcbt[i]->pass = 0;
}
epicsThreadSleep((double)(ncallbacks + 2));
for (i = 0; i < NCALLBACKS ; i++) {
epicsTimeGetCurrent(&pcbt[i]->start);
callbackRequest(&pcbt[i]->cb1);
}
pfinal = callocMustSucceed(1, sizeof(myPvt), "final");
callbackSetCallback(myCallback, &pfinal->cb1);
callbackSetCallback(finalCallback, &pfinal->cb2);
callbackSetUser(pfinal, &pfinal->cb1);
callbackSetUser(pfinal, &pfinal->cb2);
callbackSetPriority(0, &pfinal->cb1);
callbackSetPriority(0, &pfinal->cb2);
pfinal->delay = TEST_DELAY(NCALLBACKS) + 1.0;
pfinal->pass = 0;
epicsTimeGetCurrent(&pfinal->start);
callbackRequest(&pfinal->cb1);
epicsEventWait(finished);
return testDone();
}

View File

@@ -77,26 +77,21 @@ include $(TOP)/configure/RULES
# not have been installed if we are building for
# the first time
# -> use explicit reference to the uninstalled files in '..'
aitConvert$(OBJ): ../aitConvert.cc aitConvertGenerated.cc\
../aitConvert.h ../aitTypes.h
aitConvert$(OBJ): $(COMMON_DIR)/aitConvertGenerated.cc
dbMapper$(OBJ): ../gdd.h ../gddI.h ../gddContainer.h ../gddContainerI.h \
../gddArray.h ../gddScalar.h ../gddAppTable.h ../dbMapper.h \
$(INSTALL_INCLUDE)/gddApps.h ../aitTypes.h ../gddUtils.h ../gddUtilsI.h
dbMapper$(OBJ): $(COMMON_DIR)/gddApps.h
# Rules for generated files
#
aitConvertGenerated.cc: $(INSTALL_HOST_BIN)/aitGen$(HOSTEXE) aitTypes.h
$(INSTALL_HOST_BIN)/aitGen$(HOSTEXE)
$(COMMON_DIR)/aitConvertGenerated.cc: $(INSTALL_HOST_BIN)/aitGen$(HOSTEXE)
$(INSTALL_HOST_BIN)/aitGen$(HOSTEXE) $@
$(COMMON_DIR)/gddApps.h : $(INSTALL_HOST_BIN)/genApps$(HOSTEXE)
$(INSTALL_HOST_BIN)/genApps$(HOSTEXE) $@
clean::
$(RM) aitConvertGenerated.cc gddApps.h
aitConvert$(OBJ): aitConvertGenerated.cc
@$(RM) $(COMMON_DIR)/aitConvertGenerated.cc
# EOF base/src/gdd/Makefile

View File

@@ -51,7 +51,6 @@ void MakeStringFuncTo(int i,int j,int k);
void MakeFStringFuncFrom(int i,int j,int k);
void MakeFStringFuncTo(int i,int j,int k);
#define FILE_NAME "aitConvertGenerated.cc"
#define pr fprintf
#define AIT_TO_NET 0
@@ -116,9 +115,15 @@ int main(int argc,char* argv[])
initMinMaxAIT ();
if((dfd=fopen(FILE_NAME,"w"))==NULL)
if(argc<2)
{
pr(stderr,"file %s failed to open\n",FILE_NAME);
fprintf(stderr,"You must enter a file name on command line\n");
return -1;
}
if((dfd=fopen(argv[1],"w"))==NULL)
{
pr(stderr,"file %s failed to open\n",argv[1]);
return -1;
}

View File

@@ -150,7 +150,7 @@ static void ipAddrToAsciiEngineShutdownRequest ( void * )
}
if ( deleteGlobalMutexCondDetected ) {
delete ipAddrToAsciiEnginePrivate :: pGlobalMutex;
ipAddrToAsciiEnginePrivate :: pEngine = 0;
ipAddrToAsciiEnginePrivate :: pGlobalMutex = 0;
}
}
@@ -225,11 +225,13 @@ void ipAddrToAsciiEnginePrivate::release ()
if ( ipAddrToAsciiEnginePrivate::numberOfReferences == 0u ) {
deleteGlobalMutexCondDetected =
ipAddrToAsciiEnginePrivate :: shutdownRequest;
delete ipAddrToAsciiEnginePrivate :: pEngine;
ipAddrToAsciiEnginePrivate :: pEngine = 0;
}
}
if ( deleteGlobalMutexCondDetected ) {
delete ipAddrToAsciiEnginePrivate :: pGlobalMutex;
ipAddrToAsciiEnginePrivate :: pEngine = 0;
ipAddrToAsciiEnginePrivate :: pGlobalMutex = 0;
}
}

View File

@@ -18,8 +18,9 @@
#ifndef INCdevLibh
#define INCdevLibh 1
#include <dbDefs.h>
#include <osdVME.h>
#include "dbDefs.h"
#include "osdVME.h"
#include "shareLib.h"
#ifdef __cplusplus
extern "C" {
@@ -44,14 +45,14 @@ typedef enum {
*/
extern const char *epicsAddressTypeName[];
long devAddressMap(void); /* print an address map */
epicsShareFunc long devAddressMap(void); /* print an address map */
/*
* devBusToLocalAddr()
*
* OSI routine to translate bus addresses their local CPU address mapping
*/
long devBusToLocalAddr (
epicsShareFunc long devBusToLocalAddr (
epicsAddressType addrType,
size_t busAddr,
volatile void **ppLocalAddr);
@@ -61,7 +62,8 @@ long devBusToLocalAddr (
* a bus error safe "wordSize" read at the specified address which returns
* unsuccessful status if the device isnt present
*/
long devReadProbe (unsigned wordSize, volatile const void *ptr, void *pValueRead);
epicsShareFunc long devReadProbe (
unsigned wordSize, volatile const void *ptr, void *pValueRead);
/*
* devNoResponseProbe()
@@ -73,7 +75,7 @@ long devReadProbe (unsigned wordSize, volatile const void *ptr, void *pValueRead
* Checks all naturally aligned word sizes between char and long for
* the entire specified range of bytes.
*/
long devNoResponseProbe(
epicsShareFunc long devNoResponseProbe(
epicsAddressType addrType,
size_t base,
size_t size
@@ -85,16 +87,17 @@ long devNoResponseProbe(
* a bus error safe "wordSize" write at the specified address which returns
* unsuccessful status if the device isnt present
*/
long devWriteProbe (unsigned wordSize, volatile void *ptr, const void *pValueWritten);
epicsShareFunc long devWriteProbe (
unsigned wordSize, volatile void *ptr, const void *pValueWritten);
long devRegisterAddress(
epicsShareFunc long devRegisterAddress(
const char *pOwnerName,
epicsAddressType addrType,
size_t logicalBaseAddress,
size_t size, /* bytes */
volatile void **pPhysicalAddress);
long devUnregisterAddress(
epicsShareFunc long devUnregisterAddress(
epicsAddressType addrType,
size_t logicalBaseAddress,
const char *pOwnerName);
@@ -102,7 +105,7 @@ long devUnregisterAddress(
/*
* allocate and register an unoccupied address block
*/
long devAllocAddress(
epicsShareFunc long devAllocAddress(
const char *pOwnerName,
epicsAddressType addrType,
size_t size,
@@ -112,7 +115,7 @@ long devAllocAddress(
/*
* connect ISR to a VME interrupt vector
*/
long devConnectInterruptVME(
epicsShareFunc long devConnectInterruptVME(
unsigned vectorNumber,
void (*pFunction)(void *),
void *parameter);
@@ -122,7 +125,7 @@ long devConnectInterruptVME(
* (not implemented)
* (API should be reviewed)
*/
long devConnectInterruptISA(
epicsShareFunc long devConnectInterruptISA(
unsigned interruptLevel,
void (*pFunction)(void *),
void *parameter);
@@ -132,7 +135,7 @@ long devConnectInterruptISA(
* (not implemented)
* (API should be reviewed)
*/
long devConnectInterruptPCI(
epicsShareFunc long devConnectInterruptPCI(
unsigned bus,
unsigned device,
unsigned function,
@@ -146,7 +149,7 @@ long devConnectInterruptPCI(
* was connected. It is used as a key to prevent a driver from inadvertently
* removing an interrupt handler that it didn't install
*/
long devDisconnectInterruptVME(
epicsShareFunc long devDisconnectInterruptVME(
unsigned vectorNumber,
void (*pFunction)(void *));
@@ -159,7 +162,7 @@ long devDisconnectInterruptVME(
* was connected. It is used as a key to prevent a driver from inadvertently
* removing an interrupt handler that it didn't install
*/
long devDisconnectInterruptISA(
epicsShareFunc long devDisconnectInterruptISA(
unsigned interruptLevel,
void (*pFunction)(void *));
@@ -172,7 +175,7 @@ long devDisconnectInterruptISA(
* was connected. It is used as a key to prevent a driver from inadvertently
* removing an interrupt handler that it didn't install
*/
long devDisconnectInterruptPCI(
epicsShareFunc long devDisconnectInterruptPCI(
unsigned bus,
unsigned device,
unsigned function,
@@ -183,7 +186,7 @@ long devDisconnectInterruptPCI(
*
* returns boolean
*/
int devInterruptInUseVME (unsigned vectorNumber);
epicsShareFunc int devInterruptInUseVME (unsigned vectorNumber);
/*
* determine if an ISA interrupt level is in use
@@ -191,7 +194,7 @@ int devInterruptInUseVME (unsigned vectorNumber);
*
* returns boolean
*/
int devInterruptLevelInUseISA (unsigned interruptLevel);
epicsShareFunc int devInterruptLevelInUseISA (unsigned interruptLevel);
/*
* determine if a PCI interrupt is in use
@@ -199,7 +202,7 @@ int devInterruptLevelInUseISA (unsigned interruptLevel);
*
* returns boolean
*/
int devInterruptInUsePCI (unsigned bus, unsigned device,
epicsShareFunc int devInterruptInUsePCI (unsigned bus, unsigned device,
unsigned function);
typedef enum {intVME, intVXI, intISA} epicsInterruptType;
@@ -207,42 +210,42 @@ typedef enum {intVME, intVXI, intISA} epicsInterruptType;
/*
* enable VME interrupt level
*/
long devEnableInterruptLevelVME (unsigned level);
epicsShareFunc long devEnableInterruptLevelVME (unsigned level);
/*
* enable ISA interrupt level
*/
long devEnableInterruptLevelISA (unsigned level);
epicsShareFunc long devEnableInterruptLevelISA (unsigned level);
/*
* not implemented - API needs to be reviewed
*/
long devEnableInterruptLevelPCI (unsigned level,
epicsShareFunc long devEnableInterruptLevelPCI (unsigned level,
unsigned bus, unsigned device, unsigned function);
/*
* disable VME interrupt level
*/
long devDisableInterruptLevelVME (unsigned level);
epicsShareFunc long devDisableInterruptLevelVME (unsigned level);
/*
* disable ISA interrupt level
*/
long devDisableInterruptLevelISA (unsigned level);
epicsShareFunc long devDisableInterruptLevelISA (unsigned level);
/*
* not implemented - API needs to be reviewed
*/
long devDisableInterruptLevelPCI (unsigned level,
epicsShareFunc long devDisableInterruptLevelPCI (unsigned level,
unsigned bus, unsigned device, unsigned function);
/*
* Routines to allocate and free memory in the A24 memory region.
*
*/
void *devLibA24Malloc(size_t);
void *devLibA24Calloc(size_t);
void devLibA24Free(void *pBlock);
epicsShareFunc void *devLibA24Malloc(size_t);
epicsShareFunc void *devLibA24Calloc(size_t);
epicsShareFunc void devLibA24Free(void *pBlock);
/*
* Normalize a digital value and convert it to type TYPE
@@ -327,7 +330,7 @@ typedef struct devLibVirtualOS {
void (*pDevA24Free)(void *pBlock);
long (*pDevInit)(void);
}devLibVirtualOS;
extern devLibVirtualOS *pdevLibVirtualOS;
epicsShareExtern devLibVirtualOS *pdevLibVirtualOS;
/*
* error codes (and messages) associated with devLib.c
@@ -378,7 +381,7 @@ extern devLibVirtualOS *pdevLibVirtualOS;
* devConnectInterruptISA etc. devConnectInterrupt will be removed
* in a future release.
*/
long devConnectInterrupt(
epicsShareFunc long devConnectInterrupt(
epicsInterruptType intType,
unsigned vectorNumber,
void (*pFunction)(void *),
@@ -392,10 +395,10 @@ long devConnectInterrupt(
* devDisconnectInterruptISA etc. devDisconnectInterrupt will be removed
* in a future release.
*/
long devDisconnectInterrupt(
epicsShareFunc long devDisconnectInterrupt(
epicsInterruptType intType,
unsigned vectorNumber,
void (*pFunction)(void *));
void (*pFunction)(void *));
/*
* NOTE: this routine has been deprecated. It exists
@@ -405,7 +408,8 @@ long devDisconnectInterrupt(
* devEnableInterruptLevelISA etc. devEnableInterruptLevel will be removed
* in a future release.
*/
long devEnableInterruptLevel(epicsInterruptType intType, unsigned level);
epicsShareFunc long devEnableInterruptLevel(
epicsInterruptType intType, unsigned level);
/*
* NOTE: this routine has been deprecated. It exists
@@ -415,7 +419,8 @@ long devEnableInterruptLevel(epicsInterruptType intType, unsigned level);
* devDisableInterruptLevelPCI etc. devDisableInterruptLevel will be removed
* in a future release.
*/
long devDisableInterruptLevel (epicsInterruptType intType, unsigned level);
epicsShareFunc long devDisableInterruptLevel (
epicsInterruptType intType, unsigned level);
/*
* NOTE: this routine has been deprecated. It exists
@@ -424,7 +429,7 @@ long devDisableInterruptLevel (epicsInterruptType intType, unsigned level);
* Please use devNoResponseProbe(). locationProbe() will be removed
* in a future release.
*/
long locationProbe (epicsAddressType addrType, char *pLocation);
epicsShareFunc long locationProbe (epicsAddressType addrType, char *pLocation);
/*
* Some vxWorks convenience routines

View File

@@ -14,13 +14,13 @@
#include <exception>
#include <typeinfo>
#include <algorithm>
#include <stdio.h>
#include <stddef.h>
#include <float.h>
#define epicsExportSharedSymbols
#include "epicsAlgorithm.h"
#include "epicsTime.h"
#include "epicsThread.h"
#include "epicsAssert.h"
@@ -31,23 +31,6 @@ epicsThreadRunable::~epicsThreadRunable () {}
void epicsThreadRunable::run () {}
void epicsThreadRunable::show ( unsigned int ) const {}
// vxWorks 5.4 gcc fails during compile when I use std::exception
using namespace std;
// exception payload
class epicsThread::unableToCreateThread : public exception {
const char * what () const throw () {
return "epicsThread class was unable to create a new thread";
}
};
// exception payload
class epicsThread::exitException : public exception {
const char * what () const throw () {
return "epicsThread class's private exit exception";
}
};
extern "C" void epicsThreadCallEntryPoint ( void * pPvt )
{
epicsThread * pThread =
@@ -77,7 +60,7 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt )
// this should behave as the C++ implementation intends when an
// exception isnt handled. If users dont like this behavior, they
// can install an application specific unexpected handler.
unexpected ();
std::unexpected ();
}
}
catch ( ... ) {
@@ -90,11 +73,14 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt )
errlogPrintf (
"epicsThread: Unknown C++ exception in thread \"%s\" at %s\n",
name, date );
// this should behave as the C++ implementation intends when an
// exception isnt handled. If users dont like this behavior, they
// can install an application specific unexpected handler.
unexpected ();
errlogFlush ();
}
// The Linux NPTL library requires us to re-throw here; it uses
// an untyped exception object to shut down threads when we call
// pthread_cancel() in the os/posix/osdThread.c myAtExit()
// handler, and aborts with "FATAL: exception not rethrown" if
// we don't re-throw it. This solution is incomplete though...
throw;
}
if ( ! waitRelease ) {
epicsGuard < epicsMutex > guard ( pThread->mutex );
@@ -154,13 +140,13 @@ bool epicsThread::exitWait ( const double delay ) throw ()
"epicsThread::exitWait(): Unexpected exception "
" \"%s\"\n",
except.what () );
epicsThreadSleep ( std :: min ( delay, 5.0 ) );
epicsThreadSleep ( epicsMin ( delay, 5.0 ) );
}
catch ( ... ) {
errlogPrintf (
"Non-standard unexpected exception in "
"epicsThread::exitWait()\n" );
epicsThreadSleep ( std :: min ( delay, 5.0 ) );
epicsThreadSleep ( epicsMin ( delay, 5.0 ) );
}
return this->terminated;
}
@@ -283,13 +269,6 @@ void epicsThread::setOkToBlock(bool isOkToBlock) throw ()
epicsThreadSetOkToBlock(static_cast<int>(isOkToBlock));
}
class epicsThreadPrivateBase::unableToCreateThreadPrivate : public exception {
const char * what () const throw ()
{
return "epicsThreadPrivate:: unable to create thread private variable";
}
};
void epicsThreadPrivateBase::throwUnableToCreateThreadPrivate ()
{
throw epicsThreadPrivateBase::unableToCreateThreadPrivate ();
@@ -334,4 +313,4 @@ extern "C" {
} // extern "C"
// Ensure the main thread gets a unique ID
static epicsThreadId epicsThreadMainId = epicsThreadGetIdSelf();
epicsThreadId epicsThreadMainId = epicsThreadGetIdSelf();

View File

@@ -156,7 +156,9 @@ public:
static const char * getNameSelf () throw ();
static bool isOkToBlock () throw ();
static void setOkToBlock ( bool isOkToBlock ) throw ();
class unableToCreateThread; /* exception payload */
/* exceptions */
class unableToCreateThread {};
private:
epicsThreadRunable & runable;
epicsThreadId id;
@@ -173,12 +175,13 @@ private:
epicsThread & operator = ( const epicsThread & );
friend void epicsThreadCallEntryPoint ( void * );
class exitException; /* exception payload */
/* exceptions */
class exitException {};
};
class epicsShareClass epicsThreadPrivateBase {
public:
class unableToCreateThreadPrivate; /* exception */
class unableToCreateThreadPrivate {}; /* exception */
protected:
static void throwUnableToCreateThreadPrivate ();
};

View File

@@ -131,22 +131,16 @@ epicsEventWaitWithTimeout(epicsEventId id, double timeOut)
{
rtems_id sid = (rtems_id)id;
rtems_status_code sc;
uint32_t wait;
rtems_interval delay;
extern double rtemsTicksPerSecond_double;
if (timeOut <= 0.0)
return epicsEventTryWait(id);
SEMSTAT(1)
if (timeOut <= 0.0) {
wait = RTEMS_NO_WAIT;
delay = 0;
}
else {
wait = RTEMS_WAIT;
delay = timeOut * rtemsTicksPerSecond_double;
if (delay == 0)
delay++;
}
sc = rtems_semaphore_obtain (sid, wait, delay);
delay = timeOut * rtemsTicksPerSecond_double;
if (delay == 0)
delay++;
sc = rtems_semaphore_obtain (sid, RTEMS_WAIT, delay);
if (sc == RTEMS_SUCCESSFUL)
return epicsEventWaitOK;
else if (sc == RTEMS_TIMEOUT)

View File

@@ -6,10 +6,6 @@
\*************************************************************************/
/*
* This header fragment is intended to be included as part of epicsString.h
* epicsStrtod() for systems with working strtod() routine
*/
/*
* epicsStrtod() for systems with broken strtod() routine
*/
epicsShareFunc double epicsStrtod(const char *str, char **endp);
#define epicsStrtod strtod

View File

@@ -104,6 +104,9 @@ int epicsTime_localtime ( const time_t *clock, struct tm *result )
}
}
rtems_interval rtemsTicksPerSecond;
double rtemsTicksPerSecond_double, rtemsTicksPerTwoSeconds_double;
} // extern "C"
/*
@@ -119,6 +122,11 @@ static int staticTimeRegister(void)
{
if (rtemsTicksPerSecond != 0)
osdTimeRegister();
rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &rtemsTicksPerSecond);
rtemsTicksPerSecond_double = rtemsTicksPerSecond;
rtemsTicksPerTwoSeconds_double = rtemsTicksPerSecond_double * 2.0;
return 1;
}
static int done = staticTimeRegister();

View File

@@ -793,13 +793,17 @@ epicsShareFunc void epicsShareAPI epicsThreadSleep ( double seconds )
* epicsThreadSleepQuantum ()
*/
double epicsShareAPI epicsThreadSleepQuantum ()
{
{
/*
* Its worth noting here that the sleep quantum on windows can
* mysteriously get better. I eventually tracked this down to
* codes that call timeBeginPeriod(1). Calling timeBeginPeriod()
* specifying a better timer resolution also increases the interrupt
* load. This appears to be related to java applet activity.
* The function timeGetDevCaps can tell us the range of periods
* that can be specified to timeBeginPeriod, but alas there
* appears to be no way to find out what the value of the global
* minimum of all timeBeginPeriod calls for all processes is.
*/
static const double secPerTick = 100e-9;
DWORD adjustment;

View File

@@ -1,16 +1,18 @@
//
// Default version of osdWireConfig.h that might
// work on UNIX like systems that define <sys/param.h>
//
// Author Jeffrey O. Hill
// johill@lanl.gov
//
/*
* Default version of osdWireConfig.h that might
* work on UNIX like systems that define <sys/param.h>
*
* Author Jeffrey O. Hill
* johill@lanl.gov
*/
#ifndef osdWireConfig_h
#define osdWireConfig_h
// if compilation fails because this wasnt found then you may need to define an OS
// specific osdWireConfig.h
/* This file must be usable from both C and C++ */
/* if compilation fails because this wasnt found then you may need to define an OS
specific osdWireConfig.h */
#include <sys/param.h>
#ifdef __BYTE_ORDER
@@ -53,10 +55,10 @@
# error EPICS hasnt been ported to <sys/param.h> specified FLOAT_WORD_ORDER
# endif
# else
// assume that if neither __FLOAT_WORD_ORDER nor FLOAT_WORD_ORDER are
// defined then weird fp ordered archs like arm nwfp aren't supported
/* assume that if neither __FLOAT_WORD_ORDER nor FLOAT_WORD_ORDER are
defined then weird fp ordered archs like arm nwfp aren't supported */
# define EPICS_FLOAT_WORD_ORDER EPICS_BYTE_ORDER
# endif
#endif
#endif // ifdef osdWireConfig_h
#endif /* ifdef osdWireConfig_h */

View File

@@ -22,20 +22,28 @@
#include "cantProceed.h"
#include "epicsRingBytes.h"
/*
* Need at least one extra byte to be able to distinguish a completely
* full buffer from a completely empty one. Allow for a little extra
* space to try and keep good alignment and avoid multiple calls to
* memcpy for a single put/get operation.
*/
#define SLOP 16
typedef struct ringPvt {
int nextPut;
int nextGet;
int size;
char *buffer;
volatile int nextPut;
volatile int nextGet;
int size;
volatile char *buffer;
}ringPvt;
epicsShareFunc epicsRingBytesId epicsShareAPI epicsRingBytesCreate(int size)
{
ringPvt *pring = mallocMustSucceed(sizeof(ringPvt),"epicsRingBytesCreate");
pring->size = size + 1;
pring->size = size + SLOP;
pring->buffer = mallocMustSucceed(pring->size,"ringCreate");
pring->nextGet = pring->nextPut = 0;
pring->nextGet = 0;
pring->nextPut = 0;
return((void *)pring);
}
@@ -45,7 +53,7 @@ epicsShareFunc void epicsShareAPI epicsRingBytesDelete(epicsRingBytesId id)
free((void *)pring->buffer);
free((void *)pring);
}
epicsShareFunc int epicsShareAPI epicsRingBytesGet(
epicsRingBytesId id, char *value,int nbytes)
{
@@ -59,19 +67,21 @@ epicsShareFunc int epicsShareAPI epicsRingBytesGet(
count = nextPut - nextGet;
if (count < nbytes)
nbytes = count;
memcpy (value, &pring->buffer[nextGet], nbytes);
if (nbytes)
memcpy (value, (void *)&pring->buffer[nextGet], nbytes);
nextGet += nbytes;
}
else {
count = size - nextGet;
if (count > nbytes)
count = nbytes;
memcpy (value, &pring->buffer[nextGet], count);
if ((nextGet = nextGet + count) == size) {
memcpy (value, (void *)&pring->buffer[nextGet], count);
nextGet += count;
if (nextGet == size) {
int nLeft = nbytes - count;
if (nLeft > nextPut)
nLeft = nextPut;
memcpy (value+count, &pring->buffer[0], nLeft);
memcpy (value+count, (void *)&pring->buffer[0], nLeft);
nextGet = nLeft;
nbytes = count + nLeft;
}
@@ -90,78 +100,68 @@ epicsShareFunc int epicsShareAPI epicsRingBytesPut(
int nextGet = pring->nextGet;
int nextPut = pring->nextPut;
int size = pring->size;
int count;
int freeCount, copyCount, topCount;
if (nextPut < nextGet) {
count = nextGet - nextPut - 1;
if (nbytes > count)
nbytes = count;
memcpy (&pring->buffer[nextPut], value, nbytes);
nextPut += nbytes;
}
else if (nextGet == 0) {
count = size - nextPut - 1;
if (nbytes > count)
nbytes = count;
memcpy (&pring->buffer[nextPut], value, nbytes);
freeCount = nextGet - nextPut - SLOP;
if (nbytes > freeCount)
nbytes = freeCount;
if (nbytes)
memcpy ((void *)&pring->buffer[nextPut], value, nbytes);
nextPut += nbytes;
}
else {
count = size - nextPut;
if (count > nbytes)
count = nbytes;
memcpy (&pring->buffer[nextPut], value, count);
if ((nextPut = nextPut + count) == size) {
int nLeft = nbytes - count;
if (nLeft > (nextGet - 1))
nLeft = nextGet - 1;
memcpy (&pring->buffer[0], value+count, nLeft);
freeCount = size - nextPut + nextGet - SLOP;
if (nbytes > freeCount)
nbytes = freeCount;
topCount = size - nextPut;
copyCount = (nbytes > topCount) ? topCount : nbytes;
if (copyCount)
memcpy ((void *)&pring->buffer[nextPut], value, copyCount);
nextPut += copyCount;
if (nextPut == size) {
int nLeft = nbytes - copyCount;
if (nLeft)
memcpy ((void *)&pring->buffer[0], value+copyCount, nLeft);
nextPut = nLeft;
nbytes = count + nLeft;
}
else {
nbytes = count;
nextPut = nextPut;
}
}
pring->nextPut = nextPut;
return nbytes;
}
epicsShareFunc void epicsShareAPI epicsRingBytesFlush(epicsRingBytesId id)
{
ringPvt *pring = (ringPvt *)id;
pring->nextGet = pring->nextPut = 0;
pring->nextGet = 0;
pring->nextPut = 0;
}
epicsShareFunc int epicsShareAPI epicsRingBytesFreeBytes(epicsRingBytesId id)
{
ringPvt *pring = (ringPvt *)id;
int n;
int nextGet = pring->nextGet;
int nextPut = pring->nextPut;
n = pring->nextGet - pring->nextPut - 1;
if (n < 0)
n += pring->size;
return n;
if (nextPut < nextGet)
return nextGet - nextPut - SLOP;
else
return pring->size - nextPut + nextGet - SLOP;
}
epicsShareFunc int epicsShareAPI epicsRingBytesUsedBytes(epicsRingBytesId id)
{
ringPvt *pring = (ringPvt *)id;
int n;
n = pring->nextPut - pring->nextGet;
if (n < 0)
n += pring->size;
return n;
return pring->size - epicsRingBytesFreeBytes(id) - SLOP;
}
epicsShareFunc int epicsShareAPI epicsRingBytesSize(epicsRingBytesId id)
{
ringPvt *pring = (ringPvt *)id;
return pring->size - 1;
return pring->size - SLOP;
}
epicsShareFunc int epicsShareAPI epicsRingBytesIsEmpty(epicsRingBytesId id)
@@ -173,9 +173,5 @@ epicsShareFunc int epicsShareAPI epicsRingBytesIsEmpty(epicsRingBytesId id)
epicsShareFunc int epicsShareAPI epicsRingBytesIsFull(epicsRingBytesId id)
{
ringPvt *pring = (ringPvt *)id;
int count;
count = (pring->nextPut - pring->nextGet) + 1;
return ((count == 0) || (count == pring->size));
return (epicsRingBytesFreeBytes(id) <= 0);
}

View File

@@ -43,10 +43,10 @@ private: /* Prevent compiler-generated member functions */
epicsRingPointer& operator=(const epicsRingPointer &);
private: /* Data */
int nextPush;
int nextPop;
volatile int nextPush;
volatile int nextPop;
int size;
T **buffer;
T * volatile * buffer;
};
extern "C" {
@@ -93,10 +93,11 @@ inline epicsRingPointer<T>::~epicsRingPointer()
template <class T>
inline bool epicsRingPointer<T>::push(T *p)
{
int newNext = nextPush +1;
int next = nextPush;
int newNext = next + 1;
if(newNext>=size) newNext=0;
if(newNext==nextPop) return(false);
buffer[nextPush] = p;
buffer[next] = p;
nextPush = newNext;
return(true);
}
@@ -104,18 +105,21 @@ inline bool epicsRingPointer<T>::push(T *p)
template <class T>
inline T* epicsRingPointer<T>::pop()
{
if(nextPop == nextPush) return(0);
T*p = buffer[nextPop];
int newNext= nextPop;
++newNext;
if(newNext >=size) newNext = 0;
nextPop = newNext;
int next = nextPop;
if(next == nextPush) return(0);
T*p = buffer[next];
++next;
if(next >=size) next = 0;
nextPop = next;
return(p);
}
template <class T>
inline void epicsRingPointer<T>::flush()
{ nextPop = nextPush = 0;}
{
nextPop = 0;
nextPush = 0;
}
template <class T>
inline int epicsRingPointer<T>::getFree() const

View File

@@ -77,6 +77,11 @@ ringPointerTest_SRCS += ringPointerTest.c
testHarness_SRCS += ringPointerTest.c
TESTS += ringPointerTest
TESTPROD_HOST += ringBytesTest
ringBytesTest_SRCS += ringBytesTest.c
testHarness_SRCS += ringBytesTest.c
TESTS += ringBytesTest
TESTPROD_HOST += epicsEventTest
epicsEventTest_SRCS += epicsEventTest.cpp
testHarness_SRCS += epicsEventTest.cpp

View File

@@ -27,7 +27,8 @@
#include "testMain.h"
static const char *msg1 = "1234567890This is a very long message.";
static int testExit = 0;
static volatile int testExit = 0;
static epicsEventId finished;
/*
* In Numerical Recipes in C: The Art of Scientific Computing (William H.
@@ -105,6 +106,7 @@ receiver(void *arg)
testDiag("Sender %d -- %d messages", sender, expectmsg[sender-1]-1);
}
testOk1(errors == 0);
epicsEventSignal(finished);
}
extern "C" void
@@ -125,7 +127,6 @@ sender(void *arg)
extern "C" void messageQueueTest(void *parm)
{
epicsEventId *pfinished = (epicsEventId *) parm;
unsigned int i;
char cbuf[80];
int len;
@@ -278,19 +279,17 @@ extern "C" void messageQueueTest(void *parm)
epicsThreadSleep(300.0);
testExit = 1;
epicsThreadSleep(1.0);
epicsEventSignal(*pfinished);
}
MAIN(epicsMessageQueueTest)
{
testPlan(58);
epicsEventId finished = epicsEventMustCreate(epicsEventEmpty);
finished = epicsEventMustCreate(epicsEventEmpty);
epicsThreadCreate("messageQueueTest", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
messageQueueTest, (void *) &finished);
messageQueueTest, NULL);
epicsEventWait(finished);

View File

@@ -32,6 +32,7 @@ int epicsTimeTest(void);
int macLibTest(void);
int macEnvExpandTest(void);
int ringPointerTest(void);
int ringBytesTest(void);
int blockingSockTest(void);
int taskwdTest(void);
int epicsExitTest(void);
@@ -80,6 +81,8 @@ void epicsRunLibComTests(void)
runTest(ringPointerTest);
runTest(ringBytesTest);
runTest(blockingSockTest);
runTest(taskwdTest);

View File

@@ -46,7 +46,9 @@ static void testEpicsSnprintf() {
for (size = 1; size < strlen(expected) + 5; ++size) {
rtn = epicsSnprintf(buffer, size, format, ivalue, fvalue, svalue);
testOk(rtn == rlen-1, "epicsSnprintf(size=%d) = %d", size, rtn);
testOk(rtn <= rlen-1, "epicsSnprintf(size=%d) = %d", size, rtn);
if (rtn != rlen-1)
testDiag("Return value does not indicate buffer size needed");
testOk(strncmp(buffer, expected, size - 1) == 0,
"buffer = '%s'", buffer);
rtn = strlen(buffer);

View File

@@ -0,0 +1,142 @@
/*************************************************************************\
* Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* ringBytesTest.c */
#include <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include "epicsThread.h"
#include "epicsRingBytes.h"
#include "errlog.h"
#include "epicsEvent.h"
#include "epicsUnitTest.h"
#include "testMain.h"
#define RINGSIZE 10
static char msg[] = "This is a very long string to be sent through the ring. "
"It will take multiple transmissions, you know.";
typedef struct info {
epicsEventId consumerEvent;
epicsRingBytesId ring;
}info;
static void check(epicsRingBytesId ring, int expectedFree)
{
int expectedUsed = RINGSIZE - expectedFree;
int expectedEmpty = (expectedUsed == 0);
int expectedFull = (expectedFree == 0);
int nFree = epicsRingBytesFreeBytes(ring);
int nUsed = epicsRingBytesUsedBytes(ring);
int isEmpty = epicsRingBytesIsEmpty(ring);
int isFull = epicsRingBytesIsFull(ring);
testOk(nFree == expectedFree, "Free: %d == %d", nFree, expectedFree);
testOk(nUsed == expectedUsed, "Used: %d == %d", nUsed, expectedUsed);
testOk(isEmpty == expectedEmpty, "Empty: %d == %d", isEmpty, expectedEmpty);
testOk(isFull == expectedFull, "Full: %d == %d", isFull, expectedFull);
}
static void consumer(void *arg)
{
info *pinfo = (info *)arg;
char getMsg[sizeof(msg) + RINGSIZE];
int i = 0;
int n;
testDiag("Consumer starting");
while(1) {
epicsEventMustWait(pinfo->consumerEvent);
n = epicsRingBytesGet(pinfo->ring, getMsg+i, RINGSIZE);
testOk(n != 0, "Read from ring");
i += n;
if (i >= sizeof(msg))
break;
}
testOk(i==sizeof(msg), "Correct number of bytes received %d==%d", i, (int)sizeof(msg));
testOk(strcmp(msg, getMsg) == 0, "Message received");
}
MAIN(ringBytesTest)
{
int i, n;
info *pinfo;
epicsEventId consumerEvent;
char put[RINGSIZE+1];
char get[RINGSIZE+1];
epicsRingBytesId ring;
testPlan(242);
pinfo = calloc(1,sizeof(info));
if (!pinfo) {
testAbort("calloc failed");
}
pinfo->consumerEvent = consumerEvent = epicsEventCreate(epicsEventEmpty);
if (!consumerEvent) {
testAbort("epicsEventCreate failed");
}
pinfo->ring = ring = epicsRingBytesCreate(RINGSIZE);
if (!ring) {
testAbort("epicsRingBytesCreate failed");
}
check(ring, RINGSIZE);
for (i = 0 ; i < sizeof(put) ; i++)
put[i] = i;
for(i = 0 ; i < RINGSIZE ; i++) {
n = epicsRingBytesPut(ring, put, i);
testOk(n==i, "ring put %d", i);
check(ring, RINGSIZE-i);
n = epicsRingBytesGet(ring, get, i);
testOk(n==i, "ring get %d", i);
check(ring, RINGSIZE);
testOk(memcmp(put,get,i)==0, "get matches write");
}
for(i = 0 ; i < RINGSIZE ; i++) {
n = epicsRingBytesPut(ring, put+i, 1);
testOk(n==1, "ring put 1, %d", i);
check(ring, RINGSIZE-1-i);
}
n = epicsRingBytesPut(ring, put+RINGSIZE, 1);
testOk(n==0, "put to full ring");
check(ring, 0);
for(i = 0 ; i < RINGSIZE ; i++) {
n = epicsRingBytesGet(ring, get+i, 1);
testOk(n==1, "ring get 1, %d", i);
check(ring, 1+i);
}
testOk(memcmp(put,get,RINGSIZE)==0, "get matches write");
n = epicsRingBytesGet(ring, get+RINGSIZE, 1);
testOk(n==0, "get from empty ring");
check(ring, RINGSIZE);
epicsThreadCreate("consumer", 50,
epicsThreadGetStackSize(epicsThreadStackSmall), consumer, pinfo);
epicsThreadSleep(0.1);
for (i = 0; i < sizeof(msg) ; ) {
n = epicsRingBytesPut(ring, msg+i, sizeof(msg)-i);
epicsEventSignal(consumerEvent);
epicsThreadSleep(0.2);
i += n;
}
epicsThreadSleep(0.2);
check(ring, RINGSIZE);
return testDone();
}

View File

@@ -27,7 +27,7 @@
#define ringSize 10
static int testExit = 0;
static volatile int testExit = 0;
typedef struct info {
epicsEventId consumerEvent;

View File

@@ -23,7 +23,6 @@ TEMPLATES += top/iocApp/Makefile
TEMPLATES += top/iocApp/Db/Makefile
TEMPLATES += top/iocApp/src/Makefile
TEMPLATES += top/iocApp/src/_APPNAME_Main.cpp
TEMPLATES += top/iocApp/src/sncExample.stt
TEMPLATES += top/exampleApp/Makefile
TEMPLATES += top/exampleApp/Db/Makefile

View File

@@ -48,7 +48,7 @@ _APPNAME__SRCS_DEFAULT += _APPNAME_Main.cpp
_APPNAME__SRCS_vxWorks += -nil-
# Add support from base/src/vxWorks if needed
_APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
#_APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
# Link in the code from the support library
_APPNAME__LIBS += _APPNAME_Support
@@ -58,7 +58,7 @@ _APPNAME__LIBS += _APPNAME_Support
ifneq ($(SNCSEQ),)
# Build sncExample into _APPNAME_Support
_APPNAME__SNCFLAGS += +r
sncExample_SNCFLAGS += +r
_APPNAME__DBD += sncExample.dbd
_APPNAME_Support_SRCS += sncExample.stt
_APPNAME_Support_LIBS += seq pv

View File

@@ -6,45 +6,34 @@ include $(TOP)/configure/CONFIG
#=============================
#=============================
# build an ioc application
# Build the IOC application
PROD_IOC = _APPNAME_
# _APPNAME_.dbd will be created and installed
DBD += _APPNAME_.dbd
# _APPNAME_.dbd will be made up from these files:
_APPNAME__DBD += base.dbd
#include definitions for any other support applications needed
# Include dbd files from all support applications:
#_APPNAME__DBD += xxx.dbd
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
# Add all the support libraries needed by this IOC
#_APPNAME__LIBS += xxx
# _APPNAME__registerRecordDeviceDriver.cpp derives from _APPNAME_.dbd
_APPNAME__SRCS += _APPNAME__registerRecordDeviceDriver.cpp
# Build the main IOC entry point on workstation OSs.
_APPNAME__SRCS_DEFAULT += _APPNAME_Main.cpp
_APPNAME__SRCS_vxWorks += -nil-
#The following adds support from base/src/vxWorks
_APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
#add a definition for each support application used by this application
#_APPNAME__LIBS += xxx
#NOTES:
# 1)It is not possible to build sncExample both as a component of _APPNAME_
# and standalone. You must choose only one.
# 2)To build sncExample SNCSEQ must be defined in <top>/configure/RELEASE
#The following builds sncExample as a component of _APPNAME_
#_APPNAME__SRCS += sncExample.stt
#_APPNAME__LIBS += seq pv
# Add support from base/src/vxWorks if needed
#_APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
# Finally link to the EPICS Base libraries
_APPNAME__LIBS += $(EPICS_BASE_IOC_LIBS)
#The following builds sncExample as a standalone application
#PROD_HOST += sncExample
#sncExample_SNCFLAGS += +m
#sncExample_SRCS += sncExample.stt
#sncExample_LIBS += seq pv
#sncExample_LIBS += $(EPICS_BASE_HOST_LIBS)
#===========================
include $(TOP)/configure/RULES

View File

@@ -7,6 +7,7 @@
#include <string.h>
#include <stdio.h>
#include "epicsExit.h"
#include "epicsThread.h"
#include "iocsh.h"
@@ -17,5 +18,6 @@ int main(int argc,char *argv[])
epicsThreadSleep(.2);
}
iocsh(NULL);
epicsExit(0);
return(0);
}

View File

@@ -1,28 +0,0 @@
program sncExample
float v;
assign v to "{user}:xxxExample";
monitor v;
ss ss1
{
state low
{
when(v>5.0)
{
printf("changing to high\n");
} state high
when(delay(.1))
{
} state low
}
state high
{
when(v<=5.0)
{
printf("changing to low\n");
} state low
when(delay(.1))
{
} state high
}
}

View File

@@ -8,14 +8,14 @@
cd ${TOP}
## Register all support components
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
_CSAFEAPPNAME__registerRecordDeviceDriver(pdbbase)
dbLoadDatabase "dbd/_APPNAME_.dbd"
_CSAFEAPPNAME__registerRecordDeviceDriver pdbbase
## Load record instances
#dbLoadRecords("db/xxx.db","user=_USER_Host")
cd ${TOP}/iocBoot/${IOC}
iocInit()
iocInit
## Start any sequence programs
#seq sncxxx,"user=_USER_Host"

View File

@@ -6,13 +6,14 @@
#< envPaths
## Register all support components
dbLoadDatabase("../../dbd/_APPNAME_.dbd",0,0)
_CSAFEAPPNAME__registerRecordDeviceDriver(pdbbase)
dbLoadDatabase "dbd/_APPNAME_.dbd"
_CSAFEAPPNAME__registerRecordDeviceDriver pdbbase
## Load record instances
dbLoadRecords("../../db/_APPNAME_.db","user=_USER_")
#dbLoadTemplate "db/_APPNAME_.substitutions"
#dbLoadRecords "db/_APPNAME_.db", "user=_USER_"
iocInit()
iocInit
## Start any sequence programs
#seq snc_APPNAME_,"user=_USER_"
#seq sncxxx, "user=_USER_"

View File

@@ -8,22 +8,22 @@
#< ../nfsCommands
cd topbin
## You may have to change _APPNAME_ to something else
## everywhere it appears in this file
ld < _APPNAME_.munch
## Register all support components
cd top
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
_CSAFEAPPNAME__registerRecordDeviceDriver(pdbbase)
dbLoadDatabase "dbd/_APPNAME_.dbd"
_CSAFEAPPNAME__registerRecordDeviceDriver pdbbase
## Load record instances
#dbLoadRecords("db/_APPNAME_.db","macro=value")
#dbLoadTemplate("db/_APPNAME_.substitutions")
#dbLoadTemplate "db/_APPNAME_.substitutions"
#dbLoadRecords "db/_APPNAME_.db", "user=_USER_"
cd startup
iocInit()
iocInit
## Start any sequence programs
#seq &sncExample,"user=_USER_"
#seq &sncxxx, "user=_USER_"

View File

@@ -17,19 +17,19 @@ EPICS::Path - Path-handling utilities for EPICS tools
=head1 SYNOPSIS
use lib '@EPICS_BASE@/lib/perl';
use EPICS::Path;
use lib '@EPICS_BASE@/lib/perl';
use EPICS::Path;
my $dir = UnixPath('C:\Program Files\EPICS');
print LocalPath($dir), "\n";
print AbsPath('../lib', $dir);
my $dir = UnixPath('C:\Program Files\EPICS');
print LocalPath($dir), "\n";
print AbsPath('../lib', $dir);
=head1 DESCRIPTION
C<EPICS::Path> provides functions for processing pathnames that are
commonly needed by EPICS tools. Windows is not the only culprit, some
older automount daemons insert strange prefixes into absolute directory
paths that we have to remove before storing the result for use later.
C<EPICS::Path> provides functions for processing pathnames that are commonly
needed by EPICS tools. Windows is not the only culprit, some older automount
daemons insert strange prefixes into absolute directory paths that we have to
remove before storing the result for use later.
=head1 FUNCTIONS
@@ -38,12 +38,11 @@ paths that we have to remove before storing the result for use later.
=item UnixPath( I<PATH> )
C<UnixPath> should be used on any pathnames provided by external
tools to convert them into a form that Perl understands.
C<UnixPath> should be used on any pathnames provided by external tools to
convert them into a form that Perl understands.
On cygwin we convert Windows drive specs to the equivalent cygdrive
path, and on Windows we switch directory separators from back-slash
to forward slashes.
On cygwin we convert Windows drive specs to the equivalent cygdrive path, and on
Windows we switch directory separators from back-slash to forward slashes.
=cut
@@ -60,16 +59,14 @@ sub UnixPath {
=item LocalPath( I<PATH> )
C<LocalPath> should be used when generating pathnames for external
tools or to put into a file. It converts paths from the Unix form
that Perl understands to any necessary external representation, and
also removes automounter prefixes to put the path into its canonical
form.
C<LocalPath> should be used when generating pathnames for external tools or to
put into a file. It converts paths from the Unix form that Perl understands to
any necessary external representation, and also removes automounter prefixes to
put the path into its canonical form.
On cygwin we convert cygdrive paths to their equivalent Windows
drive specs. Before Leopard, the Mac OS X automounter inserted a
verbose prefix, and in case anyone is still using SunOS it adds its
own prefix as well.
On cygwin we convert cygdrive paths to their equivalent Windows drive specs.
Before Leopard, the Mac OS X automounter inserted a verbose prefix, and in case
anyone is still using SunOS it adds its own prefix as well.
=cut
@@ -91,17 +88,15 @@ sub LocalPath {
=item AbsPath( I<PATH>, I<CWD> )
The C<abs_path()> function in Perl's C<Cwd> module doesn't like
non-existent path components other than in the final position, but
EPICS tools needs to be able to handle them in paths like
F<$(TOP)/lib/$(T_A)> before the F<$(TOP)/lib> directory has been
created.
The C<abs_path()> function in Perl's C<Cwd> module doesn't like non-existent
path components other than in the final position, but EPICS tools needs to be
able to handle them in paths like F<$(TOP)/lib/$(T_A)> before the F<$(TOP)/lib>
directory has been created.
C<AbsPath> takes a path I<PATH> and optionally an absolute path to a
directory that first is relative to; if the second argument is not
provided the current working directory is used. The result returned
has been filtered through C<LocalPath()> to remove any automounter
prefixes.
C<AbsPath> takes a path I<PATH> and optionally an absolute path to a directory
that first is relative to; if the second argument is not provided the current
working directory is used. The result returned has been filtered through
C<LocalPath()> to remove any automounter prefixes.
=cut
@@ -118,7 +113,7 @@ sub AbsPath {
}
# Move leading ./ and ../ components from $path to $cwd
if (my ($dots, $not) = ($path =~ m[^ ( (?: \. \.? / )+ ) ( .* ) $]x)) {
if (my ($dots, $not) = ($path =~ m[^ ( (?: \. \.? /+ )+ ) ( .* ) $]x)) {
$cwd .= "/$dots";
$path = $not;
}