Calling CA Functions from POSIX signal
+
As you might expect, it isnt safe to call the CA client library from a POSIX
From e2e40a4b9f8355fac4c4795da74fce7a5d370574 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 7 Apr 2014 12:38:03 -0500
Subject: [PATCH 02/18] configure: Add inc dependency to compile rules
The inc step must have been completed before we run
the C/C++ compilers to build any object files.
---
configure/RULES_BUILD | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index a8cba0d4e..41b1f0958 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -195,17 +195,17 @@ $(OBJLIBNAME):%$(OBJ):
@$(RM) $@
$(COMPILE.ctdt) $<
-%$(OBJ): %.c
+%$(OBJ): %.c inc
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.c) $(call PATH_FILTER,$<) $(COMPILE_FILTER.c)
-%$(OBJ): %.cc
+%$(OBJ): %.cc inc
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.cpp) $(call PATH_FILTER,$<) $(COMPILE_FILTER.cpp)
-%$(OBJ): %.cpp
+%$(OBJ): %.cpp inc
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.cpp) $(call PATH_FILTER,$<) $(COMPILE_FILTER.cpp)
From 475296ad4980bf1c517239e8ef3c5745c4b1ff16 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 9 Apr 2014 16:54:26 -0500
Subject: [PATCH 03/18] Modify inc dependencies
Using inc causes a rebuild every time; replace it with
the list of include files that the compiler might use.
Also adjust gdd build to avoid a circular dependency.
---
configure/RULES_BUILD | 6 +++---
src/gdd/Makefile | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index 41b1f0958..4f622e182 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -195,17 +195,17 @@ $(OBJLIBNAME):%$(OBJ):
@$(RM) $@
$(COMPILE.ctdt) $<
-%$(OBJ): %.c inc
+%$(OBJ): %.c $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.c) $(call PATH_FILTER,$<) $(COMPILE_FILTER.c)
-%$(OBJ): %.cc inc
+%$(OBJ): %.cc $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.cpp) $(call PATH_FILTER,$<) $(COMPILE_FILTER.cpp)
-%$(OBJ): %.cpp inc
+%$(OBJ): %.cpp $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
$(COMPILE.cpp) $(call PATH_FILTER,$<) $(COMPILE_FILTER.cpp)
diff --git a/src/gdd/Makefile b/src/gdd/Makefile
index 1b923cb35..c5b32dee4 100644
--- a/src/gdd/Makefile
+++ b/src/gdd/Makefile
@@ -30,9 +30,11 @@ INC += dbMapper.h
INC += gddAppTable.h
INC += gddAppFuncTable.h
INC += smartGDDPointer.h
-INC += gddApps.h
INC += gddEnumStringTable.h
+# Can't put this in INC, it causes a circular build dependency
+TARGETS += $(INSTALL_INCLUDE)/gddApps.h
+
HTMLS += gdd.html
HTMLS += gddref.html
HTMLS += gddref2.html
From ca9ef80760137796b03f202d2ab7add0a5cc471a Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Thu, 10 Apr 2014 12:35:47 -0500
Subject: [PATCH 04/18] configure: Cancel GNUMake built-in compiler rules
Their rules don't have our _INC dependencies, and were
being used in the gdd build (with no -I paths).
---
configure/RULES_BUILD | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index 4f622e182..36e21f547 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -195,6 +195,12 @@ $(OBJLIBNAME):%$(OBJ):
@$(RM) $@
$(COMPILE.ctdt) $<
+# Cancel GNUMake's built-in rules, which don't have our _INC
+# dependencies so could get used in some circumstances (gdd)
+%.o : %.c
+%.o : %.cc
+%.o : %.cpp
+
%$(OBJ): %.c $(COMMON_INC) $(INSTALL_INC)
@$(HDEPENDS_CMD)
@$(RM) $@
From 2efb1d037393aeeaa2d1dbff7cf240ac661fa704 Mon Sep 17 00:00:00 2001
From: Janet Anderson
Date: Mon, 14 Apr 2014 15:00:37 -0500
Subject: [PATCH 05/18] mkmf.pl needs -I prefix on include directories.
---
configure/CONFIG_COMMON | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON
index d465532ac..6b31eea37 100644
--- a/configure/CONFIG_COMMON
+++ b/configure/CONFIG_COMMON
@@ -323,8 +323,7 @@ PREPROCESS.cpp = $(CPP) $(CPPFLAGS) $(INCLUDES) $< > $@
HDEPENDS = YES
HDEPENDS_METHOD = CMD
-HDEPENDS_INCLUDES = $(subst -I,,$(INCLUDES))
-HDEPENDSFLAGS = -m $*$(DEP) $(HDEPENDS_INCLUDES) $@ $<
+HDEPENDSFLAGS = -m $*$(DEP) $(INCLUDES) $@ $<
HDEPENDSCMD = -$(MKMF) $(HDEPENDS_FLAGS) $(HDEPENDSFLAGS)
HDEPENDS_CMD_NO = $(ECHO) ""
From 3019a5fb07c7918c90cfa5ee1f917b4bd5484f28 Mon Sep 17 00:00:00 2001
From: Janet Anderson
Date: Mon, 14 Apr 2014 15:09:59 -0500
Subject: [PATCH 06/18] mkmf.pl needs -I prefix on include directories.
---
configure/os/CONFIG.win32-x86-borland.win32-x86-borland | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure/os/CONFIG.win32-x86-borland.win32-x86-borland b/configure/os/CONFIG.win32-x86-borland.win32-x86-borland
index 5be025f73..9500fc949 100644
--- a/configure/os/CONFIG.win32-x86-borland.win32-x86-borland
+++ b/configure/os/CONFIG.win32-x86-borland.win32-x86-borland
@@ -261,7 +261,7 @@ LINK.cpp += , $@ ,,$(LINKLIBS) $(subst /,\\,$(PROD_LDLIBS))
#--------------------------------------------------
# override of CONFIG_COMMON
-HDEPENDS_INCLUDES_MKMF = $(filter-out $(BORLAND_INC),$(subst -I,,$(INCLUDES)))
+HDEPENDS_INCLUDES_MKMF = $(filter-out $(addprefix -I,$(BORLAND_INC)),$(INCLUDES))
TDS = $(addsuffix .tds,$(basename $(PROD) $(TESTPROD) $(BUILD_LIBRARY)))
From 9170d79ffe888cbc7e55cac599f9f1a85db27e92 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 25 Apr 2014 14:08:25 -0500
Subject: [PATCH 07/18] libCom/test: isinf() and isnan() want doubles
This apparently becomes important in a newer GCC version.
---
src/libCom/test/epicsCalcTest.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libCom/test/epicsCalcTest.cpp b/src/libCom/test/epicsCalcTest.cpp
index 12bc585f0..d7836a338 100644
--- a/src/libCom/test/epicsCalcTest.cpp
+++ b/src/libCom/test/epicsCalcTest.cpp
@@ -311,7 +311,7 @@ MAIN(epicsCalcTest)
testExpr(exp(1.));
testExpr(floor(1.5));
- testExpr(finite(0));
+ testExpr(finite(0.));
testExpr(finite(Inf));
testExpr(finite(-Inf));
testExpr(finite(NaN));
@@ -325,11 +325,11 @@ MAIN(epicsCalcTest)
testCalc("finite(0,1,-Inf)", 0);
testCalc("finite(0,-Inf,2)", 0);
testCalc("finite(-Inf,1,2)", 0);
- testExpr(isinf(0));
+ testExpr(isinf(0.));
testExpr(isinf(Inf));
testExpr(!!isinf(-Inf)); // Some GCCs return -1/0/+1 rather than 0/+1
testExpr(isinf(NaN));
- testExpr(isnan(0));
+ testExpr(isnan(0.));
testExpr(isnan(Inf));
testExpr(isnan(-Inf));
testExpr(isnan(NaN));
From 2b7781c8d9044c19e93645da81ad45e5994cf3b0 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Fri, 25 Apr 2014 16:51:28 -0500
Subject: [PATCH 08/18] Support for Solaris 11 on x86 and SPARC.
Thanks to Bob Soliday for the necessary changes.
---
configure/os/CONFIG.Common.solaris-sparc | 1 -
configure/os/CONFIG.Common.solaris-x86 | 2 +-
configure/os/CONFIG.Common.solaris-x86-gnu | 1 +
configure/os/CONFIG.solarisCommon.solarisCommon | 3 ++-
configure/os/CONFIG_SITE.Common.solaris-sparc | 9 +++++----
configure/os/CONFIG_SITE.Common.solaris-x86 | 11 +++++++++++
configure/os/CONFIG_SITE.Common.solaris-x86_64 | 2 +-
configure/os/CONFIG_SITE.solaris-sparc.Common | 3 ---
documentation/RELEASE_NOTES.html | 8 ++++++++
src/libCom/osi/os/solaris/epicsMath.h | 4 ++++
10 files changed, 33 insertions(+), 11 deletions(-)
create mode 100644 configure/os/CONFIG_SITE.Common.solaris-x86
diff --git a/configure/os/CONFIG.Common.solaris-sparc b/configure/os/CONFIG.Common.solaris-sparc
index d47a5165e..6f43ae4fa 100644
--- a/configure/os/CONFIG.Common.solaris-sparc
+++ b/configure/os/CONFIG.Common.solaris-sparc
@@ -21,7 +21,6 @@ COMPILER_LDFLAGS += -mt
SOLARIS_VERSION = $(subst 5.,,$(shell uname -r))
POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=199506L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION))
-POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500
POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION))
OP_SYS_CPPFLAGS += -DSOLARIS=$(SOLARIS_VERSION) $(COMPILER_CPPFLAGS)
diff --git a/configure/os/CONFIG.Common.solaris-x86 b/configure/os/CONFIG.Common.solaris-x86
index d19083422..6dc67fb5d 100644
--- a/configure/os/CONFIG.Common.solaris-x86
+++ b/configure/os/CONFIG.Common.solaris-x86
@@ -21,7 +21,6 @@ COMPILER_LDFLAGS += -mt
SOLARIS_VERSION = $(subst 5.,,$(shell uname -r))
POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=199506L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION))
-POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500
POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION))
OP_SYS_CPPFLAGS += -DSOLARIS=$(SOLARIS_VERSION) $(COMPILER_CPPFLAGS)
@@ -53,6 +52,7 @@ OP_SYS_LDLIBS += -lsocket -lnsl
OP_SYS_LDLIBS_8 += -ldl -lCrun -lc
OP_SYS_LDLIBS_9 += -ldl -lCrun -lc
OP_SYS_LDLIBS_10 += -lCrun -lc
+OP_SYS_LDLIBS_11 += -lCrun -lc
OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_$(SOLARIS_VERSION))
OP_SYS_LDLIBS += $(STLPORT_LDLIBS_$(USE_STLPORT))
diff --git a/configure/os/CONFIG.Common.solaris-x86-gnu b/configure/os/CONFIG.Common.solaris-x86-gnu
index ce4fae0ad..25a63edbe 100644
--- a/configure/os/CONFIG.Common.solaris-x86-gnu
+++ b/configure/os/CONFIG.Common.solaris-x86-gnu
@@ -17,4 +17,5 @@ STLPORT_LDLIBS_NO =
OP_SYS_LDLIBS_8 = -ldl -lc
OP_SYS_LDLIBS_9 = -ldl -lc
OP_SYS_LDLIBS_10 = -lc
+OP_SYS_LDLIBS_11 = -lc
diff --git a/configure/os/CONFIG.solarisCommon.solarisCommon b/configure/os/CONFIG.solarisCommon.solarisCommon
index c38fc92d8..027124654 100644
--- a/configure/os/CONFIG.solarisCommon.solarisCommon
+++ b/configure/os/CONFIG.solarisCommon.solarisCommon
@@ -7,9 +7,10 @@
# Sites may override these definitions in CONFIG_SITE.solaris-sparc.solaris-sparc
#-------------------------------------------------------
-SPARCWORKS = /opt/SUNWspro
GNU = NO
+# SPARCWORKS path is set in a CONFIG_SITE file
+
CC = $(SPARCWORKS)/bin/cc
CCC = $(SPARCWORKS)/bin/CC
CPP = $(CC) -E -Qn
diff --git a/configure/os/CONFIG_SITE.Common.solaris-sparc b/configure/os/CONFIG_SITE.Common.solaris-sparc
index 95d9b42d2..851254203 100644
--- a/configure/os/CONFIG_SITE.Common.solaris-sparc
+++ b/configure/os/CONFIG_SITE.Common.solaris-sparc
@@ -5,11 +5,12 @@
# Site Specific definitions for solaris-sparc target
# Only the local epics system manager should modify this file
-# If readline is installed uncomment the following macro definition
-# to include command-line editing and history support
-#
+# location of the Solaris Studio (was SunPro) compilers
+SPARCWORKS = /opt/SUNWspro
+#SPARCWORKS = /opt/solarisstudio12.3
-# Readline library provides command-line editing and history in IOC shell
+# If readline is installed, uncomment the following macro definition
+# to use it for command-line editing and history support
#COMMANDLINE_LIBRARY = READLINE
# Use stLport library instead of default Cstd library
diff --git a/configure/os/CONFIG_SITE.Common.solaris-x86 b/configure/os/CONFIG_SITE.Common.solaris-x86
new file mode 100644
index 000000000..2a972d9cb
--- /dev/null
+++ b/configure/os/CONFIG_SITE.Common.solaris-x86
@@ -0,0 +1,11 @@
+# CONFIG_SITE.Common.solaris-x86
+#
+# $Revision-Id$
+#
+# Site Specific definitions for solaris-x86 targets
+# Only the local epics system manager should modify this file
+
+# location of the Solaris Studio (was SunPro) compilers
+SPARCWORKS = /opt/SUNWspro
+#SPARCWORKS = /opt/solarisstudio12.3
+
diff --git a/configure/os/CONFIG_SITE.Common.solaris-x86_64 b/configure/os/CONFIG_SITE.Common.solaris-x86_64
index 315b93597..ce173608d 100644
--- a/configure/os/CONFIG_SITE.Common.solaris-x86_64
+++ b/configure/os/CONFIG_SITE.Common.solaris-x86_64
@@ -5,7 +5,7 @@
# Site Specific definitions for solaris-x86_64 target
# Only the local epics system manager should modify this file
-# Include definitions common to all solaris-x86_64 target archs
+# Include definitions common to all solaris-x86 target archs
-include $(CONFIG)/os/CONFIG_SITE.Common.solaris-x86
COMMANDLINE_LIBRARY = EPICS
diff --git a/configure/os/CONFIG_SITE.solaris-sparc.Common b/configure/os/CONFIG_SITE.solaris-sparc.Common
index d78cdadda..a7398dbcf 100644
--- a/configure/os/CONFIG_SITE.solaris-sparc.Common
+++ b/configure/os/CONFIG_SITE.solaris-sparc.Common
@@ -4,7 +4,4 @@
#
# Site specific override definitions for solaris-sparc host builds
# Only the local epics system manager should modify this file
-
-#INSTALL_LOCATION = /home/phoebus/JBA/testBaseNew
-#CROSS_COMPILER_TARGET_ARCHS += vxWorks-ppc604 vxWorks-ppc603 vxWorks-68040
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index 021f0e432..f4912390e 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,14 @@
+Support for Solaris 11
+
+The build rules have been updated to support Solaris 11. Note that APS staff
+may not be able to maintain EPICS on Solaris for much longer, so the existing
+support code is likely to bit-rot and future versions of the OS may not be able
+to build or run EPICS applications unless someone else picks up the maintenance
+tasks.
+
Generating OS-specific include files
A fix has been applied to the build rules to permit OS-specific header files
diff --git a/src/libCom/osi/os/solaris/epicsMath.h b/src/libCom/osi/os/solaris/epicsMath.h
index 1cf60b5db..87d4986a7 100644
--- a/src/libCom/osi/os/solaris/epicsMath.h
+++ b/src/libCom/osi/os/solaris/epicsMath.h
@@ -17,6 +17,10 @@
/* same as (!isnan(x) && !finite(x)) */
#endif
+#ifndef isnan
+# define isnan(x) ((x) != (x))
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
From 6e01fd9c3d6af0cbbbeb59f47b6ed2ee86db10d3 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 30 Apr 2014 12:07:30 -0500
Subject: [PATCH 09/18] docs/cap5: Adjust link to CA Ref manual.
---
src/cap5/CA.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cap5/CA.pm b/src/cap5/CA.pm
index 31f09f9fb..48297162c 100644
--- a/src/cap5/CA.pm
+++ b/src/cap5/CA.pm
@@ -638,7 +638,7 @@ not follow this pattern, but are still printable strings.
=item [1] R3.14 Channel Access Reference Manual by Jeffrey O. Hill
-L
+L
=back
@@ -649,7 +649,7 @@ Andrew Johnson, Eanj@aps.anl.govE
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2008 UChicago Argonne LLC, as Operator of Argonne National
+Copyright (C) 2008-2014 UChicago Argonne LLC, as Operator of Argonne National
Laboratory.
This software is distributed under the terms of the EPICS Open License.
From 39b068cf0a33676c9a599a43290270153fb6f051 Mon Sep 17 00:00:00 2001
From: "Jeff Hill johill@lanl.gov"
Date: Thu, 5 Jun 2014 08:09:33 -0600
Subject: [PATCH 10/18] RTEMS support for Altera Nios2 arch
---
src/RTEMS/base/rtems_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/RTEMS/base/rtems_config.c b/src/RTEMS/base/rtems_config.c
index 70d3dd50f..ff5fb8128 100644
--- a/src/RTEMS/base/rtems_config.c
+++ b/src/RTEMS/base/rtems_config.c
@@ -63,7 +63,7 @@ rtems_task Init (rtems_task_argument argument);
* appropriate conditionals to use.
* The new general time support makes including the RTC driverr less important.
*/
-#if !defined(mpc604) && !defined(__mc68040__) && !defined(__mcf5200__) && !defined(mpc7455) && !defined(__arm__) /* don't have RTC code */
+#if !defined(mpc604) && !defined(__mc68040__) && !defined(__mcf5200__) && !defined(mpc7455) && !defined(__arm__) && !defined(__nios2__)/* don't have RTC code */
#define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
#endif
From aff46bd19a0cc7e6c1001271a42a6d8df97dda8f Mon Sep 17 00:00:00 2001
From: "Jeff Hill johill@lanl.gov"
Date: Thu, 5 Jun 2014 08:19:09 -0600
Subject: [PATCH 11/18] allow the NFS mount path to be embedded in the bootp
server name parameter, and therefore different from the NFS mount point
---
src/RTEMS/base/rtems_init.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c
index 65bbe39c7..a4b9fad00 100644
--- a/src/RTEMS/base/rtems_init.c
+++ b/src/RTEMS/base/rtems_init.c
@@ -284,6 +284,38 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem)
strncpy(mount_point, rtems_bsdnet_bootp_cmdline, l);
mount_point[l] = '\0';
argv[1] = rtems_bsdnet_bootp_cmdline;
+ /*
+ * Its probably common to embed the mount point in the server
+ * name so, when this is occurring, dont clobber the mount point
+ * by appending the first node from the command path. This allows
+ * the mount point to be a different path then the server's mount
+ * path.
+ *
+ * This allows for example a line similar to as follows the DHCP
+ * configuration file.
+ * server-name "300.300@192.168.0.123:/vol/vol0/bootRTEMS";
+ */
+ const size_t allocSize =
+ strlen ( rtems_bsdnet_bootp_server_name ) + 2;
+ char * const pServerName = mustMalloc( allocSize,
+ "NFS mount paths");
+ char * const pServerPath = mustMalloc ( allocSize,
+ "NFS mount paths");
+ const int scanfStatus = sscanf (
+ rtems_bsdnet_bootp_server_name,
+ "%[^:] : / %s",
+ pServerName,
+ pServerPath + 1 );
+ if ( scanfStatus == 2 ) {
+ pServerPath[0]= '/';
+ server_name = pServerName;
+ server_path = pServerPath;
+ }
+ else {
+ server_name = rtems_bsdnet_bootp_server_name;
+ free ( pServerName );
+ free ( pServerPath );
+ }
}
else {
char *abspath = mustMalloc(strlen(rtems_bsdnet_bootp_cmdline)+2,"Absolute command path");
@@ -295,8 +327,8 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem)
strcpy(abspath, "/");
strcat(abspath, rtems_bsdnet_bootp_cmdline);
argv[1] = abspath;
+ server_name = rtems_bsdnet_bootp_server_name;
}
- server_name = rtems_bsdnet_bootp_server_name;
}
nfsMount(server_name, server_path, mount_point);
#endif
From ba6a32fefb5e2da9bc057055a19bb205487c30a8 Mon Sep 17 00:00:00 2001
From: "Jeff Hill johill@lanl.gov"
Date: Tue, 10 Jun 2014 16:18:26 -0600
Subject: [PATCH 12/18] protect against situations where the server name isnt
specified at all in bootp/dhcp
---
src/RTEMS/base/rtems_init.c | 45 +++++++++++++++++++------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c
index a4b9fad00..e89006b51 100644
--- a/src/RTEMS/base/rtems_init.c
+++ b/src/RTEMS/base/rtems_init.c
@@ -279,6 +279,7 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem)
LogFatal("\"%s\" is not a valid command pathname.\n", rtems_bsdnet_bootp_cmdline);
cp = mustMalloc(l + 20, "NFS mount paths");
server_path = cp;
+ server_name = rtems_bsdnet_bootp_server_name;
if (rtems_bsdnet_bootp_cmdline[0] == '/') {
mount_point = server_path;
strncpy(mount_point, rtems_bsdnet_bootp_cmdline, l);
@@ -293,28 +294,29 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem)
*
* This allows for example a line similar to as follows the DHCP
* configuration file.
- * server-name "300.300@192.168.0.123:/vol/vol0/bootRTEMS";
+ *
+ * server-name "159.233@192.168.0.123:/vol/vol0/bootRTEMS";
*/
- const size_t allocSize =
- strlen ( rtems_bsdnet_bootp_server_name ) + 2;
- char * const pServerName = mustMalloc( allocSize,
- "NFS mount paths");
- char * const pServerPath = mustMalloc ( allocSize,
- "NFS mount paths");
- const int scanfStatus = sscanf (
- rtems_bsdnet_bootp_server_name,
- "%[^:] : / %s",
- pServerName,
- pServerPath + 1 );
- if ( scanfStatus == 2 ) {
- pServerPath[0]= '/';
- server_name = pServerName;
- server_path = pServerPath;
- }
- else {
- server_name = rtems_bsdnet_bootp_server_name;
- free ( pServerName );
- free ( pServerPath );
+ if ( server_name ) {
+ const size_t allocSize = strlen ( server_name ) + 2;
+ char * const pServerName = mustMalloc( allocSize,
+ "NFS mount paths");
+ char * const pServerPath = mustMalloc ( allocSize,
+ "NFS mount paths");
+ const int scanfStatus = sscanf (
+ server_name,
+ "%[^:] : / %s",
+ pServerName,
+ pServerPath + 1u );
+ if ( scanfStatus == 2 ) {
+ pServerPath[0u]= '/';
+ server_name = pServerName;
+ server_path = pServerPath;
+ }
+ else {
+ free ( pServerName );
+ free ( pServerPath );
+ }
}
}
else {
@@ -327,7 +329,6 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem)
strcpy(abspath, "/");
strcat(abspath, rtems_bsdnet_bootp_cmdline);
argv[1] = abspath;
- server_name = rtems_bsdnet_bootp_server_name;
}
}
nfsMount(server_name, server_path, mount_point);
From e374ee4658bc3c7b56d99b17418654065967eca6 Mon Sep 17 00:00:00 2001
From: "Jeff Hill johill@lanl.gov"
Date: Tue, 10 Jun 2014 22:37:21 -0600
Subject: [PATCH 13/18] patched this code to force alignment of the if request
structure, which appears to be required to avoid exceptions on RTEMS with cpu
architectures that detect use of misaligned addresses
---
src/libCom/osi/os/default/osdNetIntf.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/libCom/osi/os/default/osdNetIntf.c b/src/libCom/osi/os/default/osdNetIntf.c
index 1b38ce7cf..ab36fdf10 100644
--- a/src/libCom/osi/os/default/osdNetIntf.c
+++ b/src/libCom/osi/os/default/osdNetIntf.c
@@ -281,39 +281,45 @@ epicsShareFunc osiSockAddr epicsShareAPI osiLocalAddr (SOCKET socket)
for ( pifreq = ifconf.ifc_req; pifreq <= pIfreqListEnd; pifreq = pnextifreq ) {
osiSockAddr addrCpy;
+ uint32_t current_ifreqsize;
/*
* find the next if req
*/
pnextifreq = ifreqNext ( pifreq );
- if ( pifreq->ifr_addr.sa_family != AF_INET ) {
- ifDepenDebugPrintf ( ("osiLocalAddr(): interface %s was not AF_INET\n", pifreq->ifr_name) );
+ /* determine ifreq size */
+ current_ifreqsize = ifreqSize ( pifreq );
+ /* copy current ifreq to aligned bufferspace (to start of pIfreqList buffer) */
+ memmove(pIfreqList, pifreq, current_ifreqsize);
+
+ if ( pIfreqList->ifr_addr.sa_family != AF_INET ) {
+ ifDepenDebugPrintf ( ("osiLocalAddr(): interface %s was not AF_INET\n", pIfreqList->ifr_name) );
continue;
}
- addrCpy.sa = pifreq->ifr_addr;
+ addrCpy.sa = pIfreqList->ifr_addr;
- status = socket_ioctl ( socket, SIOCGIFFLAGS, pifreq );
+ status = socket_ioctl ( socket, SIOCGIFFLAGS, pIfreqList );
if ( status < 0 ) {
- errlogPrintf ( "osiLocalAddr(): net intf flags fetch for %s failed\n", pifreq->ifr_name );
+ errlogPrintf ( "osiLocalAddr(): net intf flags fetch for %s failed\n", pIfreqList->ifr_name );
continue;
}
- if ( ! ( pifreq->ifr_flags & IFF_UP ) ) {
- ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s was down\n", pifreq->ifr_name) );
+ if ( ! ( pIfreqList->ifr_flags & IFF_UP ) ) {
+ ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s was down\n", pIfreqList->ifr_name) );
continue;
}
/*
* dont use the loop back interface
*/
- if ( pifreq->ifr_flags & IFF_LOOPBACK ) {
- ifDepenDebugPrintf ( ("osiLocalAddr(): ignoring loopback interface: %s\n", pifreq->ifr_name) );
+ if ( pIfreqList->ifr_flags & IFF_LOOPBACK ) {
+ ifDepenDebugPrintf ( ("osiLocalAddr(): ignoring loopback interface: %s\n", pIfreqList->ifr_name) );
continue;
}
- ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s found\n", pifreq->ifr_name) );
+ ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s found\n", pIfreqList->ifr_name) );
init = 1;
addr = addrCpy;
From 2bf6d88607351d969fad8da509a7383f6859bdec Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Tue, 1 Jul 2014 10:55:52 -0500
Subject: [PATCH 14/18] templates: Quote path names in st.cmd files, permits
spaces
Request from Eric Norum.
---
src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common | 4 ++--
src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common
index da313e14a..b3269ff97 100644
--- a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common
+++ b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common
@@ -5,7 +5,7 @@
< envPaths
-cd ${TOP}
+cd "${TOP}"
## Register all support components
dbLoadDatabase "dbd/_APPNAME_.dbd"
@@ -21,7 +21,7 @@ dbLoadRecords "db/dbSubExample.db", "user=_USER_Host"
## Run this to trace the stages of iocInit
#traceIocInit
-cd ${TOP}/iocBoot/${IOC}
+cd "${TOP}/iocBoot/${IOC}"
iocInit
## Start any sequence programs
diff --git a/src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common b/src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common
index 68cb61934..521a1007e 100644
--- a/src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common
+++ b/src/makeBaseApp/top/iocBoot/ioc/st.cmd@Common
@@ -5,7 +5,7 @@
< envPaths
-cd ${TOP}
+cd "${TOP}"
## Register all support components
dbLoadDatabase "dbd/_APPNAME_.dbd"
@@ -14,7 +14,7 @@ _CSAFEAPPNAME__registerRecordDeviceDriver pdbbase
## Load record instances
#dbLoadRecords("db/xxx.db","user=_USER_Host")
-cd ${TOP}/iocBoot/${IOC}
+cd "${TOP}/iocBoot/${IOC}"
iocInit
## Start any sequence programs
From 152e8865cc61248de955cc571fac925e059b15c8 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Mon, 28 Jul 2014 11:38:30 -0500
Subject: [PATCH 15/18] Cleaned up exampleApp Makefiles
---
src/makeBaseApp/top/exampleApp/Db/Makefile | 13 ++-------
src/makeBaseApp/top/exampleApp/src/Makefile | 32 +++++++++------------
2 files changed, 17 insertions(+), 28 deletions(-)
diff --git a/src/makeBaseApp/top/exampleApp/Db/Makefile b/src/makeBaseApp/top/exampleApp/Db/Makefile
index c285af85a..7ce990f8c 100644
--- a/src/makeBaseApp/top/exampleApp/Db/Makefile
+++ b/src/makeBaseApp/top/exampleApp/Db/Makefile
@@ -1,26 +1,19 @@
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
-# ADD MACRO DEFINITIONS AFTER THIS LINE
+# ADD MACRO DEFINITIONS BELOW HERE
-#----------------------------------------------------
-# Optimization of db files using dbst (DEFAULT: NO)
-#DB_OPT = YES
-
-#----------------------------------------------------
-# Create and install (or just install)
-# databases, templates, substitutions like this
+# Install databases, templates & substitutions like this
DB += dbExample1.db
DB += dbExample2.db
DB += dbSubExample.db
DB += user.substitutions
DB += userHost.substitutions
-#----------------------------------------------------
# If .db template is not named *.template add
# _TEMPLATE =
include $(TOP)/configure/RULES
#----------------------------------------
-# ADD RULES AFTER THIS LINE
+# ADD EXTRA GNUMAKE RULES BELOW HERE
diff --git a/src/makeBaseApp/top/exampleApp/src/Makefile b/src/makeBaseApp/top/exampleApp/src/Makefile
index 243cd926f..f3b262c77 100644
--- a/src/makeBaseApp/top/exampleApp/src/Makefile
+++ b/src/makeBaseApp/top/exampleApp/src/Makefile
@@ -2,38 +2,37 @@ TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
-# ADD MACRO DEFINITIONS AFTER THIS LINE
-
-#=============================
-# Build the IOC support library
-
-LIBRARY_IOC += _APPNAME_Support
+# ADD MACRO DEFINITIONS BELOW HERE
# xxxRecord.h will be created from xxxRecord.dbd
DBDINC += xxxRecord
-# Install devXxxSoft.dbd into /dbd
+
+# Install xxxSupport.dbd into /dbd
DBD += xxxSupport.dbd
+# Build an IOC support library
+LIBRARY_IOC += _APPNAME_Support
+
# Compile and add the code to the support library
_APPNAME_Support_SRCS += xxxRecord.c
_APPNAME_Support_SRCS += devXxxSoft.c
# Link locally-provided code into the support library,
# rather than directly into the IOC application.
+# This is required for Windows DLL builds.
_APPNAME_Support_SRCS += dbSubExample.c
_APPNAME_Support_SRCS += _APPNAME_Hello.c
_APPNAME_Support_SRCS += initTrace.c
_APPNAME_Support_LIBS += $(EPICS_BASE_IOC_LIBS)
-#=============================
# 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 will include these files:
_APPNAME__DBD += base.dbd
_APPNAME__DBD += xxxSupport.dbd
_APPNAME__DBD += dbSubExample.dbd
@@ -43,19 +42,18 @@ _APPNAME__DBD += initTrace.dbd
# _APPNAME__registerRecordDeviceDriver.cpp derives from _APPNAME_.dbd
_APPNAME__SRCS += _APPNAME__registerRecordDeviceDriver.cpp
-# Build the main IOC entry point on workstation OSs.
+# Build the main IOC entry point where needed
_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
-# Link in the code from the support library
+# Link in the code from our support library
_APPNAME__LIBS += _APPNAME_Support
-# NOTE: To build SNL programs, SNCSEQ must be defined
+# To build SNL programs, SNCSEQ must be defined
# in the /configure/RELEASE file
-
ifneq ($(SNCSEQ),)
# Build sncExample into _APPNAME_Support
sncExample_SNCFLAGS += +r
@@ -72,12 +70,10 @@ ifneq ($(SNCSEQ),)
sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif
-# Finally link to the EPICS Base libraries
+# Finally link IOC to the EPICS Base libraries
_APPNAME__LIBS += $(EPICS_BASE_IOC_LIBS)
-#=============================
-
include $(TOP)/configure/RULES
#----------------------------------------
-# ADD RULES AFTER THIS LINE
+# ADD EXTRA GNUMAKE RULES BELOW HERE
From a5fe64a8adf8031377516b195b97f459f83b5763 Mon Sep 17 00:00:00 2001
From: Ralph Lange
Date: Fri, 1 Aug 2014 17:20:55 +0200
Subject: [PATCH 16/18] dev, rec: Fix smoothing for NaN/+inf/-inf values in ai
record and soft support
---
src/dev/softDev/devAiSoft.c | 3 ++-
src/rec/aiRecord.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/dev/softDev/devAiSoft.c b/src/dev/softDev/devAiSoft.c
index e3eade8a7..77ee6dbed 100644
--- a/src/dev/softDev/devAiSoft.c
+++ b/src/dev/softDev/devAiSoft.c
@@ -20,6 +20,7 @@
#include "alarm.h"
#include "dbDefs.h"
#include "dbAccess.h"
+#include "epicsMath.h"
#include "recGbl.h"
#include "devSup.h"
#include "aiRecord.h"
@@ -78,7 +79,7 @@ static long read_ai(aiRecord *prec)
if (!dbGetLink(&prec->inp, DBR_DOUBLE, &val, 0, 0)) {
/* Apply smoothing algorithm */
- if (prec->smoo != 0.0 && prec->dpvt)
+ if (prec->smoo != 0.0 && prec->dpvt && finite(prec->val))
prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo);
else
prec->val = val;
diff --git a/src/rec/aiRecord.c b/src/rec/aiRecord.c
index 57ea32163..f0fd07670 100644
--- a/src/rec/aiRecord.c
+++ b/src/rec/aiRecord.c
@@ -367,7 +367,7 @@ static void convert(aiRecord *prec)
}
/* apply smoothing algorithm */
- if (prec->smoo != 0.0){
+ if (prec->smoo != 0.0 && finite(prec->val)){
if (prec->init) prec->val = val; /* initial condition */
prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo);
}else{
From 02afb98f38b9c6915a79624e829394b8eb351144 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 17 Sep 2014 10:21:07 -0500
Subject: [PATCH 17/18] Reject NULL callback functions in ca_array_*_callback
Fixes lp:1369626
---
documentation/RELEASE_NOTES.html | 9 +++++++++
src/ca/getCallback.cpp | 4 ++--
src/ca/oldChannelNotify.cpp | 6 ++++++
src/ca/putCallback.cpp | 4 ++--
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html
index f4912390e..3d8747947 100644
--- a/documentation/RELEASE_NOTES.html
+++ b/documentation/RELEASE_NOTES.html
@@ -13,6 +13,15 @@
+Reject NULL callback functions in ca_array_*_callback
+
+The two CA routines ca_array_get_callback() and ca_array_put_callback() were
+not checking the pfunc callback function argument for NULL. Passing in a NULL
+would cause the client library to segfault when the callback was called. Doing
+this will now result in the error status ECA_BADFUNCPTR being returned. This
+chage fixes Launchpad bug
+1369626.
+
Support for Solaris 11
The build rules have been updated to support Solaris 11. Note that APS staff
diff --git a/src/ca/getCallback.cpp b/src/ca/getCallback.cpp
index 05e654e30..0fc050043 100644
--- a/src/ca/getCallback.cpp
+++ b/src/ca/getCallback.cpp
@@ -57,9 +57,9 @@ void getCallback::completion (
// fetch client context and destroy prior to releasing
// the lock and calling cb in case they destroy channel there
this->chan.getClientCtx().destroyGetCallback ( guard, *this );
- {
+ if ( pFuncTmp ) {
epicsGuardRelease < epicsMutex > unguard ( guard );
- ( *pFuncTmp ) ( args );
+ pFuncTmp ( args );
}
}
diff --git a/src/ca/oldChannelNotify.cpp b/src/ca/oldChannelNotify.cpp
index 289c4e8b4..1a63f8273 100644
--- a/src/ca/oldChannelNotify.cpp
+++ b/src/ca/oldChannelNotify.cpp
@@ -343,6 +343,9 @@ int epicsShareAPI ca_array_get_callback ( chtype type,
if ( type < 0 ) {
return ECA_BADTYPE;
}
+ if ( pfunc == NULL ) {
+ return ECA_BADFUNCPTR;
+ }
unsigned tmpType = static_cast < unsigned > ( type );
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -416,6 +419,9 @@ int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
if ( type < 0 ) {
return ECA_BADTYPE;
}
+ if ( pfunc == NULL ) {
+ return ECA_BADFUNCPTR;
+ }
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
pChan->eliminateExcessiveSendBacklog ( guard );
unsigned tmpType = static_cast < unsigned > ( type );
diff --git a/src/ca/putCallback.cpp b/src/ca/putCallback.cpp
index ba17a654c..85fcaeb7f 100644
--- a/src/ca/putCallback.cpp
+++ b/src/ca/putCallback.cpp
@@ -57,9 +57,9 @@ void putCallback::completion ( epicsGuard < epicsMutex > & guard )
// fetch client context and destroy prior to releasing
// the lock and calling cb in case they destroy channel there
this->chan.getClientCtx().destroyPutCallback ( guard, *this );
- {
+ if ( pFuncTmp ) {
epicsGuardRelease < epicsMutex > unguard ( guard );
- ( *pFuncTmp ) ( args );
+ pFuncTmp ( args );
}
}
From e1eac6657d090c48e5834793c76c0ce99f9d69c8 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
Date: Wed, 24 Sep 2014 16:53:44 -0500
Subject: [PATCH 18/18] confiugre: Update the vxWorks Intel build
configurations
Wind River changed from cc386 to ccpentium many years ago.
---
configure/os/CONFIG.Common.vxWorks-486 | 11 +++++------
configure/os/CONFIG.Common.vxWorks-pentium | 16 +++++++++-------
2 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/configure/os/CONFIG.Common.vxWorks-486 b/configure/os/CONFIG.Common.vxWorks-486
index a849735ce..b048a2be4 100644
--- a/configure/os/CONFIG.Common.vxWorks-486
+++ b/configure/os/CONFIG.Common.vxWorks-486
@@ -11,14 +11,13 @@
include $(CONFIG)/os/CONFIG.Common.vxWorksCommon
# Vx GNU cross compiler suffix
-CMPLR_SUFFIX = 386
+CMPLR_SUFFIX = pentium
-ARCH_CLASS = pc486
+ARCH_CLASS = x86
-ARCH_DEP_CPPFLAGS = -DCPU=I80486 -D_X86_
-ARCH_DEP_CFLAGS = -m486
-ARCH_DEP_CXXFLAGS += -x 'c++'
-ARCH_DEP_CFLAGS += -fno-defer-pop
+ARCH_DEP_CPPFLAGS = -DCPU=I80486 -D_X86_
+ARCH_DEP_CFLAGS = -mtune=i486 -march=i486
+ARCH_DEP_CFLAGS += -fno-zero-initialized-in-bss -fno-defer-pop
# Allow site overrides
-include $(CONFIG)/os/CONFIG_SITE.Common.vxWorks-486
diff --git a/configure/os/CONFIG.Common.vxWorks-pentium b/configure/os/CONFIG.Common.vxWorks-pentium
index 324682a97..abec33c6a 100644
--- a/configure/os/CONFIG.Common.vxWorks-pentium
+++ b/configure/os/CONFIG.Common.vxWorks-pentium
@@ -11,12 +11,14 @@
include $(CONFIG)/os/CONFIG.Common.vxWorksCommon
# Vx GNU cross compiler suffix
-CMPLR_SUFFIX = 386
-
-ARCH_CLASS = pcPentium
+CMPLR_SUFFIX = pentium
-ARCH_DEP_CPPFLAGS = -DCPU=PENTIUM -D_X86_
-ARCH_DEP_CFLAGS = -mpentium
-ARCH_DEP_CXXFLAGS += -x 'c++'
-ARCH_DEP_CFLAGS += -fno-defer-pop
+ARCH_CLASS = x86
+
+ARCH_DEP_CPPFLAGS = -DCPU=PENTIUM -D_X86_
+ARCH_DEP_CFLAGS = -mtune=pentium -march=pentium
+ARCH_DEP_CFLAGS += -fno-zero-initialized-in-bss -fno-defer-pop
+
+# Allow site overrides
+-include $(CONFIG)/os/CONFIG_SITE.Common.vxWorks-pentium