From 805e62b29c4e441a27f28d64e511224c3eb049eb Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2017 10:30:53 -0500 Subject: [PATCH 01/10] ioc/dbStatic: add typed_dset --- src/ioc/dbStatic/devSup.h | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/src/ioc/dbStatic/devSup.h b/src/ioc/dbStatic/devSup.h index bd900cae4..aa3aa5c3d 100644 --- a/src/ioc/dbStatic/devSup.h +++ b/src/ioc/dbStatic/devSup.h @@ -21,6 +21,7 @@ /* structures defined elsewhere */ struct dbCommon; struct devSup; +struct ioscan_head; /* aka IOSCANPVT */ #ifdef __cplusplus extern "C" { @@ -38,6 +39,73 @@ typedef struct dset { /* device support entry table */ /*other functions are record dependent*/ } dset; +/** Type safe alternative to 'struct dset' + * + * Recommended usage + @code + long my_drv_init_record(dbCommon *prec); + long my_drv_get_iointr_info(int deattach, dbCommon *prec, IOCSCANPVT* pscan); + long my_longin_read(longinRecord *prec); + typedef struct { + typed_dset common; + long (*read)(longinRecord *prec); + } my_longin_dset; + static const my_longin_dset devLiMyDrvName = {{ + 5, // 4 from typed_dset + 1 more + NULL, + NULL, + &my_drv_init_record, + &my_drv_get_iointr_info + }, + &my_longin_read + }; + epicsExportAddress(dset, devLiMyDrvName); + @endcode + */ +typedef struct typed_dset { + /** Number of function pointers which follow. Must be >=4 */ + long number; + /** Called from dbior() */ + long (*report)(int lvl); + /** Called twice during iocInit(). + * First with phase=0 early, before init_record() and array field alloc. + * Again with phase=1 after init_record() + */ + long (*init)(int phase); + /** Called once per record instance */ + long (*init_record)(struct dbCommon *prec); + /** Called when SCAN="I/O Intr" on startup, or after SCAN is changed. + * + * Caller must assign third arguement (IOCSCANPVT*). eg. + @code + struct mpvt { + IOSCANPVT drvlist; + }; + ... + // init code calls + scanIoInit(&pvt->drvlist); + ... + long my_get_ioint_info(int deattach, struct dbCommon *prec, IOCSCANPVT* pscan) { + if(prec->dpvt) + *pscan = &((mypvt*)prec->dpvt)->drvlist; + @endcode + * + * When a particular record instance can/will only used a single scan list, then + * the 'detach' argument should be ignored. + * + * If this is not the case, then the following should be noted. + * get_ioint_info() called with deattach=0 to fetch the scan list to which this record will be added. + * Again with detach=1 to fetch the scan list from which this record will be removed. + * Calls will be balanced. + * A call with detach=0 will be matched by a call with detach=1. + * + * @note get_ioint_info() will be called during IOC shutdown if the del_record() + * extended callback is provided. (from 3.15.0.1) + */ + long (*get_ioint_info)(int deattach, struct dbCommon *prec, struct ioscan_head** pscan); + /*other functions are record dependent*/ +} typed_dset; + typedef struct dsxt { /* device support extension table */ long (*add_record)(struct dbCommon *precord); long (*del_record)(struct dbCommon *precord); From fef15d6c91e202b22b95ff369c19ce9e37109483 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2017 10:35:08 -0500 Subject: [PATCH 02/10] ioc/dbStatic: add typed_drvet --- src/ioc/dbStatic/drvSup.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ioc/dbStatic/drvSup.h b/src/ioc/dbStatic/drvSup.h index 5778038e7..59a566938 100644 --- a/src/ioc/dbStatic/drvSup.h +++ b/src/ioc/dbStatic/drvSup.h @@ -28,6 +28,20 @@ typedef struct drvet { /* driver entry table */ }drvet; #define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) ) +typedef struct typed_drvet { + /** Number of function pointers which follow. Must be >=2 */ + long number; + /** Called from dbior() */ + long (*report)(int lvl); + /** Called during iocInit() */ +#ifdef __cplusplus + long (*init)(); +#else + long (*init)(void); +#endif + /*other functions are device dependent*/ +} typed_drvet; + #define S_drv_noDrvSup (M_drvSup| 1) /*SDR_DRVSUP: Driver support missing*/ #define S_drv_noDrvet (M_drvSup| 3) /*Missing driver support entry table*/ From c0cbbd8bee930e69eac8e4a7d58a0403b9906864 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2017 10:44:47 -0500 Subject: [PATCH 03/10] ioc/dbStatic: add dbGetDevLink() --- src/ioc/db/dbAccess.c | 12 ++++++++++++ src/ioc/dbStatic/devSup.h | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/src/ioc/db/dbAccess.c b/src/ioc/db/dbAccess.c index 973a66836..e1e354370 100644 --- a/src/ioc/db/dbAccess.c +++ b/src/ioc/db/dbAccess.c @@ -709,6 +709,18 @@ void dbInitEntryFromRecord(struct dbCommon *prec, DBENTRY *pdbentry) pdbentry->precnode = ppvt->recnode; } +struct link* dbGetDevLink(struct dbCommon* prec) +{ + DBLINK *plink = 0; + DBENTRY entry; + dbInitEntryFromRecord(prec, &entry); + if(dbFindField(&entry, "INP")==0 || dbFindField(&entry, "OUT")==0) { + plink = (DBLINK*)entry.pfield; + } + dbFinishEntry(&entry); + return plink; +} + long dbValueSize(short dbr_type) { /* sizes for value associated with each DBR request type */ diff --git a/src/ioc/dbStatic/devSup.h b/src/ioc/dbStatic/devSup.h index aa3aa5c3d..63ffb36ce 100644 --- a/src/ioc/dbStatic/devSup.h +++ b/src/ioc/dbStatic/devSup.h @@ -22,6 +22,7 @@ struct dbCommon; struct devSup; struct ioscan_head; /* aka IOSCANPVT */ +struct link; /* aka DBLINK */ #ifdef __cplusplus extern "C" { @@ -112,6 +113,12 @@ typedef struct dsxt { /* device support extension table */ /* Recordtypes are *not* allowed to extend this table */ } dsxt; +/** Fetch INP or OUT link (or NULL if record type has neither). + * + * Recommended for use in device support init_record() + */ +epicsShareFunc struct link* dbGetDevLink(struct dbCommon* prec); + epicsShareExtern dsxt devSoft_DSXT; /* Allow anything table */ epicsShareFunc void devExtend(dsxt *pdsxt); From 1ca85352662766bd37317b16d1c05d455c2c25c6 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2017 11:13:43 -0500 Subject: [PATCH 04/10] std/rec/test: test # Conflicts: # src/std/rec/test/linkInitTest.c --- src/std/rec/test/linkInitTest.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/std/rec/test/linkInitTest.c b/src/std/rec/test/linkInitTest.c index 7225beb1c..09ff40942 100644 --- a/src/std/rec/test/linkInitTest.c +++ b/src/std/rec/test/linkInitTest.c @@ -7,11 +7,14 @@ #include #include "dbAccess.h" +#include "devSup.h" #include "alarm.h" #include "dbUnitTest.h" #include "errlog.h" #include "epicsThread.h" +#include "longinRecord.h" + #include "testMain.h" void recTestIoc_registerRecordDeviceDriver(struct dbBase *); @@ -28,12 +31,21 @@ static void startTestIoc(const char *dbfile) eltc(1); } +/* testing here instead of ioc/db/test as xRecord has no INP/OUT */ +static void testdbGetDevLink(void) +{ + longinRecord *rec = (longinRecord*)testdbRecordPtr("li1"); + testOk1(dbGetDevLink((dbCommon*)rec) == &rec->inp); +} + static void testLongStringInit() { testDiag("testLongStringInit"); startTestIoc("linkInitTest.db"); + testdbGetDevLink(); + { const char buf[] = "!----------------------------------------------!"; testdbGetArrFieldEqual("longstr1.VAL$", DBF_CHAR, NELEMENTS(buf)+2, NELEMENTS(buf), buf); @@ -230,7 +242,7 @@ void testInt64Inputs(void) MAIN(linkInitTest) { - testPlan(77); + testPlan(78); testLongStringInit(); testCalcInit(); From 2b1d5ae4e38f6a6a99802dcb74c4083e8e96caa0 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 24 Oct 2017 11:46:09 -0500 Subject: [PATCH 05/10] add release note --- documentation/RELEASE_NOTES.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index a4a09c7da..e172f12cd 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -17,6 +17,16 @@ --> +

Typed Device and Driver Support callbacks

+ +

Two new structures (typed_dset and typed_drvet) are added +for use instead of dset and drvet. +The existing structures are not changed. +See comments in devSup.h for usage information.

+ +

A helper function DBLINK* dbGetDevLink(dbCommon*) is added to fetch +a pointer to the INP or OUT field of a record.

+

Restore use of ledlib for VxWorks command editing

The epicsReadline refactoring work described below unfortunately disabled the From 1893cb4f54264d137e7a6eb0c3a8c2193f9d2f89 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 14 May 2018 19:51:27 -0700 Subject: [PATCH 06/10] add USE_TYPED_DRVET and USE_TYPED_DSET options --- src/ioc/dbStatic/devSup.h | 38 ++++++++++++++++++++++---------------- src/ioc/dbStatic/drvSup.h | 28 +++++++++++++++------------- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/ioc/dbStatic/devSup.h b/src/ioc/dbStatic/devSup.h index 63ffb36ce..7520b7a71 100644 --- a/src/ioc/dbStatic/devSup.h +++ b/src/ioc/dbStatic/devSup.h @@ -24,22 +24,6 @@ struct devSup; struct ioscan_head; /* aka IOSCANPVT */ struct link; /* aka DBLINK */ -#ifdef __cplusplus -extern "C" { - typedef long (*DEVSUPFUN)(void *); /* ptr to device support function*/ -#else - typedef long (*DEVSUPFUN)(); /* ptr to device support function*/ -#endif - -typedef struct dset { /* device support entry table */ - long number; /*number of support routines*/ - DEVSUPFUN report; /*print report*/ - DEVSUPFUN init; /*init support layer*/ - DEVSUPFUN init_record; /*init device for particular record*/ - DEVSUPFUN get_ioint_info; /* get io interrupt information*/ - /*other functions are record dependent*/ -} dset; - /** Type safe alternative to 'struct dset' * * Recommended usage @@ -113,6 +97,28 @@ typedef struct dsxt { /* device support extension table */ /* Recordtypes are *not* allowed to extend this table */ } dsxt; +#ifdef __cplusplus +extern "C" { + typedef long (*DEVSUPFUN)(void *); /* ptr to device support function*/ +#else + typedef long (*DEVSUPFUN)(); /* ptr to device support function*/ +#endif + +#ifndef USE_TYPED_DSET + +typedef struct dset { /* device support entry table */ + long number; /*number of support routines*/ + DEVSUPFUN report; /*print report*/ + DEVSUPFUN init; /*init support layer*/ + DEVSUPFUN init_record; /*init device for particular record*/ + DEVSUPFUN get_ioint_info; /* get io interrupt information*/ + /*other functions are record dependent*/ +} dset; + +#else +typedef typed_dset dset; +#endif /* USE_TYPED_DSET */ + /** Fetch INP or OUT link (or NULL if record type has neither). * * Recommended for use in device support init_record() diff --git a/src/ioc/dbStatic/drvSup.h b/src/ioc/dbStatic/drvSup.h index 59a566938..943105f31 100644 --- a/src/ioc/dbStatic/drvSup.h +++ b/src/ioc/dbStatic/drvSup.h @@ -18,7 +18,19 @@ #include "errMdef.h" -typedef long (*DRVSUPFUN) (); /* ptr to driver support function*/ +typedef struct typed_drvet { + /** Number of function pointers which follow. Must be >=2 */ + long number; + /** Called from dbior() */ + long (*report)(int lvl); + /** Called during iocInit() */ + long (*init)(void); + /*other functions are device dependent*/ +} typed_drvet; + +typedef long (*DRVSUPFUN) (); /* ptr to driver support function for use with plain/untyped drvet */ + +#ifndef USE_TYPED_DRVET typedef struct drvet { /* driver entry table */ long number; /*number of support routines*/ @@ -28,19 +40,9 @@ typedef struct drvet { /* driver entry table */ }drvet; #define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) ) -typedef struct typed_drvet { - /** Number of function pointers which follow. Must be >=2 */ - long number; - /** Called from dbior() */ - long (*report)(int lvl); - /** Called during iocInit() */ -#ifdef __cplusplus - long (*init)(); #else - long (*init)(void); -#endif - /*other functions are device dependent*/ -} typed_drvet; +typedef typed_drvet drvet; +#endif /* USE_TYPED_DRVET */ #define S_drv_noDrvSup (M_drvSup| 1) /*SDR_DRVSUP: Driver support missing*/ #define S_drv_noDrvet (M_drvSup| 3) /*Missing driver support entry table*/ From ea0556e471030a5bc43815b9840825448e496031 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 22 Oct 2018 16:00:16 -0500 Subject: [PATCH 07/10] Improve devSup example --- src/ioc/dbStatic/devSup.h | 112 +++++++++++++++++++++++++------------- src/ioc/dbStatic/drvSup.h | 35 +++++++----- 2 files changed, 95 insertions(+), 52 deletions(-) diff --git a/src/ioc/dbStatic/devSup.h b/src/ioc/dbStatic/devSup.h index 7520b7a71..f9539ef78 100644 --- a/src/ioc/dbStatic/devSup.h +++ b/src/ioc/dbStatic/devSup.h @@ -6,7 +6,11 @@ * EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ -/* devSup.h Device Support */ +/** @file devSup.h + * + * @brief Device support routines + */ + /* * Author: Marty Kraimer * Date: 6-1-90 @@ -21,80 +25,110 @@ /* structures defined elsewhere */ struct dbCommon; struct devSup; -struct ioscan_head; /* aka IOSCANPVT */ +typedef struct ioscan_head *IOSCANPVT; struct link; /* aka DBLINK */ -/** Type safe alternative to 'struct dset' +/** Type safe version of 'struct dset' * - * Recommended usage + * Recommended usage: + * + * In Makefile: @code - long my_drv_init_record(dbCommon *prec); - long my_drv_get_iointr_info(int deattach, dbCommon *prec, IOCSCANPVT* pscan); - long my_longin_read(longinRecord *prec); - typedef struct { - typed_dset common; - long (*read)(longinRecord *prec); - } my_longin_dset; - static const my_longin_dset devLiMyDrvName = {{ - 5, // 4 from typed_dset + 1 more - NULL, - NULL, - &my_drv_init_record, - &my_drv_get_iointr_info - }, - &my_longin_read + USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET + @endcode + * + * In C source file: + @code + #include + #include // For IOCSCANPVT + ... + #include // defines epicsExportSharedSymbols + ... + static long init_record(dbCommon *prec); + static long get_iointr_info(int detach, dbCommon *prec, IOCSCANPVT* pscan); + static long longin_read(longinRecord *prec); + + const struct { + dset common; + long (*read)(longinRecord *prec); + } devLiDevName = { + { + 5, // 4 from dset + 1 from longinRecord + NULL, + NULL, + &init_record, + &get_iointr_info + }, + &longin_read }; - epicsExportAddress(dset, devLiMyDrvName); + epicsExportAddress(dset, devLiDevName); @endcode */ typedef struct typed_dset { - /** Number of function pointers which follow. Must be >=4 */ + /** Number of function pointers which follow. + * The value depends on the recordtype, but must be >=4 */ long number; /** Called from dbior() */ long (*report)(int lvl); /** Called twice during iocInit(). - * First with phase=0 early, before init_record() and array field alloc. - * Again with phase=1 after init_record() + * First with @a after = 0 before init_record() or array field allocation. + * Again with @a after = 1 after init_record() has finished. */ - long (*init)(int phase); + long (*init)(int after); /** Called once per record instance */ long (*init_record)(struct dbCommon *prec); /** Called when SCAN="I/O Intr" on startup, or after SCAN is changed. * - * Caller must assign third arguement (IOCSCANPVT*). eg. + * Caller must assign the third arguement (IOCSCANPVT*). eg. @code struct mpvt { IOSCANPVT drvlist; }; ... - // init code calls + // init_record() routine calls scanIoInit(&pvt->drvlist); ... - long my_get_ioint_info(int deattach, struct dbCommon *prec, IOCSCANPVT* pscan) { + long my_get_ioint_info(int detach, struct dbCommon *prec, IOCSCANPVT* pscan) { if(prec->dpvt) *pscan = &((mypvt*)prec->dpvt)->drvlist; @endcode * - * When a particular record instance can/will only used a single scan list, then - * the 'detach' argument should be ignored. + * When a particular record instance can/will only used a single scan list, + * the @a detach argument can be ignored. * * If this is not the case, then the following should be noted. - * get_ioint_info() called with deattach=0 to fetch the scan list to which this record will be added. - * Again with detach=1 to fetch the scan list from which this record will be removed. - * Calls will be balanced. - * A call with detach=0 will be matched by a call with detach=1. + * + get_ioint_info() is called with @a detach = 0 to fetch the scan list to + * which this record will be added. + * + get_ioint_info() is called later with @a detach = 1 to fetch the scan + * list from which this record should be removed. + * + Calls will be balanced, so a call with @a detach = 0 will be followed + * by one with @a detach = 1. * - * @note get_ioint_info() will be called during IOC shutdown if the del_record() - * extended callback is provided. (from 3.15.0.1) + * @note get_ioint_info() will be called during IOC shutdown if the + * dsxt::del_record() extended callback is defined. (from 3.15.0.1) */ - long (*get_ioint_info)(int deattach, struct dbCommon *prec, struct ioscan_head** pscan); - /*other functions are record dependent*/ + long (*get_ioint_info)(int detach, struct dbCommon *prec, IOSCANPVT* pscan); + /* Any further functions are specified by the record type. */ } typed_dset; -typedef struct dsxt { /* device support extension table */ +/** Device support extension table. + * + * Optional routines to allow run-time address modifications to be communicated + * to device support, which must register a struct dsxt by calling devExtend() + * from its init() routine. + */ +typedef struct dsxt { + /** Optional, called to offer device support a new record to control. + * + * Routine may return a non-zero error code to refuse record. + */ long (*add_record)(struct dbCommon *precord); + /** Optional, called to remove record from device support control. + * + * Routine return a non-zero error code to refuse record removal. + */ long (*del_record)(struct dbCommon *precord); - /* Recordtypes are *not* allowed to extend this table */ + /* Only future Base releases may extend this table. */ } dsxt; #ifdef __cplusplus diff --git a/src/ioc/dbStatic/drvSup.h b/src/ioc/dbStatic/drvSup.h index 943105f31..193d57482 100644 --- a/src/ioc/dbStatic/drvSup.h +++ b/src/ioc/dbStatic/drvSup.h @@ -6,7 +6,10 @@ * EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ -/* drvSup.h Driver Support */ +/** @file drvSup.h + * + * @brief Driver support routines. + */ /* * Author: Marty Kraimer @@ -18,6 +21,7 @@ #include "errMdef.h" +/** Driver entry table */ typedef struct typed_drvet { /** Number of function pointers which follow. Must be >=2 */ long number; @@ -25,23 +29,28 @@ typedef struct typed_drvet { long (*report)(int lvl); /** Called during iocInit() */ long (*init)(void); - /*other functions are device dependent*/ + /* Any further functions are driver-specific */ } typed_drvet; -typedef long (*DRVSUPFUN) (); /* ptr to driver support function for use with plain/untyped drvet */ +#ifdef USE_TYPED_DRVET -#ifndef USE_TYPED_DRVET - -typedef struct drvet { /* driver entry table */ - long number; /*number of support routines*/ - DRVSUPFUN report; /*print report*/ - DRVSUPFUN init; /*init support*/ - /*other functions are device dependent*/ -}drvet; -#define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) ) +typedef typed_drvet drvet; #else -typedef typed_drvet drvet; + +/* These interfaces may eventually get deprecated */ + +typedef long (*DRVSUPFUN) (); /* ptr to driver support function */ + +typedef struct drvet { /* driver entry table */ + long number; /* number of support routines */ + DRVSUPFUN report; /* print report */ + DRVSUPFUN init; /* init support */ + /* Any further functions are driver-specific */ +} drvet; + +#define DRVETNUMBER ( (sizeof(struct drvet) -sizeof(long))/sizeof(DRVSUPFUN) ) + #endif /* USE_TYPED_DRVET */ #define S_drv_noDrvSup (M_drvSup| 1) /*SDR_DRVSUP: Driver support missing*/ From b3365458537a9f505e73f4d00987233d5dcb8535 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 23 Oct 2018 12:47:00 -0500 Subject: [PATCH 08/10] Update Release Notes --- documentation/RELEASE_NOTES.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index e172f12cd..7a4145732 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -17,15 +17,25 @@ --> -

Typed Device and Driver Support callbacks

+

Type-safe Device and Driver Support Tables

-

Two new structures (typed_dset and typed_drvet) are added -for use instead of dset and drvet. -The existing structures are not changed. -See comments in devSup.h for usage information.

+

Type-safe versions of the device and driver support structures dset +and drvet have been added to the devSup.h and drvSup.h headers +respectively. The original structure definitions have not been changed so +existing support modules will still build normally, but older modules can be +modified and new code written to be compatible with both.

-

A helper function DBLINK* dbGetDevLink(dbCommon*) is added to fetch -a pointer to the INP or OUT field of a record.

+

The old structure definitions will be replaced by the new ones if the macros +USE_TYPED_DSET and/or USE_TYPED_DRVET are defined when the +appropriate header is included. The best place to define these is in the +Makefile, as with the USE_TYPED_RSET macro that was introduced in +Base-3.16.1 and described below. See the comments in devSup.h for a brief usage +example, or look at +this commit to the ipac module to see a module conversion.

+ +

A helper function DBLINK* dbGetDevLink(dbCommon *prec) has also been +added to devSup.h which fetches a pointer to the INP or OUT field of the +record.

Restore use of ledlib for VxWorks command editing

From c6476fbbdceab3a00242367895de5a675ac3c8e5 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 23 Oct 2018 15:44:44 -0500 Subject: [PATCH 09/10] Declare IOSCANPVT in devSup.h only --- src/ioc/db/dbScan.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ioc/db/dbScan.h b/src/ioc/db/dbScan.h index 028d09ec8..d483a0c30 100644 --- a/src/ioc/db/dbScan.h +++ b/src/ioc/db/dbScan.h @@ -19,6 +19,7 @@ #include "menuScan.h" #include "shareLib.h" #include "compilerDependencies.h" +#include "devSup.h" #ifdef __cplusplus extern "C" { @@ -33,9 +34,7 @@ extern "C" { #define MIN_PHASE SHRT_MIN /*definitions for I/O Interrupt Scanning */ -struct ioscan_head; - -typedef struct ioscan_head *IOSCANPVT; +/* IOSCANPVT now defined in devSup.h */ typedef struct event_list *EVENTPVT; struct dbCommon; From 06f522b253e1f1befac32aa64f2306aafa7a51e0 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Tue, 23 Oct 2018 15:45:39 -0500 Subject: [PATCH 10/10] Make example get_ioint_info() routine static --- src/ioc/dbStatic/devSup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ioc/dbStatic/devSup.h b/src/ioc/dbStatic/devSup.h index f9539ef78..73dba198c 100644 --- a/src/ioc/dbStatic/devSup.h +++ b/src/ioc/dbStatic/devSup.h @@ -88,7 +88,7 @@ typedef struct typed_dset { // init_record() routine calls scanIoInit(&pvt->drvlist); ... - long my_get_ioint_info(int detach, struct dbCommon *prec, IOCSCANPVT* pscan) { + static long get_ioint_info(int detach, struct dbCommon *prec, IOCSCANPVT* pscan) { if(prec->dpvt) *pscan = &((mypvt*)prec->dpvt)->drvlist; @endcode