Merged changes from 3.14 branch up to revno 12540

This commit is contained in:
Andrew Johnson
2015-03-02 11:43:20 -06:00
10 changed files with 90 additions and 28 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -107,7 +107,7 @@
For RTEMS targets, you need RTEMS core and toolset version 4.9.2 or later.</P>
<P><B>GNU readline or Tecla library</B><BR>
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 @@
<H3><A NAME="0_0_8"> Documentation</A></H3>
<BLOCKQUOTE>EPICS documentation is available through the
<a href="http://www.aps.anl.gov/epics/">EPICS website</a> at Argonne.
<P>Release specific documenataion can also be found in the base/documentation
<P>Release specific documentation can also be found in the base/documentation
directory of the distribution.</BLOCKQUOTE>
<H3><A NAME="0_0_10"> Directory Structure</A></H3>
@@ -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
</PRE>
@@ -165,7 +165,8 @@
<H3><A NAME="0_0_11"> Build related components</A></H3>
<BLOCKQUOTE>
<H4>base/documentation/README* files</H4>
<H4>base/documentation directory - contains setup, build, and install
documents</H4>
<PRE>
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

View File

@@ -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) {

View File

@@ -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(nRequest<pca->nelements) {
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;

View File

@@ -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)

View File

@@ -19,6 +19,7 @@
#define epicsSingleton_h
#include <new>
#include <cstddef>
#include "shareLib.h"
#include "epicsAssert.h"

View File

@@ -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);

View File

@@ -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 &currentTime)
{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 ();

View File

@@ -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 <epicsAssert.h>\n" .
"#include <epicsExport.h>\n" .
"#ifdef __cplusplus\n" .
"extern \"C\" {\n" .
"#endif\n" .
"#include <epicsExport.h>\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 . ");"