Merged changes from 3.14 branch

Up to revno 12404.
This commit is contained in:
Andrew Johnson
2013-03-15 15:23:55 -05:00
29 changed files with 168 additions and 58 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
#######################################################################
#

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
use strict;

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
# This script is used to extract information about the Perl build
# configuration, so the EPICS build system uses the same settings.

View File

@@ -64,6 +64,9 @@ aitGen_CFLAGS_linux-arm = -O2
CLEANS += $(COMMON_DIR)/aitConvertGenerated.cc
USR_CXXFLAGS_Linux = -fno-strict-aliasing
USR_CXXFLAGS_RTEMS = -fno-strict-aliasing
include $(TOP)/configure/RULES
# Manual dependencies

View File

@@ -85,6 +85,7 @@ typedef struct scan_element{
typedef struct periodic_scan_list {
scan_list scan_list;
double period;
unsigned long overruns;
volatile enum ctl scanCtl;
epicsEventId loopEvent;
} periodic_scan_list;
@@ -350,7 +351,8 @@ int scanppl(double period) /* print periodic list */
ppsl = papPeriodic[i];
if (ppsl == NULL) continue;
if (period > 0.0 && (fabs(period - ppsl->period) >.05)) continue;
sprintf(message, "Scan Period = %g seconds ", ppsl->period);
sprintf(message, "Scan Period = %g seconds (%lu over-runs)",
ppsl->period, ppsl->overruns);
printList(&ppsl->scan_list, message);
}
return 0;
@@ -561,19 +563,47 @@ static void initOnce(void)
static void periodicTask(void *arg)
{
periodic_scan_list *ppsl = (periodic_scan_list *)arg;
epicsTimeStamp start_time, end_time;
double delay;
epicsTimeStamp next, reported;
unsigned int overruns = 0;
double report_delay = 10.0;
taskwdInsert(0, NULL, NULL);
epicsEventSignal(startStopEvent);
epicsTimeGetCurrent(&next);
reported = next;
while (ppsl->scanCtl != ctlExit) {
epicsTimeGetCurrent(&start_time);
if (ppsl->scanCtl == ctlRun) scanList(&ppsl->scan_list);
epicsTimeGetCurrent(&end_time);
delay = ppsl->period - epicsTimeDiffInSeconds(&end_time, &start_time);
if (delay <= 0.0) delay = 0.1;
double delay;
epicsTimeStamp now;
if (ppsl->scanCtl == ctlRun)
scanList(&ppsl->scan_list);
epicsTimeAddSeconds(&next, ppsl->period);
epicsTimeGetCurrent(&now);
delay = epicsTimeDiffInSeconds(&next, &now);
if (delay <= 0.0) {
delay = 0.1;
ppsl->overruns++;
next = now;
if (++overruns >= 10 &&
epicsTimeDiffInSeconds(&now, &reported) > report_delay) {
errlogPrintf("dbScan warning: %g second scan over-ran %u times\n",
ppsl->period, overruns);
reported = now;
if (report_delay < 1800.0)
report_delay *= 2;
else
report_delay = 3600.0; /* At most hourly */
}
}
else {
overruns = 0;
report_delay = 10.0;
}
epicsEventWaitWithTimeout(ppsl->loopEvent, delay);
}

View File

@@ -2054,6 +2054,15 @@ static int clear_channel_reply ( caHdrLargeArray *mp,
cas_commit_msg ( client, 0u );
SEND_UNLOCK(client);
/*
* remove from access control list
*/
status = asRemoveClient(&pciu->asClientPVT);
if(status != 0 && status != S_asLib_asNotActive){
errMessage(status, RECORD_NAME(pciu->dbch));
return RSRV_ERROR;
}
epicsMutexMustLock ( client->chanListLock );
if ( pciu->state == rsrvCS_inService ||
pciu->state == rsrvCS_pendConnectResp ) {
@@ -2073,15 +2082,6 @@ static int clear_channel_reply ( caHdrLargeArray *mp,
}
epicsMutexUnlock( client->chanListLock );
/*
* remove from access control list
*/
status = asRemoveClient(&pciu->asClientPVT);
if(status != 0 && status != S_asLib_asNotActive){
errMessage(status, RECORD_NAME(pciu->dbch));
return RSRV_ERROR;
}
LOCK_CLIENTQ;
status = bucketRemoveItemUnsignedId (pCaBucket, &pciu->sid);
if(status != S_bucket_success){

View File

@@ -0,0 +1,86 @@
/*************************************************************************\
* Copyright (c) 2013 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.
\*************************************************************************/
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <mach/mach.h>
#include <mach/clock.h>
#include "osiSock.h"
#define epicsExportSharedSymbols
#include "cantProceed.h"
#include "epicsTime.h"
#include "generalTimeSup.h"
static clock_serv_t host_clock;
extern "C" {
static int osdTimeGetCurrent (epicsTimeStamp *pDest)
{
mach_timespec_t mts;
struct timespec ts;
clock_get_time(host_clock, &mts);
ts.tv_sec = mts.tv_sec;
ts.tv_nsec = mts.tv_nsec;
*pDest = epicsTime(ts);
return epicsTimeOK;
}
} // extern "C"
static int timeRegister(void)
{
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &host_clock);
generalTimeCurrentTpRegister("MachTime", \
LAST_RESORT_PRIORITY, osdTimeGetCurrent);
return 1;
}
static int done = timeRegister();
int epicsTime_gmtime(const time_t *pAnsiTime, struct tm *pTM)
{
return gmtime_r(pAnsiTime, pTM) ?
epicsTimeOK : epicsTimeERROR;
}
int epicsTime_localtime(const time_t *clock, struct tm *result)
{
return localtime_r(clock, result) ?
epicsTimeOK : epicsTimeERROR;
}
extern "C" epicsShareFunc void
convertDoubleToWakeTime(double timeout, struct timespec *wakeTime)
{
mach_timespec_t now;
struct timespec wait;
clock_get_time(host_clock, &now);
if (timeout<0.0)
timeout = 0.0;
else if(timeout>3600.0)
timeout = 3600.0;
wait.tv_sec = static_cast< long >(timeout);
wait.tv_nsec = static_cast< long >((timeout - (double)wait.tv_sec) * 1e9);
wakeTime->tv_sec = now.tv_sec + wait.tv_sec;
wakeTime->tv_nsec = now.tv_nsec + wait.tv_nsec;
if (wakeTime->tv_nsec >= 1000000000L) {
wakeTime->tv_nsec -= 1000000000L;
++wakeTime->tv_sec;
}
}

View File

@@ -24,7 +24,7 @@
#define TIME_INIT ClockTime_Init(CLOCKTIME_NOSYNC)
#else
/* Some posix systems like Darwin don't have CLOCK_REALTIME */
/* Some posix systems may not have CLOCK_REALTIME */
#define TIME_INIT generalTimeCurrentTpRegister("GetTimeOfDay", \
LAST_RESORT_PRIORITY, osdTimeGetCurrent)

View File

@@ -3,9 +3,8 @@
* 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
* in file LICENSE that is included with this distribution.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*epicsRingPointer.cpp*/
/* Author: Marty Kraimer Date: 13OCT2000 */
@@ -63,7 +62,7 @@ epicsShareFunc int epicsShareAPI epicsRingPointerGetUsed(epicsRingPointerId id)
return(pvoidPointer->getUsed());
}
epicsShareFunc int epicsShareAPI epicsRingPointerSize(epicsRingPointerId id)
epicsShareFunc int epicsShareAPI epicsRingPointerGetSize(epicsRingPointerId id)
{
voidPointer *pvoidPointer = reinterpret_cast<voidPointer*>(id);
return(pvoidPointer->getSize());

View File

@@ -3,9 +3,8 @@
* 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
* in file LICENSE that is included with this distribution.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*epicsRingPointer.h */
@@ -67,6 +66,9 @@ epicsShareFunc int epicsShareAPI epicsRingPointerGetSize(epicsRingPointerId id)
epicsShareFunc int epicsShareAPI epicsRingPointerIsEmpty(epicsRingPointerId id);
epicsShareFunc int epicsShareAPI epicsRingPointerIsFull(epicsRingPointerId id);
/* This routine was incorrectly named in previous releases */
#define epicsRingPointerSize epicsRingPointerGetSize
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeBaseApp
#!/usr/bin/env perl
# Authors: Ralph Lange, Marty Kraimer, Andrew Johnson and Janet Anderson
# $Revision-Id$

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeBaseExt
#!/usr/bin/env perl
# Authors: Ralph Lange, Marty Kraimer, Andrew Johnson and Janet Anderson
# $Revision-Id$

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # convertRelease.pl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # cvsclean.pl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeConfigAppInclude.pl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#
# Tool to expand @VAR@ variables while copying a file.
# The file will *not* be copied if it already exists.

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S -w $0 ${1+"$@"}' # -*- Mode: perl -*-
if 0;
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2009 Helmholtz-Zentrum Berlin fuer Materialien und Energie.
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne

View File

@@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # registerRecordDeviceDriver
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.

View File

@@ -1,5 +1,4 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # replaceVAR.pl
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# National Laboratory.

View File

@@ -1,6 +1,4 @@
eval 'exec perl -S -w $0 ${1+"$@"}' # -*- Mode: perl -*-
if 0;
#!/usr/bin/env perl
#
# Use MS Visual C++ compiler version number to determine if
# we want to use the Manifest Tool (status=1) or not (status=0)