diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 9eedc6b7a..d5353a474 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -147,7 +147,7 @@ CROSS_WARN=YES # Use POSIX thread priority scheduling (if available). # Must be either YES or NO -USE_POSIX_THREAD_PRIORITY_SCHEDULING = NO +USE_POSIX_THREAD_PRIORITY_SCHEDULING = YES # Site version number, if set will append '-' and this string to the # EPICS version number string that is reported by many tools. diff --git a/documentation/README.1st b/documentation/README.1st index fccb14f35..effafe36d 100644 --- a/documentation/README.1st +++ b/documentation/README.1st @@ -1,6 +1,6 @@ Installation Instructions - EPICS Base Release 3.15.1 + EPICS Base Release 3.15.1 -------------------------------------------------------------------------- @@ -102,13 +102,13 @@ later. GNU readline or Tecla library - GNU readline and Tecla librararies can be used by the IOC shell to - provide command line editing and command line history recall and edit. - GNU readline (or Tecla library) must be installed on your target system - when COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target. - EPICS (EPICS shell) is the default specified in CONFIG_COMMON. A - READLINE override is defined for linux-x86 in the EPICS distribution. - Comment out COMMANDLINE_LIBRARY=READLINE in + GNU readline and Tecla libraries can be used by the IOC shell to provide + command line editing and command line history recall and edit. GNU + readline (or Tecla library) must be installed on your target system when + COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target. EPICS + (EPICS shell) is the default specified in CONFIG_COMMON. A READLINE + override is defined for linux-x86 in the EPICS distribution. Comment out + COMMANDLINE_LIBRARY=READLINE in configure/os/CONFIG_SITE.Common.linux-x86 if readline is not installed on linux-x86. Command-line editing and history will then be those supplied by the os. On vxWorks the ledLib command-line input library is @@ -125,7 +125,7 @@ EPICS documentation is available through the EPICS website at Argonne. - Release specific documenataion can also be found in the + Release specific documentation can also be found in the base/documentation directory of the distribution. Directory Structure @@ -135,7 +135,7 @@ base Root directory of the base distribution base/configure Operating system independent build config files base/configure/os Operating system dependent build config files - base/documentation Distributation documentation + base/documentation Distribution documentation base/src Source code in various subdirectories base/startup Scripts for setting up path and environment @@ -156,7 +156,7 @@ Build related components - base/documentation/README* files + base/documentation directory - contains setup, build, and install documents README.1st Instructions for setup and building epics base README.html html version of README.1st @@ -185,7 +185,7 @@ CONFIG_COMMON Definitions common to all builds CONFIG_ENV Definitions of EPICS environment variables CONFIG_FILE_TYPE - CONFIG_SITE Site specific make defintions + CONFIG_SITE Site specific make definitions CONFIG_SITE_ENV Site defaults for EPICS environment variables MAKEFILE Installs CONFIG* RULES* creates RELEASE Location of external products diff --git a/documentation/README.html b/documentation/README.html index dc28fe29c..f5d51d7b0 100644 --- a/documentation/README.html +++ b/documentation/README.html @@ -107,7 +107,7 @@ For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or later.

GNU readline or Tecla library
- GNU readline and Tecla librararies can be used by the IOC shell to + GNU readline and Tecla libraries can be used by the IOC shell to provide command line editing and command line history recall and edit. GNU readline (or Tecla library) must be installed on your target system when COMMANDLINE_LIBRARY is set to READLINE (or TECLA) for that target. @@ -130,7 +130,7 @@

Documentation

EPICS documentation is available through the EPICS website at Argonne. -

Release specific documenataion can also be found in the base/documentation +

Release specific documentation can also be found in the base/documentation directory of the distribution.

Directory Structure

@@ -140,7 +140,7 @@ base Root directory of the base distribution base/configure Operating system independent build config files base/configure/os Operating system dependent build config files - base/documentation Distributation documentation + base/documentation Distribution documentation base/src Source code in various subdirectories base/startup Scripts for setting up path and environment @@ -165,7 +165,8 @@

Build related components

-

base/documentation/README* files

+

base/documentation directory - contains setup, build, and install + documents

         README.1st           Instructions for setup and building epics base
         README.html          html version of README.1st
@@ -196,7 +197,7 @@
         CONFIG_COMMON         Definitions common to all builds
         CONFIG_ENV            Definitions of EPICS environment variables
         CONFIG_FILE_TYPE      
-        CONFIG_SITE           Site specific make defintions
+        CONFIG_SITE           Site specific make definitions
         CONFIG_SITE_ENV       Site defaults for EPICS environment variables
         MAKEFILE              Installs CONFIG* RULES* creates
         RELEASE               Location of external products
diff --git a/src/ioc/db/dbAccess.c b/src/ioc/db/dbAccess.c
index 5c86678f7..5303b53b7 100644
--- a/src/ioc/db/dbAccess.c
+++ b/src/ioc/db/dbAccess.c
@@ -738,6 +738,11 @@ static long getLinkValue(DBADDR *paddr, short dbrType,
         if (nRequest && *nRequest > 1) *nRequest = 1;
         break;
 
+    case DBR_DOUBLE:    /* Needed for dbCa links */
+        if (nRequest && *nRequest) *nRequest = 1;
+        *(double *)pbuf = epicsNAN;
+        return 0;
+
     case DBR_CHAR:
     case DBR_UCHAR:
             if (nRequest && *nRequest > 0) {
diff --git a/src/ioc/db/dbCa.c b/src/ioc/db/dbCa.c
index e3ce5efac..c7beddeed 100644
--- a/src/ioc/db/dbCa.c
+++ b/src/ioc/db/dbCa.c
@@ -425,7 +425,7 @@ long dbCaPutLinkCallback(struct link *plink,short dbrType,
             plink->value.pv_link.pvlMask |= pvlOptOutNative;
  */
         }
-        if (nRequest == 1){
+        if (nRequest == 1 && pca->nelements==1){
             long (*fConvert)(const void *from, void *to, struct dbAddr *paddr);
 
             fConvert = dbFastPutConvertRoutine[dbrType][newType];
@@ -439,7 +439,13 @@ long dbCaPutLinkCallback(struct link *plink,short dbrType,
             dbAddr.pfield = pca->pputNative;
             /*Following only used for DBF_STRING*/
             dbAddr.field_size = MAX_STRING_SIZE;
+            if(nRequest>pca->nelements)
+                nRequest = pca->nelements;
             status = aConvert(&dbAddr, pbuffer, nRequest, pca->nelements, 0);
+            if(nRequestnelements) {
+                long elemsize = dbr_value_size[ca_field_type(pca->chid)];
+                memset(nRequest*elemsize+(char*)pca->pputNative, 0, (pca->nelements-nRequest)*elemsize);
+            }
         }
         link_action |= CA_WRITE_NATIVE;
         pca->gotOutNative = TRUE;
diff --git a/src/ioc/dbStatic/dbYacc.y b/src/ioc/dbStatic/dbYacc.y
index 858e666d3..0f0c757fe 100644
--- a/src/ioc/dbStatic/dbYacc.y
+++ b/src/ioc/dbStatic/dbYacc.y
@@ -271,12 +271,14 @@ alias: tokenALIAS '(' tokenSTRING ',' tokenSTRING ')'
 static int yyerror(char *str)
 {
     if (str)
-        epicsPrintf("Error: %s\n   ", str);
+        epicsPrintf("Error: %s\n", str);
     else
         epicsPrintf("Error");
-    epicsPrintf(" at or before \"%s\"", yytext);
-    dbIncludePrint();
-    yyFailed = TRUE;
+    if (!yyFailed) {    /* Only print this stuff once */
+        epicsPrintf(" at or before \"%s\"", yytext);
+        dbIncludePrint();
+        yyFailed = TRUE;
+    }
     return(0);
 }
 static long pvt_yy_parse(void)
diff --git a/src/libCom/cxxTemplates/epicsSingleton.h b/src/libCom/cxxTemplates/epicsSingleton.h
index b97c82b8c..cece8007c 100644
--- a/src/libCom/cxxTemplates/epicsSingleton.h
+++ b/src/libCom/cxxTemplates/epicsSingleton.h
@@ -19,6 +19,7 @@
 #define epicsSingleton_h
 
 #include 
+#include 
 
 #include "shareLib.h"
 #include "epicsAssert.h"
diff --git a/src/libCom/osi/os/posix/osdThread.c b/src/libCom/osi/os/posix/osdThread.c
index 613c3456c..8e0b30472 100644
--- a/src/libCom/osi/os/posix/osdThread.c
+++ b/src/libCom/osi/os/posix/osdThread.c
@@ -64,12 +64,14 @@ typedef struct commonAttr{
     int                maxPriority;
     int                minPriority;
     int                schedPolicy;
+    int                usePolicy;
 } commonAttr;
 
 #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
 typedef struct {
     int min_pri, max_pri;
     int policy;
+    int ok;
 } priAvailable;
 #endif
 
@@ -132,6 +134,8 @@ static void setSchedulingPolicy(epicsThreadOSD *pthreadInfo,int policy)
 #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
     int status;
 
+    if(!pcommonAttr->usePolicy) return;
+
     status = pthread_attr_getschedparam(
         &pthreadInfo->attr,&pthreadInfo->schedParam);
     checkStatusOnce(status,"pthread_attr_getschedparam");
@@ -281,6 +285,7 @@ int           low, try;
 
     prm->min_pri = min;
     prm->max_pri = try_pri(max, prm->policy) ? max-1 : max;
+    prm->ok = 1;
 
     return 0;
 }
@@ -293,6 +298,7 @@ void         *dummy;
 int          status;
 
     arg.policy = a_p->schedPolicy;
+    arg.ok = 0;
 
     status = pthread_create(&id, 0, find_pri_range, &arg);
     checkStatusQuit(status, "pthread_create","epicsThreadInit");
@@ -302,6 +308,7 @@ int          status;
 
     a_p->minPriority = arg.min_pri;
     a_p->maxPriority = arg.max_pri;
+    a_p->usePolicy = arg.ok;
 }
 #endif
 
@@ -627,7 +634,8 @@ epicsShareFunc void epicsShareAPI epicsThreadSetPriority(epicsThreadId pthreadIn
     pthreadInfo->osiPriority = priority;
     if(!pthreadInfo->isRealTimeScheduled) return;
 
-#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && _POSIX_THREAD_PRIORITY_SCHEDULING > 0
+#if defined (_POSIX_THREAD_PRIORITY_SCHEDULING)
+    if(!pcommonAttr->usePolicy) return;
     pthreadInfo->schedParam.sched_priority = epicsThreadGetPosixPriority(pthreadInfo);
     status = pthread_attr_setschedparam(
         &pthreadInfo->attr,&pthreadInfo->schedParam);
diff --git a/src/libCom/test/epicsTimerTest.cpp b/src/libCom/test/epicsTimerTest.cpp
index a4ab9cccc..96f1a78cd 100644
--- a/src/libCom/test/epicsTimerTest.cpp
+++ b/src/libCom/test/epicsTimerTest.cpp
@@ -29,6 +29,41 @@
 #define verify(exp) ((exp) ? (void)0 : \
     epicsAssert(__FILE__, __LINE__, #exp, epicsAssertAuthor))
 
+class notified : public epicsTimerNotify
+{
+public:
+    bool done;
+    notified() : epicsTimerNotify(), done(false) {}
+
+    expireStatus expire(const epicsTime ¤tTime)
+    {done=true; return expireStatus(noRestart);}
+};
+
+void testRefCount()
+{
+    notified action;
+
+    epicsTimerQueueActive *Q1, *Q2;
+    epicsTimer *T1, *T2;
+
+    Q1 = &epicsTimerQueueActive::allocate ( true, epicsThreadPriorityMin );
+
+    T1 = &Q1->createTimer();
+    //timer->start(action, 0.0);
+
+    Q2 = &epicsTimerQueueActive::allocate ( true, epicsThreadPriorityMin );
+
+    testOk1(Q1==Q2);
+
+    T2 = &Q2->createTimer();
+
+    T2->destroy();
+    Q2->release();
+
+    T1->destroy();
+    Q1->release();
+}
+
 static const double delayVerifyOffset = 1.0; // sec 
 
 class delayVerify : public epicsTimerNotify {
@@ -419,7 +454,8 @@ void testPeriodic ()
 
 MAIN(epicsTimerTest)
 {
-    testPlan(40);
+    testPlan(41);
+    testRefCount();
     testAccuracy ();
     testCancel ();
     testExpireDestroy ();
diff --git a/src/tools/dbdToRecordtypeH.pl b/src/tools/dbdToRecordtypeH.pl
index d4140cc87..06c3b565e 100755
--- a/src/tools/dbdToRecordtypeH.pl
+++ b/src/tools/dbdToRecordtypeH.pl
@@ -112,13 +112,16 @@ if ($opt_D) {   # Output dependencies only, to stdout
 
 sub oldtables {
     # Output compatible with R3.14.x
-    print OUTFILE "#ifdef __cplusplus\n" .
+    print OUTFILE
+        "#include \n" .
+        "#include \n" .
+        "#ifdef __cplusplus\n" .
         "extern \"C\" {\n" .
         "#endif\n" .
-        "#include \n" .
         "static int ${rn}RecordSizeOffset(dbRecordType *prt)\n" .
         "{\n" .
-        "    ${rn}Record *prec = 0;\n" .
+        "    ${rn}Record *prec = 0;\n\n" .
+        "    assert(prt->no_fields == " . scalar($rtyp->fields) . ");\n" .
         join("\n", map {
                 "    prt->papFldDes[${rn}Record" . $_->name . "]->size = " .
                 "sizeof(prec->" . $_->C_name . ");"