=?UTF-8?q?Update=20copyright=20notices,=20refactor=20in=20dbEvent.c:=20make=20LOCK/UNLOCK=20macros=20require=20=C2=A8;=C2=A8?=

MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This commit is contained in:
Ralph Lange
2012-04-27 13:21:57 -04:00
committed by Michael Davidsaver
parent 0a6ca6011a
commit 926246a495
17 changed files with 131 additions and 86 deletions
+4
View File
@@ -6,6 +6,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Ralph Lange <Ralph.Lange@bessy.de>
*/
/* Based on the linkoptions utility by Michael Davidsaver (BNL) */
#include <stdio.h>
+6 -2
View File
@@ -6,6 +6,12 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Ralph Lange <Ralph.Lange@bessy.de>
*/
/* Based on the linkoptions utility by Michael Davidsaver (BNL) */
#ifndef CHFPLUGIN_H
#define CHFPLUGIN_H
@@ -16,8 +22,6 @@
struct db_field_log;
/* Based on the linkoptions utility by Michael Davidsaver (BNL) */
/** @file chfPlugin.h
* @brief Channel filter simplified plugins.
*
+8 -7
View File
@@ -1,20 +1,21 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* Copyright (c) 2002 The University of Chicago, 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.
\*************************************************************************/
/* dbAccess.c */
/* $Revision-Id$ */
/*
* Original Author: Bob Dalesio
* Current Author: Marty Kraimer
* Date: 11-7-90
*/
* Andrew Johnson <anj@aps.anl.gov>
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#include <stddef.h>
#include <stdlib.h>
+8
View File
@@ -1,10 +1,18 @@
/*************************************************************************\
* Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Andrew Johnson <anj@aps.anl.gov>
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#include <stdio.h>
#include <string.h>
+8
View File
@@ -1,10 +1,18 @@
/*************************************************************************\
* Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Andrew Johnson <anj@aps.anl.gov>
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#ifndef INC_dbChannel_H
#define INC_dbChannel_H
+32 -31
View File
@@ -1,19 +1,20 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* Copyright (c) 2002 The University of Chicago, 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.
\*************************************************************************/
/* dbEvent.c */
/* $Revision-Id$ */
/* routines for scheduling events to lower priority tasks via the RT kernel */
/*
* Author: Jeffrey O. Hill
* Date: 4-1-89
*/
* Author: Jeffrey O. Hill <johill@lanl.gov>
*
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#include <stddef.h>
#include <stdlib.h>
@@ -98,9 +99,9 @@ struct event_user {
( (unsigned short) ( (OLD) >= (EVENTQUESIZE-1) ? 0 : (OLD)+1 ) )
#define LOCKEVQUE(EV_QUE) epicsMutexMustLock((EV_QUE)->writelock)
#define UNLOCKEVQUE(EV_QUE) {epicsMutexUnlock((EV_QUE)->writelock);}
#define UNLOCKEVQUE(EV_QUE) epicsMutexUnlock((EV_QUE)->writelock)
#define LOCKREC(RECPTR) epicsMutexMustLock((RECPTR)->mlok)
#define UNLOCKREC(RECPTR) {epicsMutexUnlock((RECPTR)->mlok);}
#define UNLOCKREC(RECPTR) epicsMutexUnlock((RECPTR)->mlok)
static void *dbevEventUserFreeList;
static void *dbevEventQueueFreeList;
@@ -149,13 +150,13 @@ int epicsShareAPI dbel ( const char *pname, unsigned level )
return DB_EVENT_ERROR;
}
LOCKREC (addr.precord)
LOCKREC (addr.precord);
pevent = (struct evSubscrip *) ellFirst ( &addr.precord->mlis );
if ( ! pevent ) {
printf ( "\"%s\": No PV event subscriptions ( monitors ).\n", pname );
UNLOCKREC (addr.precord)
UNLOCKREC (addr.precord);
return DB_EVENT_OK;
}
@@ -234,7 +235,7 @@ int epicsShareAPI dbel ( const char *pname, unsigned level )
pevent = (struct evSubscrip *) ellNext ( &pevent->node );
}
UNLOCKREC (addr.precord)
UNLOCKREC (addr.precord);
return DB_EVENT_OK;
}
@@ -442,12 +443,12 @@ void epicsShareAPI db_event_enable (dbEventSubscription event)
struct evSubscrip * const pevent = (struct evSubscrip *) event;
struct dbCommon * const precord = dbChannelRecord(pevent->chan);
LOCKREC (precord)
LOCKREC (precord);
if ( ! pevent->enabled ) {
ellAdd (&precord->mlis, &pevent->node);
pevent->enabled = TRUE;
}
UNLOCKREC (precord)
UNLOCKREC (precord);
}
/*
@@ -458,12 +459,12 @@ void epicsShareAPI db_event_disable (dbEventSubscription event)
struct evSubscrip * const pevent = (struct evSubscrip *) event;
struct dbCommon * const precord = dbChannelRecord(pevent->chan);
LOCKREC (precord)
LOCKREC (precord);
if ( pevent->enabled ) {
ellDelete(&precord->mlis, &pevent->node);
pevent->enabled = FALSE;
}
UNLOCKREC (precord)
UNLOCKREC (precord);
}
/*
@@ -509,7 +510,7 @@ void epicsShareAPI db_cancel_event (dbEventSubscription event)
* make certain that the event isnt being accessed while
* its call back changes
*/
LOCKEVQUE (pevent->ev_que)
LOCKEVQUE (pevent->ev_que);
pevent->user_sub = NULL;
@@ -542,15 +543,15 @@ void epicsShareAPI db_cancel_event (dbEventSubscription event)
}
else {
while ( pevent->callBackInProgress ) {
UNLOCKEVQUE (pevent->ev_que)
UNLOCKEVQUE (pevent->ev_que);
epicsEventMustWait ( pevent->ev_que->evUser->pflush_sem );
LOCKEVQUE (pevent->ev_que)
LOCKEVQUE (pevent->ev_que);
}
}
pevent->ev_que->quota -= EVENTENTRIES;
UNLOCKEVQUE (pevent->ev_que)
UNLOCKEVQUE (pevent->ev_que);
freeListFree ( dbevEventSubscriptionFreeList, pevent );
@@ -687,7 +688,7 @@ static void db_queue_event_log (evSubscrip *pevent, db_field_log *pLog)
* threads writing/reading it
*/
LOCKEVQUE (ev_que)
LOCKEVQUE (ev_que);
/*
* if we have an event on the queue and both the last
@@ -699,7 +700,7 @@ static void db_queue_event_log (evSubscrip *pevent, db_field_log *pLog)
(*pevent->pLastLog)->type == dbfl_type_rec &&
pLog->type == dbfl_type_rec) {
db_delete_field_log(pLog);
UNLOCKEVQUE (ev_que)
UNLOCKEVQUE (ev_que);
return;
}
@@ -755,7 +756,7 @@ static void db_queue_event_log (evSubscrip *pevent, db_field_log *pLog)
ev_que->putix = RNGINC ( ev_que->putix );
}
UNLOCKEVQUE (ev_que)
UNLOCKEVQUE (ev_que);
/*
* its more efficent to notify the event handler
@@ -788,7 +789,7 @@ unsigned int caEventMask
if (prec->mlis.count == 0) return DB_EVENT_OK; /* no monitors set */
LOCKREC (prec)
LOCKREC (prec);
for (pevent = (struct evSubscrip *) prec->mlis.node.next;
pevent; pevent = (struct evSubscrip *) pevent->node.next){
@@ -805,7 +806,7 @@ unsigned int caEventMask
}
}
UNLOCKREC (prec)
UNLOCKREC (prec);
return DB_EVENT_OK;
}
@@ -840,7 +841,7 @@ static int event_read ( struct event_que *ev_que )
* evUser ring buffer must be locked for the multiple
* threads writing/reading it
*/
LOCKEVQUE (ev_que)
LOCKEVQUE (ev_que);
/*
* if in flow control mode drain duplicates and then
@@ -848,7 +849,7 @@ static int event_read ( struct event_que *ev_que )
* mode is over
*/
if ( ev_que->evUser->flowCtrlMode && ev_que->nDuplicates == 0u ) {
UNLOCKEVQUE (ev_que)
UNLOCKEVQUE (ev_que);
return DB_EVENT_OK;
}
@@ -900,7 +901,7 @@ static int event_read ( struct event_que *ev_que )
* it.
*/
pevent->callBackInProgress = TRUE;
UNLOCKEVQUE (ev_que)
UNLOCKEVQUE (ev_que);
/* Run post-event-queue filter chain */
if (ellCount(&pevent->chan->post_chain)) {
dbChannelRunPostChain(pevent->chan, pfl);
@@ -908,7 +909,7 @@ static int event_read ( struct event_que *ev_que )
/* Issue user callback */
( *user_sub ) ( pevent->user_arg, pevent->chan,
ev_que->evque[ev_que->getix] != EVENTQEMPTY, pfl );
LOCKEVQUE (ev_que)
LOCKEVQUE (ev_que);
/*
* check to see if this event has been canceled each
@@ -933,7 +934,7 @@ static int event_read ( struct event_que *ev_que )
db_delete_field_log(pfl);
}
UNLOCKEVQUE (ev_que)
UNLOCKEVQUE (ev_que);
return DB_EVENT_OK;
}
+7 -5
View File
@@ -1,17 +1,19 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* Copyright (c) 2002 The University of Chicago, 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.
\*************************************************************************/
/*
* $Revision-Id$
* Author: Jeffrey O. Hill <johill@lanl.gov>
*
* Author: Jeff Hill
* Date: 030393
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#ifndef INCLdbEventh
+10 -10
View File
@@ -1,17 +1,17 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, 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
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbNotify.c */
/* base/src/db $Revision-Id$ */
* 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.
\*************************************************************************/
/*
* Author: Marty Kraimer
* Date: 03-30-95
* Andrew Johnson <anj@aps.anl.gov>
*
* Extracted from dbLink.c
*/
+1 -3
View File
@@ -7,12 +7,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* $Revision-Id$ */
/* Interface between old database access and new
*
* Author: Marty Kraimer
* Date: 6-1-90
* Andrew Johnson <anj@aps.anl.gov>
*/
#include <stddef.h>
+2 -3
View File
@@ -1,10 +1,9 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* Copyright (c) 2010 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.
\*************************************************************************/
/* base/include/db_access_routines.h */
+11 -6
View File
@@ -1,16 +1,21 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* Copyright (c) 2002 The University of Chicago, 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
* 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.
\*************************************************************************/
/* $Revision-Id$
* Author: Jeffrey O. Hill
* Date: 4-1-89
/*
* Author: Jeffrey O. Hill <johill@lanl.gov>
*
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#ifndef INCLdb_field_logh
#define INCLdb_field_logh
+9 -9
View File
@@ -1,17 +1,17 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, 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
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* share/src/db @(#)db_test.c 1.10 2/3/94 */
* 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.
\*************************************************************************/
/* database access subroutines */
/*
* Author: Bob Dalesio
* Date: 4/15/88
* Andrew Johnson <anj@aps.anl.gov>
*/
#include <stddef.h>
#include <epicsStdlib.h>
+1 -3
View File
@@ -6,12 +6,10 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recGbl.c */
/* $Revision-Id$ */
/*
* Author: Marty Kraimer
* Date: 11-7-90
* Andrew Johnson <anj@aps.anl.gov>
*/
#include <stddef.h>
+4
View File
@@ -6,6 +6,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Ralph Lange <Ralph.Lange@bessy.de>
*/
#include <string.h>
#include "chfPlugin.h"
+11 -3
View File
@@ -1,10 +1,18 @@
/*************************************************************************\
* Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
* National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
* National Laboratory.
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Author: Andrew Johnson <anj@aps.anl.gov>
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#include "dbChannel.h"
#include "dbStaticLib.h"
#include "dbAccessDefs.h"
+5 -1
View File
@@ -1,4 +1,7 @@
/*************************************************************************\
* Copyright (c) 2010 Brookhaven National Laboratory.
* Copyright (c) 2010 Helmholtz-Zentrum Berlin
* fuer Materialien und Energie GmbH.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
@@ -8,8 +11,9 @@
\*************************************************************************/
/*
* Author: Jeffrey O. Hill
* Author: Jeffrey O. Hill <johill@lanl.gov>
*
* Ralph Lange <Ralph.Lange@bessy.de>
*/
#include <stddef.h>
+4 -3
View File
@@ -1,15 +1,16 @@
/*************************************************************************\
* Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
* Copyright (c) 2010 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.
\*************************************************************************/
/* $Revision-Id$
/*
*
* Author: John Winans (ANL)
* Date: 07-02-92
* Andrew Johnson <anj@aps.anl.gov>
*/
#ifndef INC_ellLib_H
#define INC_ellLib_H