Fixed many compiler warning messages

This commit is contained in:
Marty Kraimer
1997-04-30 19:02:21 +00:00
parent 13c9ae5fe3
commit e1e8a34b2f
30 changed files with 319 additions and 300 deletions

View File

@@ -2,6 +2,7 @@
TOP = ../../../..
include $(TOP)/config/CONFIG_BASE
VX_WARN_YES = -Wall -pedantic
# The pc486 cross-compiler has no "nobitfield" option -kuk-
ifeq ($(ARCH_CLASS),pc486)
USR_CFLAGS = -fshared-data -fvolatile -traditional

View File

@@ -34,17 +34,8 @@
#define DRVBB232_C
#include <vxWorks.h>
#include <types.h>
#if 0 /* COMMENTED OUT SOME INCLUDES */
#include <iosLib.h>
#include <taskLib.h>
#include <memLib.h>
#include <semLib.h>
#include <wdLib.h>
#include <wdLib.h>
#include <tickLib.h>
#include <vme.h>
#endif /* COMMENTED OUT SOME INCLUDES */
#include <stdlib.h>
#include <stdio.h>
#include <task_params.h>
@@ -241,12 +232,13 @@ static long
genLink(p)
msgDrvGenLParm *p;
{
char name[20];
char message[100];
drvBB232Link *pdrvBB232Link;
if (drvBB232Debug)
printf("BB232 genLink, link = %d, node = %d\n", p->plink->value.bitbusio.link, p->plink->value.bitbusio.node, p->plink->value.bitbusio.port);
printf("BB232 genLink, link = %d, node = %d port = %d\n",
p->plink->value.bitbusio.link, p->plink->value.bitbusio.node,
p->plink->value.bitbusio.port);
switch (p->op) {
case MSG_GENLINK_CREATE:
@@ -351,7 +343,7 @@ ioctlCommand *p;
}
if (drvBB232Debug)
printf("drvBB232.control: bad command 0x%02.2X\n", p->cmd);
printf("drvBB232.control: bad command 0x%2.2X\n", p->cmd);
return(ERROR);
}
@@ -422,7 +414,7 @@ msgStrParm *pwrParm;
if ((pdpvtBitBusHead->status != BB_OK) || (pdpvtBitBusHead->rxMsg.cmd & 1))
{
if (drvBB232Debug)
printf("BB232 write error on link %d, node %d, port %d, driver %02.2X, message %02.2X\n", pdrvBB232Link->link, pdrvBB232Link->node, pdrvBB232Link->port, pdpvtBitBusHead->status, pdpvtBitBusHead->rxMsg.cmd);
printf("BB232 write error on link %d, node %d, port %d, driver %2.2X, message %2.2X\n", pdrvBB232Link->link, pdrvBB232Link->node, pdrvBB232Link->port, pdpvtBitBusHead->status, pdpvtBitBusHead->rxMsg.cmd);
pxact->status = XACT_IOERR;
}
@@ -450,7 +442,6 @@ msgStrParm *prdParm;
struct dpvtBitBusHead *pdpvtBitBusHead = (struct dpvtBitBusHead *) pxact->p;
int len = prdParm->len;
int loopLen = 0;
unsigned char *tmp = pdpvtBitBusHead->rxMsg.data;
/* check if data already loaded into pdpvtBitBusHead->rxMsg */
if ((pdpvtBitBusHead->rxMsg.length > BB_MSG_HEADER_SIZE) && (pdpvtBitBusHead->status == BB_OK))

View File

@@ -32,10 +32,10 @@
*/
#include <vxWorks.h>
#include <types.h>
#include <stdlib.h>
#include <stdio.h>
#include <iosLib.h>
#include <taskLib.h>
#include <memLib.h>
#include <semLib.h>
#include <wdLib.h>
#include <wdLib.h>

View File

@@ -48,6 +48,11 @@ static char SccsId[] = "@(#)drvBb902.c 1.6 9/14/92 ";
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vxLib.h>
#include <sysLib.h>
#include <vme.h>
#include <module_types.h>
#include <drvSup.h>
@@ -67,7 +72,6 @@ struct {
static long report(level)
int level;
{
int i;
bb902_io_report(level);
return(0);
@@ -75,7 +79,6 @@ static long report(level)
static long init()
{
int status;
bb902_driver_init();
return(0);
@@ -174,7 +177,6 @@ unsigned short card;
unsigned int mask;
unsigned int *pval;
{
unsigned int work;
/* verify card exists */
if (!pbo_bb902s[card]) return (-1);
@@ -195,7 +197,7 @@ void bb902_io_report(level)
if (pbo_bb902s[card]){
value = (pbo_bb902s[card]->high_value << 16)
+ pbo_bb902s[card]->low_value;
printf("BO: BB902: card %d value=0x%08.8x\n",card,value);
printf("BO: BB902: card %d value=0x%8.8x\n",card,value);
}
}

View File

@@ -49,6 +49,10 @@
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vxLib.h>
#include <sysLib.h>
#include <vme.h>
#include <module_types.h>
#include <drvSup.h>
@@ -68,14 +72,12 @@ struct {
static long report(level)
int level;
{
register int i;
bb910_io_report(level);
return(0);
}
static long init()
{
int status;
bb910_driver_init();
return(0);
@@ -109,7 +111,7 @@ static char *bb910_shortaddr;
* intialization for the binary input cards
*/
bb910_driver_init(){
int bb910_driver_init(){
int bimode;
int status;
register short i;
@@ -146,7 +148,7 @@ bb910_driver_init(){
}
bb910_driver(card,mask,prval)
int bb910_driver(card,mask,prval)
register unsigned short card;
unsigned int mask;

View File

@@ -65,6 +65,9 @@
* This driver currently needs work on error message generation.
*
* $Log$
* Revision 1.4 1997/03/13 16:57:49 mrk
* Test version to diagnose bitbus problems
*
* Revision 1.3 1996/05/03 19:04:44 winans
* Fixed a reversed set of parms to a semBCreate().
* Changed the data type of a parameter to memory probe call.
@@ -106,10 +109,11 @@
*/
#include <vxWorks.h>
#include <types.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iosLib.h>
#include <taskLib.h>
#include <memLib.h>
#include <semLib.h>
#include <rngLib.h>
#include <wdLib.h>
@@ -118,11 +122,8 @@
#include <iv.h>
#include <rebootLib.h>
#include <logLib.h>
#include <sysLib.h>
#include <intLib.h>
#include <stdio.h>
#include <vxLib.h>
#include <string.h>
#include <task_params.h>
#include <module_types.h>
@@ -2554,6 +2555,7 @@ STATIC int pepTxTask(int link)
PepLink3ConsecutiveDelay++;
break;
default:
break;
}
/* End unpleasant patch */

View File

@@ -69,8 +69,9 @@ static char *sccsID = "@(#)drvComet.c 1.11\t9/16/92";
*
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <iv.h>
#include <types.h>
#include <module_types.h>
#include <task_params.h>
#include <fast_lock.h>
@@ -83,7 +84,6 @@ static char *sccsID = "@(#)drvComet.c 1.11\t9/16/92";
#define COMET_NCHAN 4
#define COMET_CHANNEL_MEM_SIZE 0x20000 /* bytes */
#define COMET_DATA_MEM_SIZE (COMET_CHANNEL_MEM_SIZE*COMET_NCHAN)
static char *shortaddr;
static short scan_control; /* scan type/rate (if >0 normal, <=0 external control) */
/* comet conrtol register map */
@@ -185,7 +185,6 @@ cometDoneTask()
{
register unsigned card;
register struct comet_config *pconfig;
register long i;
while(TRUE)
{
@@ -287,7 +286,7 @@ cometDoneTask()
* intialize the driver for the COMET digitizer from omnibyte
*
*/
comet_init()
int comet_init()
{
register struct comet_config *pconfig;
short readback,got_one,card;
@@ -308,18 +307,18 @@ comet_init()
if (pcomet_config == 0)
{
logMsg("\nCOMET: Couldn't allocate memory for the configuration data");
return;
return(0);
}
}
/* get the standard and short address locations */
if ((status = sysBusToLocalAdrs(VME_AM_SUP_SHORT_IO,wf_addrs[COMET],&pcomet_cr)) != OK){
logMsg("\nCOMET: failed to map VME A16 base address\n");
return;
return(0);
}
if ((status = sysBusToLocalAdrs(VME_AM_EXT_SUP_DATA,wf_memaddrs[COMET],&extaddr)) != OK){
logMsg("\nCOMET: failed to map VME A32 base address\n");
return;
return(0);
}
/* determine which cards are present */
@@ -376,6 +375,7 @@ comet_init()
cometDoneTaskId = taskSpawn("cometWFTask",WFDONE_PRI,WFDONE_OPT,WFDONE_STACK,(FUNCPTR) cometDoneTask);
taskwdInsert(cometDoneTaskId,NULL,NULL);
}
return(0);
}
@@ -400,7 +400,7 @@ static long init()
* initiate waveform read
*
*/
comet_driver(card, signal, pcbroutine, parg, nelements)
int comet_driver(card, signal, pcbroutine, parg, nelements)
register short card;
register unsigned short signal;
unsigned int *pcbroutine;
@@ -409,8 +409,6 @@ unsigned long nelements;
{
register struct comet_cr *pcomet_csr;
register struct comet_config *pconfig;
register unsigned short *pcomet_data;
register char *dummy;
/* printf("comet_driver: BEGIN...\n"); */
/* printf("comet_driver: nelements: %d ...\n",nelements); */
@@ -485,7 +483,7 @@ unsigned long nelements;
*
* print status for all cards in the specified COMET address range
*/
comet_io_report(level)
int comet_io_report(level)
short int level;
{
struct comet_config *pconfig;
@@ -566,12 +564,11 @@ unsigned n;
* controls and reports operating mode
*
*/
comet_mode(card,mode,arg,val)
int comet_mode(card,mode,arg,val)
short card;
unsigned short mode, arg, val;
{
unsigned char *cptr;
int i;
if (card >= wf_num_cards[COMET])
return ERROR;
@@ -614,7 +611,7 @@ unsigned short mode, arg, val;
}
/*********************************************/
cometGetioscanpvt(card,scanpvt)
int cometGetioscanpvt(card,scanpvt)
short card;
IOSCANPVT *scanpvt;
{

View File

@@ -56,9 +56,13 @@
* .17 04-09-96 ric Added SM_FIND_LIMIT, SM_FIND_HOME
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vme.h>
#include <sysLib.h>
#include <semLib.h> /* library for semaphore support */
#include <intLib.h> /* library for semaphore support */
#include <vxLib.h> /* library for semaphore support */
#include <rebootLib.h> /* library for semaphore support */
#include <wdLib.h>
#include <rngLib.h> /* library for ring buffer support */
@@ -388,10 +392,9 @@ struct motor_data compu_motor_data_array[MAX_COMPU_MOTORS];
* is returned to the database library layer every .1 second while a motor
* is moving
*/
compu_resp_task()
int compu_resp_task()
{
unsigned char resp[RESPBUF_SZ];
register short i;
register struct motor_data *pmotor_data;
FOREVER {
@@ -477,7 +480,7 @@ char compu_pos_reqs[] = { SM_GET_ABS_ENC, SM_GET_Z_REL_POS, SM_GET_MOV_STAT };
* task to solicit currnet status from the compumotor 1830 cards while they
* are active
*/
compu_task()
int compu_task()
{
register short inactive_count;
register short card;
@@ -518,7 +521,7 @@ compu_task()
*
* interrupt vector for the compumotor 1830 card
*/
compu_intr(mdnum)
int compu_intr(mdnum)
register int mdnum;
{
register struct compumotor *pmtr; /* memory port to motor card */
@@ -633,7 +636,7 @@ short trigger = 0;
*
* driver interface to the database library layer
*/
compu_driver(card, channel, value_flag,arg1,arg2)
int compu_driver(card, channel, value_flag,arg1,arg2)
register short card;
short channel;
short value_flag;
@@ -771,7 +774,7 @@ register int arg2;
* send a message to the compumotor 1830
*/
int wait_count;
compu_send_msg(pmotor,pmsg,count)
int compu_send_msg(pmotor,pmsg,count)
register struct compumotor *pmotor;
register char *pmsg;
register short count;
@@ -798,6 +801,7 @@ register short count;
pmotor->cm_cb = SND_MORE;
}
}
return(0);
}
@@ -827,7 +831,6 @@ long compu_sm_io_report(level)
VOID compu_sm_stat(compu_num)
short int compu_num;
{
struct motor_data *pmotor_data;
printf("\tCW limit = %d\t,CCW limit = %d\tMoving = %d\tDirection = %d\n",
compu_motor_data_array[compu_num].cw_limit,
compu_motor_data_array[compu_num].ccw_limit,

View File

@@ -122,6 +122,9 @@
* for the DMA buffer that is appropriate.
*
* $Log$
* Revision 1.2 1995/09/01 14:36:35 winans
* Added ability to change default clock speed from shell.
*
* Revision 1.1 1995/03/30 19:35:14 jba
* Seperated drv files into ansi and old dirs. Added combine dir.
*
@@ -139,8 +142,12 @@
static char *SccsId = "$Id$";
#include <vxWorks.h>
#include <stdioLib.h>
#include <stdlib.h>
#include <stdio.h>
#include <vme.h>
#include <rebootLib.h>
#include <intLib.h>
#include <taskLib.h>
#include <dbDefs.h>
#include <drvSup.h>
#include <module_types.h>
@@ -378,7 +385,6 @@ dvx_int(struct dvx_rec *dvxptr)
static short i, junk;
register struct dvx_2502 *cptr;
static unsigned int tick, t, intlev;
cptr = dvxptr->pdvx2502;
cptr->dma_point = DMA_CSR;
@@ -507,7 +513,6 @@ LOCAL long dvx_driver_init(void)
int j;
int status;
unsigned short card_id;
short *ramptr;
struct dvx_inbuf *ibptr;
struct dvx_inbuf *ibptra;
int intvec = DVX_IVEC0;
@@ -739,6 +744,7 @@ LOCAL int muxtst(int card)
taskDelay(sysClkRateGet()); /* let test run */
dvx[card].pdvx2502->csr = dvx[card].csr_shadow;
dvx[card].pdvx2502->thresh = 0; /* restore threshold */
return(0);
}
/*
@@ -779,9 +785,6 @@ LOCAL int muxtst(int card)
int
dvx_program(int card, int board, unsigned long mask, int dmaSize, int gain)
{
int i;
unsigned long maskCheck;
int numSamp;
static int firstTime = 1;
if (dvxOnline)
@@ -791,18 +794,18 @@ dvx_program(int card, int board, unsigned long mask, int dmaSize, int gain)
}
if ((card < 0) || (card > ai_num_cards[DVX2502]))
{
printf("dvx_program(%d, %d, 0x%08.8X): invalid card number specified\n", card, board, mask);
printf("dvx_program(%d, %d, 0x%8.8X): invalid card number specified\n", card, board, mask);
return(1);
}
if ((board < 0) || (board > 7))
{
printf("dvx_program(%d, %d, 0x%08.8X): invalid board number specified\n", card, board, mask);
printf("dvx_program(%d, %d, 0x%8.8X): invalid board number specified\n", card, board, mask);
return(2);
}
if ((gain < 0) || (gain > 3))
{
errPrintf(-1, __FILE__, __LINE__,
"dvx_program(%d, %d, 0x%08.8X, %d, %d): invalid gain specified\n", card, board,
"dvx_program(%d, %d, 0x%8.8X, %d, %d): invalid gain specified\n", card, board,
mask, dmaSize, gain);
return(2);
}
@@ -931,6 +934,7 @@ int sramld(int card)
dvx[card].pdvx2502->csr = dvx[card].csr_shadow | CSR_M_START;
taskDelay(sysClkRateGet()); /* let scan run */
dvx[card].pdvx2502->csr = dvx[card].csr_shadow; /* restore csr */
return(0);
}
@@ -946,7 +950,6 @@ int chan,
short *pval
)
{
short ival;
if ((card >= ai_num_cards[DVX2502]) || (card < 0)) /* make sure hardware exists */
return -1;
@@ -970,7 +973,7 @@ int dvxReadWf(int card, int start, int num, short *pwf, unsigned long *numRead)
int dataIndex;
if(dvxDebug)
printf("dvxReadWf(%d, %d, %d, 0x%08.8X, 0x%08.8X)\n", card, start, num, pwf, numRead);
printf("dvxReadWf(%d, %d, %d, 0x%8.8X, 0x%8.8X)\n", card, start, num, pwf, numRead);
*numRead = 0; /* in case we have an error condition */
@@ -1017,6 +1020,7 @@ int dvx_dread(int card,int chan)
volts = data * 10./32767. - 10;
printf("channel # %d\tdata = %x\tvolts = %f\n"
,chan,data,volts);
return(0);
}
@@ -1029,7 +1033,6 @@ int dvx_dread(int card,int chan)
int dvx_dump(int card,int firstchan,int lastchan)
{
int i, port, ix, printing, tmp;
short unsigned data;
unsigned long mask;
float volts;
@@ -1067,7 +1070,7 @@ int dvx_dump(int card,int firstchan,int lastchan)
tmp &= 0x0000ffff;
volts = tmp * 10./32767.;
printf("signal %2d, board %d, port %2d, data 0x%04.4X, voltage %f\n", ix, i, port, tmp, volts);
printf("signal %2d, board %d, port %2d, data 0x%4.4X, voltage %f\n", ix, i, port, tmp, volts);
}
ix++;
@@ -1084,7 +1087,7 @@ int dvx_dump(int card,int firstchan,int lastchan)
return 0;
}
dvx_getioscanpvt(int card, IOSCANPVT *scanpvt)
int dvx_getioscanpvt(int card, IOSCANPVT *scanpvt)
{
if ((card >= ai_num_cards[DVX2502]) || (card < 0))return(0);
if (dvx[card].pdvx2502 == 0) return(0);
@@ -1101,7 +1104,6 @@ dvx_getioscanpvt(int card, IOSCANPVT *scanpvt)
long dvx_io_report(int level)
{
short int i;
unsigned short card_id;
for (i = 0; i < ai_num_cards[DVX2502]; i++){
if (!dvx[i].pdvx2502)
@@ -1150,7 +1152,7 @@ LOCAL int dvx_fempty(int card)
}
LOCAL dvx_dma_reset(struct dvx_2502 *dev)
LOCAL int dvx_dma_reset(struct dvx_2502 *dev)
{
dev->dma_point = DMA_CSR;
dev->dma_data = CMR_RESET; /* reset the thing */
@@ -1165,11 +1167,11 @@ LOCAL dvx_dma_reset(struct dvx_2502 *dev)
* local to A24 bus addr conversions below are necessary on processors
* that dont place the local base for A24 on an even 16 MB boundary
*/
LOCAL dvx_dma_init(struct dvx_rec *ptr)
LOCAL int dvx_dma_init(struct dvx_rec *ptr)
{
int i, j;
int i;
int status;
short *cptr, *cptra, *cptr0, *pext;
short *cptr, *cptra, *cptr0;
short *BusPtr;
struct dvx_2502 *dev;
struct dvx_inbuf *bpnt;

View File

@@ -35,7 +35,8 @@
*
*/
#include <vxWorks.h>
#include <stdioLib.h>
#include <stdlib.h>
#include <stdio.h>
#include <rebootLib.h>
#include <drvEpvxi.h>

View File

@@ -91,6 +91,10 @@
static char *sccsId = "@(#)drvFp.c 1.12\t6/4/93";
#include "vxWorks.h"
#include "stdlib.h"
#include "stdio.h"
#include "intLib.h"
#include "rebootLib.h"
#include "vme.h"
#include "taskLib.h"
#include <iv.h> /* in h/68k if this is compiling for a 68xxx */
@@ -115,6 +119,7 @@ struct {
static long report()
{
fp_io_report();
return(0);
}
static long init()
@@ -198,7 +203,7 @@ static void fp_reboot();
* interrupt service routine
*
*/
fp_int(card)
int fp_int(card)
unsigned card;
{
register struct fp_rec *ptr = &fp[card];
@@ -236,6 +241,7 @@ unsigned card;
ptr->int_num++; /* log interrupt */
regptr->csr |= CSR_RST; /* clear status and rearm */
regptr->csr ^= CSR_RST;
return(0);
}
@@ -246,7 +252,7 @@ unsigned card;
*
*
*/
fp_init(addr)
int fp_init(addr)
unsigned int addr;
{
int i;
@@ -356,10 +362,9 @@ void fp_reboot()
* (toggles the interrupt enable - joh)
*
*/
fp_en(card)
int fp_en(card)
short card;
{
unsigned short temp;
if (card < 0 || (card > fp_num))
return -1;
@@ -376,7 +381,7 @@ short card;
* set interrupt reporting mode
*
*/
fp_mode(card,mode)
int fp_mode(card,mode)
short card, mode;
{
if (card < 0 || (card > fp_num))
@@ -390,7 +395,7 @@ fp_mode(card,mode)
* read current local inputs and enable switches
*
*/
fp_srd(card,option)
int fp_srd(card,option)
short card;
short option;
{
@@ -406,7 +411,7 @@ fp_srd(card,option)
* read latched local inputs
*
*/
fp_frd(card)
int fp_frd(card)
short card;
{
if (card < 0 || (card > fp_num))
@@ -419,7 +424,7 @@ fp_frd(card)
* read csr contents
*
*/
fp_csrd(card)
int fp_csrd(card)
short card;
{
if (card < 0 || (card > fp_num))
@@ -432,7 +437,7 @@ fp_csrd(card)
* epics interface to fast protect
*
*/
fp_driver(card,mask,prval)
int fp_driver(card,mask,prval)
register unsigned short card;
unsigned int mask;
register unsigned int *prval;
@@ -451,7 +456,7 @@ fp_driver(card,mask,prval)
* command line interface to fp_driver
*
*/
fp_read(card)
int fp_read(card)
short card;
{
unsigned int fpval,ret;
@@ -470,7 +475,7 @@ fp_read(card)
* dump fast protect status to console
*
*/
fp_dump()
int fp_dump()
{
int i;
@@ -487,11 +492,11 @@ fp_dump()
* monitor fast protect cards and report failures to console
*
*/
fp_mon()
void fp_mon()
{
for(semTake(fp_semid,WAIT_FOREVER);fp_dump() != 0;semTake(fp_semid,WAIT_FOREVER));
}
fp_monitor()
int fp_monitor()
{
static char *name = "fpmon";
int tid;
@@ -506,7 +511,7 @@ fp_monitor()
return 0;
}
fp_io_report(level)
int fp_io_report(level)
int level;
{
int i;
@@ -514,9 +519,10 @@ int level;
for(i=0; i<=fp_num; i++){
printf("BI: AT8-FP-S: card %d\n", i);
}
return(0);
}
fp_getioscanpvt(card,scanpvt)
int fp_getioscanpvt(card,scanpvt)
short card;
IOSCANPVT *scanpvt;
{

View File

@@ -83,8 +83,13 @@
static char *sccsId = "@(#)drvFpm.c 1.12\t8/4/93";
#include "vxWorks.h"
#include "vme.h"
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <rebootLib.h>
#include <intLib.h>
#include <vxLib.h>
#include <vme.h>
#include <iv.h> /* in h/68k if this is compiling for a 68xxx */
#include "module_types.h"
#include <dbDefs.h>
@@ -104,6 +109,7 @@ struct {
static long report()
{
fpm_io_report();
return(0);
}
static long init()
@@ -173,7 +179,7 @@ static void fpm_reboot();
* interrupt service routine
*
*/
fpm_int(ptr)
int fpm_int(ptr)
register struct fpm_rec *ptr;
{
register struct fp10m *regptr;
@@ -190,6 +196,7 @@ fpm_int(ptr)
break;
}
ptr->int_num++;
return(0);
}
/*
* fpm_init
@@ -197,7 +204,7 @@ fpm_int(ptr)
* initialization for fp10m fast protect master modules
*
*/
fpm_init(addr)
int fpm_init(addr)
unsigned int addr;
{
int i;
@@ -290,7 +297,7 @@ void fpm_reboot()
* (toggles the int enable state - joh)
*
*/
fpm_en(card)
int fpm_en(card)
short card;
{
if (card < 0 || (card > fpm_num))
@@ -308,7 +315,7 @@ fpm_en(card)
* set interrupt reporting mode
*
*/
fpm_mode(card,mode)
int fpm_mode(card,mode)
short card, mode;
{
if (card < 0 || (card > fpm_num))
@@ -322,7 +329,7 @@ fpm_mode(card,mode)
* carrier disable (1), enable (0)
*
*/
fpm_cdis(card,disable)
int fpm_cdis(card,disable)
short card, disable;
{
unsigned short temp;
@@ -341,7 +348,7 @@ fpm_cdis(card,disable)
* set failure mode
*
*/
fpm_fail(card,mode)
int fpm_fail(card,mode)
short card, mode;
{
unsigned short temp;
@@ -360,7 +367,7 @@ fpm_fail(card,mode)
* read status bits
*
*/
fpm_srd(card)
int fpm_srd(card)
short card;
{
if (card < 0 || ( card > fpm_num))
@@ -373,7 +380,7 @@ fpm_srd(card)
* epics interface to fast protect master
*
*/
fpm_driver(card,mask,prval)
int fpm_driver(card,mask,prval)
register unsigned short card;
unsigned int mask;
register unsigned int prval;
@@ -392,7 +399,7 @@ register unsigned int prval;
* command line interface to fpm_driver
*
*/
fpm_write(card,val)
int fpm_write(card,val)
short card;
unsigned int val;
{
@@ -404,7 +411,7 @@ fpm_write(card,val)
* read the current control register contents (readback)
*
*/
fpm_read(card,mask,pval)
int fpm_read(card,mask,pval)
register unsigned short card;
unsigned int mask;
register unsigned int *pval;
@@ -421,7 +428,7 @@ register unsigned int *pval;
* fpm_io_report()
*
*/
fpm_io_report(level)
int fpm_io_report(level)
int level;
{
int i;
@@ -429,4 +436,5 @@ int level;
for(i=0; i<=fpm_num; i++){
printf("BO: AT8-FP-M: card %d\n", i);
}
return(0);
}

View File

@@ -59,6 +59,10 @@
*
*
* $Log$
* Revision 1.6 1996/05/03 19:05:36 winans
* Added the EOS logic from Mark Rivers. (It is only supported for HiDEOS
* GPIB interfaces.)
*
* Revision 1.5 1996/03/06 14:17:34 mrk
* Made STATIC static
*
@@ -99,12 +103,14 @@
#define INCLUDE_HIDEOS_INTERFACE
#include <vxWorks.h>
#include <types.h>
#include <stdlib.h>
#include <stdio.h>
#include <sysLib.h>
#include <intLib.h>
#include <rebootLib.h>
#include <iosLib.h>
#include <taskLib.h>
#include <semLib.h>
#include <memLib.h>
#include <sysLib.h>
#include <iv.h>
#include <vme.h>
#include <wdLib.h>
@@ -329,7 +335,7 @@ reportGpib(void)
{
if (pNiLink[i])
{
printf("Link %d (address 0x%08.8X) present and initialized.\n", i, pNiLink[i]->ibregs);
printf("Link %d (address %p) present and initialized.\n", i, pNiLink[i]->ibregs);
printf(" total niGpibCmd() taskDelay() calls = %lu\n", pNiLink[i]->cmdSpins);
printf(" worst case delay in niGpibCmd() = %lu\n", pNiLink[i]->maxSpins);
}
@@ -359,7 +365,7 @@ STATIC void rebootFunc(void)
{
if (pNiLink[i] != NULL)
{
sprintf(msg, "GPIB link %d rebooting");
sprintf(msg, "GPIB link %d rebooting",i);
GpibDebug(&pNiLink[i]->ibLink, 0, msg, 1);
probeValue = 0;
vxMemProbe(&(pNiLink[i]->ibregs->ch1.ccr), WRITE, 1, (char *)&probeValue);
@@ -391,7 +397,6 @@ STATIC void rebootFunc(void)
initGpib(void)
{
int i;
int j;
int probeValue;
struct ibregs *pibregs;
char s;
@@ -415,9 +420,9 @@ initGpib(void)
if (ibDebug)
{
logMsg("Gpib NI1014 driver initializing\n");
logMsg("short_base 0x%08.8X\n", short_base);
logMsg("NIGPIB_SHORT_OFF 0x%08.8X\n", NIGPIB_SHORT_OFF);
logMsg("NIGPIB_NUM_LINKS 0x%08.8X\n", NIGPIB_NUM_LINKS);
logMsg("short_base %p\n", short_base);
logMsg("NIGPIB_SHORT_OFF 0x%8.8X\n", NIGPIB_SHORT_OFF);
logMsg("NIGPIB_NUM_LINKS 0x%8.8X\n", NIGPIB_NUM_LINKS);
}
/* When probing, send out a reset signal to reset the DMAC and the TLC */
@@ -434,13 +439,13 @@ initGpib(void)
pNiLink[i] = (struct niLink *) NULL;
if (ibDebug)
logMsg("Probing of address 0x%08.8X failed\n", pibregs);
logMsg("Probing of address %p failed\n", pibregs);
}
else
{ /* GPIB board found... reserve space for structures & reset the thing */
if (ibDebug)
logMsg("GPIB card found at address 0x%08.8X\n", pibregs);
logMsg("GPIB card found at address %p\n", pibregs);
if ((pNiLink[i] = (struct niLink *)malloc(sizeof(struct niLink))) == NULL)
{ /* This better never happen! */
@@ -567,7 +572,7 @@ initGpib(void)
STATIC int
niDumpDmac(int link)
{
logMsg("ch0: ccr=%02.2X csr=%02.2X cer=%02.2X mtc=%04.4X mar=%08.8X btc=%04.4X bar=%08.8X\n",
logMsg("ch0: ccr=%2.2X csr=%2.2X cer=%2.2X mtc=%4.4X mar=%8.8X btc=%4.4X bar=%8.8X\n",
pNiLink[link]->ibregs->ch0.ccr & 0xff,
pNiLink[link]->ibregs->ch0.csr & 0xff,
pNiLink[link]->ibregs->ch0.cer & 0xff,
@@ -576,7 +581,7 @@ niDumpDmac(int link)
pNiLink[link]->ibregs->ch0.btc & 0xffff,
niRdLong(&(pNiLink[link]->ibregs->ch0.bar)));
logMsg("ch1: ccr=%02.2X csr=%02.2X cer=%02.2X mtc=%04.4X mar=%08.8X btc=%04.4X bar=%08.8X\n",
logMsg("ch1: ccr=%2.2X csr=%2.2X cer=%2.2X mtc=%4.4X mar=%8.8X btc=%4.4X bar=%8.8X\n",
pNiLink[link]->ibregs->ch1.ccr & 0xff,
pNiLink[link]->ibregs->ch1.csr & 0xff,
pNiLink[link]->ibregs->ch1.cer & 0xff,
@@ -629,7 +634,7 @@ int link;
niDumpDmac(link);
logMsg("r_isr1=%02.2X r_isr2=%02.2X\n",
logMsg("r_isr1=%2.2X r_isr2=%2.2X\n",
pNiLink[link]->r_isr1 & 0xff,
pNiLink[link]->r_isr2 & 0xff);
@@ -746,7 +751,7 @@ int length;
spins = 0;
if (ibDebug)
logMsg("niGpibCmd(%d, 0x%08.8X, %d): command string >%s<\n", link, buffer, length, buffer);
logMsg("niGpibCmd(%d, 0x%8.8X, %d): command string >%s<\n", link, buffer, length, buffer);
tooLong = TOOLONG; /* limit to wait for ctrlr's command buffer */
pNiLink[link]->ibregs->auxmr = AUX_TCA; /* take control of the bus */
@@ -769,7 +774,7 @@ int length;
if (!(tooLong--))
{
/* errMsg() */
logMsg("niGpibCmd(%d, 0x%08.8X, %d): Timeout while writing command >%s<\n", link, buffer, length, buffer);
logMsg("niGpibCmd(%d, 0x%8.8X, %d): Timeout while writing command >%s<\n", link, buffer, length, buffer);
pNiLink[link]->ibregs->auxmr = AUX_GTS;
if (spins > pNiLink[link]->maxSpins)
pNiLink[link]->maxSpins = spins;
@@ -803,7 +808,7 @@ int length;
}
}
/* errMsg() */
logMsg("niGpibCmd(%d, 0x%08.8X, %d): Timeout after writing command >%s<\n", link, buffer, length, buffer);
logMsg("niGpibCmd(%d, 0x%8.8X, %d): Timeout after writing command >%s<\n", link, buffer, length, buffer);
pNiLink[link]->ibregs->auxmr = AUX_GTS;
if (spins > pNiLink[link]->maxSpins)
pNiLink[link]->maxSpins = spins;
@@ -825,7 +830,7 @@ int time;
int err;
if(ibDebug)
logMsg("niGpibRead(%d, 0x%08.8X, %d, %d)\n",link, buffer, length, time);
logMsg("niGpibRead(%d, 0x%8.8X, %d, %d)\n",link, buffer, length, time);
if (niCheckLink(link) == ERROR)
{
@@ -855,7 +860,7 @@ int time;
int err;
if(ibDebug)
logMsg("niGpibWrite(%d, 0x%08.8X, %d, %d)\n",link, buffer, length, time);
logMsg("niGpibWrite(%d, 0x%8.8X, %d, %d)\n",link, buffer, length, time);
if (niCheckLink(link) == ERROR)
{
@@ -927,7 +932,7 @@ caddr_t p;
int stat = OK;
if(ibDebug)
logMsg("niGpibIoctl(%d, %d, %d, %08.8X)\n",link, cmd, v, p);
logMsg("niGpibIoctl(%d, %d, %d, %8.8X)\n",link, cmd, v, p);
if (cmd != IBGENLINK && niCheckLink(link) == ERROR)
{
@@ -1350,7 +1355,7 @@ int link;
int lockKey;
if(ibDebug || ibSrqDebug)
logMsg("niSrqIntEnable(%d): ch0.csr = 0x%02.2X, gsr=0x%02.2X\n", link, pNiLink[link]->ibregs->ch0.csr, pNiLink[link]->ibregs->gsr);
logMsg("niSrqIntEnable(%d): ch0.csr = 0x%2.2X, gsr=0x%2.2X\n", link, pNiLink[link]->ibregs->ch0.csr, pNiLink[link]->ibregs->gsr);
lockKey = intLock(); /* lock out ints because something likes to glitch */
@@ -1386,7 +1391,7 @@ int link;
int lockKey;
if(ibDebug || ibSrqDebug)
logMsg("niSrqIntDisable(%d): ch0.csr = 0x%02.2X, gsr=0x%02.2X\n", link, pNiLink[link]->ibregs->ch0.csr, pNiLink[link]->ibregs->gsr);
logMsg("niSrqIntDisable(%d): ch0.csr = 0x%2.2X, gsr=0x%2.2X\n", link, pNiLink[link]->ibregs->ch0.csr, pNiLink[link]->ibregs->gsr);
lockKey = intLock(); /* lock out ints because something likes to glitch */
pNiLink[link]->ibregs->ch0.ccr = 0; /* Don't allow SRQ ints */
@@ -1418,7 +1423,7 @@ struct ibLink *plink;
int j;
if(ibDebug || bbibDebug)
logMsg("ibLinkInit(%08.8X): entered, type %d, link %d, bug %d\n", plink, plink->linkType, plink->linkId, plink->bug);
logMsg("ibLinkInit(%8.8X): entered, type %d, link %d, bug %d\n", plink, plink->linkType, plink->linkId, plink->bug);
#ifdef GPIB_SUPER_DEBUG
plink->History.Sem = semBCreate(SEM_Q_PRIORITY, SEM_FULL);
@@ -1458,7 +1463,7 @@ ibLinkStart(struct ibLink *plink)
char tName[20];
if (ibDebug || bbibDebug)
logMsg("ibLinkStart(%08.8X): entered for linkType %d, link %d\n", plink, plink->linkType, plink->linkId);
logMsg("ibLinkStart(%8.8X): entered for linkType %d, link %d\n", plink, plink->linkType, plink->linkId);
/* fire out an interface clear */
ioctlIb(plink->linkType, plink->linkId, plink->bug, IBIFC, -1, NULL);
@@ -1538,7 +1543,7 @@ struct ibLink *plink; /* a reference to the link structures covered */
/* send out a UNL and UNT to test-drive the link */
if (writeIbCmd(plink, "?_", 2) == ERROR)
{
logMsg("ibLinkTask(%08.08X): init failed for link type %d, link %d\n", plink->linkType, plink, plink->linkId);
logMsg("ibLinkTask(%8.08X): init failed for link type %d, link %d\n", plink->linkType, plink, plink->linkId);
return(ERROR);
}
@@ -1598,7 +1603,7 @@ struct ibLink *plink; /* a reference to the link structures covered */
{
ringData.device = pollAddress;
if (ibDebug || ibSrqDebug)
logMsg("ibLinkTask(%d, %d): device %d srq status = 0x%02.2X\n", plink->linkType, plink->linkId, pollAddress, ringData.status);
logMsg("ibLinkTask(%d, %d): device %d srq status = 0x%2.2X\n", plink->linkType, plink->linkId, pollAddress, ringData.status);
if (plink->srqHandler[ringData.device] != NULL)
{ /* there is a registered SRQ handler for this device */
rngBufPut(plink->srqRing, (char *) &ringData, sizeof(ringData));
@@ -1656,7 +1661,7 @@ struct ibLink *plink; /* a reference to the link structures covered */
if (pnode != NULL)
{
if (ibDebug)
logMsg("ibLinkTask(%d, %d): got Hi Pri xact, pnode= 0x%08.8X\n", plink->linkType, plink->linkId, pnode);
logMsg("ibLinkTask(%d, %d): got Hi Pri xact, pnode= 0x%8.8X\n", plink->linkType, plink->linkId, pnode);
plink->deviceStatus[pnode->device] = (*(pnode->workStart))(pnode);
working=1;
@@ -1678,7 +1683,7 @@ struct ibLink *plink; /* a reference to the link structures covered */
if (pnode != NULL)
{
if(ibDebug)
logMsg("ibLinkTask(%d, %d): got Lo Pri xact, pnode= 0x%08.8X\n", plink->linkType, plink->linkId, pnode);
logMsg("ibLinkTask(%d, %d): got Lo Pri xact, pnode= 0x%8.8X\n", plink->linkType, plink->linkId, pnode);
plink->deviceStatus[pnode->device] = (*(pnode->workStart))(pnode);
working=1;
}
@@ -1712,7 +1717,7 @@ int time;
if(verbose && (ibDebug || ibSrqDebug))
logMsg("pollIb(0x%08.8X, %d, %d, %d)\n", plink, gpibAddr, verbose, time);
logMsg("pollIb(0x%8.8X, %d, %d, %d)\n", plink, gpibAddr, verbose, time);
tsSave = timeoutSquelch;
timeoutSquelch = !verbose; /* keep the I/O routines quiet if desired */
@@ -1729,7 +1734,7 @@ int time;
status = pollResult[0];
if (ibDebug || ibSrqDebug)
{
logMsg("pollIb(%d, %d): poll status = 0x%02.2X\n", plink->linkId, gpibAddr, status);
logMsg("pollIb(%d, %d): poll status = 0x%2.2X\n", plink->linkId, gpibAddr, status);
}
}
@@ -1900,7 +1905,7 @@ int (*handler)(), /* Function invoked upon SRQ detection */
void *parm) /* So caller can have a parm passed back */
{
if(ibDebug || ibSrqDebug)
logMsg("registerSrqCallback(%08.8X, %d, 0x%08.8X, %08.8X)\n", pibLink, device, handler, parm);
logMsg("registerSrqCallback(%8.8X, %d, 0x%8.8X, %8.8X)\n", pibLink, device, handler, parm);
pibLink->srqHandler[device] = handler;
pibLink->srqParm[device] = parm;
@@ -1923,7 +1928,6 @@ ioctlIb(
int v,
void *p)
{
int stat;
if (linkType == GPIB_IO)
{
@@ -1936,7 +1940,7 @@ ioctlIb(
return(bbGpibIoctl(link, bug, cmd, v, p));
if (ibDebug || bbibDebug)
logMsg("ioctlIb(%d, %d, %d, %d, %08.8X, %08.8X): invalid link type\n", linkType, link, bug, cmd, v, p);
logMsg("ioctlIb(%d, %d, %d, %d, %8.8X, %8.8X): invalid link type\n", linkType, link, bug, cmd, v, p);
return(ERROR);
}
@@ -1963,7 +1967,7 @@ int prio)
if (pdpvt->pibLink == NULL)
{
logMsg("qGpibReq(%08.8X, %d): dpvt->pibLink == NULL!\n", pdpvt, prio);
logMsg("qGpibReq(%8.8X, %d): dpvt->pibLink == NULL!\n", pdpvt, prio);
return(ERROR);
}
@@ -1981,11 +1985,11 @@ int prio)
semGive(pdpvt->pibLink->linkEventSem);
break;
default: /* invalid priority */
logMsg("invalid priority requested in call to qgpibreq(%08.8X, %d)\n", pdpvt, prio);
logMsg("invalid priority requested in call to qgpibreq(%8.8X, %d)\n", pdpvt, prio);
return(ERROR);
}
if (ibDebug)
logMsg("qgpibreq(0x%08.8X, %d): transaction queued\n", pdpvt, prio);
logMsg("qgpibreq(0x%8.8X, %d): transaction queued\n", pdpvt, prio);
return(OK);
}
@@ -2014,7 +2018,7 @@ int time)
int stat;
if(ibDebug || (bbibDebug & (pibLink->linkType == BBGPIB_IO)))
logMsg("writeIb(%08.8X, %d, 0x%08.8X, %d, %d)\n", pibLink, gpibAddr, data, length, time);
logMsg("writeIb(%8.8X, %d, 0x%8.8X, %d, %d)\n", pibLink, gpibAddr, data, length, time);
if (pibLink->linkType == GPIB_IO)
{
@@ -2090,7 +2094,7 @@ int eos) /* End-of-string character, -1 if none */
int stat;
if(ibDebug || (bbibDebug & (pibLink->linkType == BBGPIB_IO)))
logMsg("readIb(%08.8X, %d, 0x%08.8X, %d)\n", pibLink, gpibAddr, data, length);
logMsg("readIb(%8.8X, %d, 0x%8.8X, %d)\n", pibLink, gpibAddr, data, length);
if (pibLink->linkType == GPIB_IO)
{
@@ -2141,7 +2145,7 @@ int length) /* Number of bytes to write out */
{
if(ibDebug || (bbibDebug & (pibLink->linkType == BBGPIB_IO)))
logMsg("writeIbCmd(%08.8X, %08.8X, %d)\n", pibLink, data, length);
logMsg("writeIbCmd(%8.8X, %8.8X, %d)\n", pibLink, data, length);
if (pibLink->linkType == GPIB_IO)
{
@@ -2182,7 +2186,7 @@ int time;
int bytesRead;
char msg[150];
sprintf(msg, "bbGpibRead(%08.8X, %d, %08.8X, %d, %d): entered", pibLink, device, buffer, length, time);
sprintf(msg, "bbGpibRead(%p, %d, %p, %d, %d): entered", pibLink, device, buffer, length, time);
GpibDebug(pibLink, device, msg, 1);
bytesRead = 0;
@@ -2213,7 +2217,7 @@ int time;
}
semTake(*(bbdpvt.psyncSem), WAIT_FOREVER); /* wait for response */
sprintf(msg, "bbGpibRead(): %02.2X >%.13s< driver status 0x%02.2X", bbdpvt.rxMsg.cmd, bbdpvt.rxMsg.data, bbdpvt.status);
sprintf(msg, "bbGpibRead(): %2.2X >%.13s< driver status 0x%2.2X", bbdpvt.rxMsg.cmd, bbdpvt.rxMsg.data, bbdpvt.status);
GpibDebug(pibLink, device, msg, 1);
bbdpvt.txMsg.cmd = BB_IBCMD_READ; /* in case have more reading to do */
@@ -2250,7 +2254,7 @@ int time;
int bytesSent;
char msg[150];
sprintf(msg, "bbGpibWrite(%08.8X, %d, %08.8X, %d, %d): entered", pibLink, device, buffer, length, time);
sprintf(msg, "bbGpibWrite(%p, %d, %p, %d, %d): entered", pibLink, device, buffer, length, time);
GpibDebug(pibLink, device, msg, 1);
bytesSent = length; /* we either get an error or send them all */
@@ -2297,12 +2301,12 @@ int time;
{
bcopy(bbdpvt.txMsg.data, dbugBuf, bbdpvt.txMsg.length-7);
dbugBuf[bbdpvt.txMsg.length-7] = '\0';
logMsg("bbGpibWrite():sending %02.2X >%s<", bbdpvt.txMsg.cmd, dbugBuf);
logMsg("bbGpibWrite():sending %2.2X >%s<", bbdpvt.txMsg.cmd, dbugBuf);
}
#else
bcopy(bbdpvt.txMsg.data, dbugBuf, bbdpvt.txMsg.length-7);
dbugBuf[bbdpvt.txMsg.length-7] = '\0';
sprintf(msg, "bbGpibWrite():sending %02.2X >%s<", bbdpvt.txMsg.cmd, dbugBuf);
sprintf(msg, "bbGpibWrite():sending %2.2X >%s<", bbdpvt.txMsg.cmd, dbugBuf);
GpibDebug(pibLink, device, msg, 1);
#endif
@@ -2315,7 +2319,7 @@ int time;
semTake(*(bbdpvt.psyncSem), WAIT_FOREVER); /* wait for response */
sprintf(msg, " RAC status = 0x%02.2X driver status = 0x%02.2X", bbdpvt.rxMsg.cmd, bbdpvt.status);
sprintf(msg, " RAC status = 0x%2.2X driver status = 0x%2.2X", bbdpvt.rxMsg.cmd, bbdpvt.status);
GpibDebug(pibLink, device, msg, 1);
bbdpvt.txMsg.data += BB_MAX_DAT_LEN; /* in case there is more */
@@ -2343,7 +2347,7 @@ int length;
int bytesSent;
char msg[150];
sprintf(msg, "bbGpibCmd(%08.8X, %08.8X, %d): entered", pibLink, buffer, length);
sprintf(msg, "bbGpibCmd(%p, %p, %d): entered", pibLink, buffer, length);
GpibDebug(pibLink, 0, msg, 1);
bytesSent = length;
@@ -2484,7 +2488,7 @@ bbGpibIoctl(int link, int bug, int cmd, int v, caddr_t p)
unsigned char buf[BB_MAX_DAT_LEN];
if (ibDebug || bbibDebug)
logMsg("bbGpibIoctl(%d, %d, %d, %08.8X, %08.8X): called\n", link, bug, cmd, v, p);
logMsg("bbGpibIoctl(%d, %d, %d, %8.8X, %8.8X): called\n", link, bug, cmd, v, p);
/* No checkLink() is done, because findBBLink() is done when needed */
@@ -2568,7 +2572,7 @@ bbGpibIoctl(int link, int bug, int cmd, int v, caddr_t p)
*(struct ibLink **)p = &(findBBLink(link, bug)->ibLink);
break;
default:
logMsg("bbGpibIoctl(%d, %d, %d, %08.8X, %08.8X): invalid command requested\n", link, bug, cmd, v, p);
logMsg("bbGpibIoctl(%d, %d, %d, %8.8X, %8.8X): invalid command requested\n", link, bug, cmd, v, p);
}
return(stat);
}
@@ -2594,7 +2598,7 @@ int bug;
bbIbLink = bbIbLink->next;
}
if (ibDebug || bbibDebug)
logMsg("findBBLink(%d, %d): returning %08.8X\n", link, bug, bbIbLink);
logMsg("findBBLink(%d, %d): returning %8.8X\n", link, bug, bbIbLink);
return(bbIbLink);
}
@@ -2711,7 +2715,7 @@ STATIC HideosIbLinkStruct *findHiDEOSIbLink(int link)
pHideosIbLink = pHideosIbLink->pNext;
}
if (ibDebug)
logMsg("findHiDEOSIbLink(%d): returning %08.8X\n", link, pHideosIbLink);
logMsg("findHiDEOSIbLink(%d): returning %8.8X\n", link, pHideosIbLink);
return(pHideosIbLink);
}
@@ -2860,7 +2864,7 @@ HiDEOSGpibIoctl(int link, int cmd, int v, void *p)
int stat = ERROR;
if (ibDebug)
logMsg("HiDEOSGpibIoctl(%d, %d, %08.8X, %08.8X): called\n", link, cmd, v, p);
logMsg("HiDEOSGpibIoctl(%d, %d, %8.8X, %8.8X): called\n", link, cmd, v, p);
switch (cmd) {
case IBTMO: /* set timeout time for next transaction only */
@@ -2885,7 +2889,7 @@ HiDEOSGpibIoctl(int link, int cmd, int v, void *p)
*(struct ibLink **)p = &(findHiDEOSIbLink(link)->ibLink);
break;
default:
logMsg("HiDEOSGpibIoctl(%d, %d, %08.8X, %08.8X): invalid command requested\n", link, cmd, v, p);
logMsg("HiDEOSGpibIoctl(%d, %d, %8.8X, %8.8X): invalid command requested\n", link, cmd, v, p);
}
return(stat);
}

View File

@@ -72,11 +72,10 @@ static char *sccsID = "@(#)drvJgvtr1.c 1.17\t9/9/93";
/* drvJgvtr1.c - Driver Support Routines for Jgvtr1 */
#include <vxWorks.h>
#include <types.h>
#include <stdlib.h>
#include <stdio.h>
#include <vme.h>
#include <iv.h>
#include <sysLib.h>
#include <stdioLib.h>
#include <dbDefs.h>
#include <drvSup.h>

View File

@@ -34,17 +34,8 @@
*/
#include <vxWorks.h>
#include <types.h>
#if 0 /* COMMENTED OUT SOME INCLUDES */
#include <iosLib.h>
#include <taskLib.h>
#include <memLib.h>
#include <semLib.h>
#include <wdLib.h>
#include <wdLib.h>
#include <tickLib.h>
#include <vme.h>
#endif /* COMMENTED OUT SOME INCLUDES */
#include <stdlib.h>
#include <stdio.h>
#include <alarm.h>
@@ -170,7 +161,7 @@ msgDset *pdset;
initParms.pdset = pdset;
if (msgDebug)
printf("Message init routine entered %d, 0x%08.8X\n", parm, pdset);
printf("Message init routine entered %d, %p\n", parm, pdset);
if(pdset->pparmBlock->pdrvBlock->drvIoctl != NULL)
return((*(pdset->pparmBlock->pdrvBlock->drvIoctl))(MSGIOCTL_INIT, &initParms));
@@ -181,7 +172,7 @@ msgDset *pdset;
/******************************************************************************
*
******************************************************************************/
drvMsg_xactListAddHead(plist, pnode)
int drvMsg_xactListAddHead(plist, pnode)
xactQueue *plist;
msgXact *pnode;
{
@@ -201,7 +192,7 @@ msgXact *pnode;
/******************************************************************************
*
******************************************************************************/
drvMsg_xactListAddTail(plist, pnode)
int drvMsg_xactListAddTail(plist, pnode)
xactQueue *plist;
msgXact *pnode;
{
@@ -221,7 +212,7 @@ msgXact *pnode;
/******************************************************************************
*
******************************************************************************/
drvMsg_xactListDel(plist, pnode)
int drvMsg_xactListDel(plist, pnode)
xactQueue *plist;
msgXact *pnode;
{
@@ -1011,7 +1002,6 @@ long
drvMsg_initAi(pai)
struct aiRecord *pai;
{
char message[100];
long status;
pai->dpvt = drvMsg_genXact(((struct msgDset *)(pai->dset))->pparmBlock, &(pai->inp), pai);
@@ -1068,7 +1058,6 @@ long
drvMsg_initBi(pbi)
struct biRecord *pbi;
{
char message[100];
long status;
pbi->dpvt = drvMsg_genXact(((struct msgDset *)(pbi->dset))->pparmBlock, &(pbi->inp), pbi);
@@ -1125,7 +1114,6 @@ long
drvMsg_initMi(pmi)
struct mbbiRecord *pmi;
{
char message[100];
long status;
pmi->dpvt = drvMsg_genXact(((struct msgDset *)(pmi->dset))->pparmBlock, &(pmi->inp), pmi);
@@ -1182,7 +1170,6 @@ long
drvMsg_initLi(pli)
struct longinRecord *pli;
{
char message[100];
long status;
pli->dpvt = drvMsg_genXact(((struct msgDset *)(pli->dset))->pparmBlock, &(pli->inp), pli);
@@ -1209,7 +1196,6 @@ long
drvMsg_initLo(plo)
struct longoutRecord *plo;
{
char message[100];
long status;
plo->dpvt = drvMsg_genXact(((struct msgDset *)(plo->dset))->pparmBlock, &(plo->out), plo);
@@ -1237,7 +1223,6 @@ long
drvMsg_initSi(psi)
struct stringinRecord *psi;
{
char message[100];
long status;
psi->dpvt = drvMsg_genXact(((struct msgDset *)(psi->dset))->pparmBlock, &(psi->inp), psi);
@@ -1264,7 +1249,6 @@ long
drvMsg_initSo(pso)
struct stringoutRecord *pso;
{
char message[100];
long status;
pso->dpvt = drvMsg_genXact(((struct msgDset *)(pso->dset))->pparmBlock, &(pso->out), pso);
@@ -1292,7 +1276,6 @@ long
drvMsg_initWf(pwf)
struct waveformRecord *pwf;
{
char message[100];
long status;
pwf->dpvt = drvMsg_genXact(((struct msgDset *)(pwf->dset))->pparmBlock, &(pwf->inp), pwf);

View File

@@ -73,8 +73,11 @@
/* drvOms.c - Driver Support Routines for Oms */
#include <vxWorks.h>
#include <stdioLib.h>
#include <sysLib.h> /* library for task support */
#include <stdlib.h>
#include <stdio.h>
#include <intLib.h>
#include <vxLib.h>
#include <rebootLib.h>
#include <taskLib.h>
#include <rngLib.h> /* library for ring buffer support */
#include <semLib.h>
@@ -106,12 +109,12 @@ static long report(level)
int level;
{
oms_io_report(level);
return(0);
}
static long init()
{
int status;
oms_driver_init();
return(0);
}
@@ -152,7 +155,7 @@ char read_buffer[MAX_OMS_CARDS][34];
VOID oms_reset();
oms_intr(card)
int oms_intr(card)
register short card;
{
register struct vmex_motor *pmotor;
@@ -215,7 +218,7 @@ short oms_state[MAX_OMS_CARDS];
char off_msg[40];
int oms_debug = 0;
int oms_compare = 3;
oms_resp_task()
int oms_resp_task()
{
unsigned char resp[OMS_MSG_SZ*4];
register struct motor_data *pmotor_data_array;
@@ -223,7 +226,7 @@ oms_resp_task()
short *pchannel;
int (*psmcb_routine)();
register short *pstate;
register short card,i;
register short card;
int temp;
FOREVER {
@@ -345,7 +348,7 @@ oms_resp_task()
}
}
oms_task()
int oms_task()
{
register short motor_active;
register short card,channel;
@@ -384,12 +387,11 @@ oms_task()
*
* initialize all oms drivers present
*/
oms_driver_init(){
int oms_driver_init(){
struct vmex_motor *pmotor;
short i,j,got_one;
int status;
short dummy;
char oms_init_msg[20];
int taskId;
for (i = 0; i < MAX_OMS_CARDS; i++){
@@ -479,7 +481,7 @@ oms_driver_init(){
* interface routine called from the database library
*/
#define MOTOR_POS 1
oms_driver(card,channel,value_flag,arg1,arg2)
int oms_driver(card,channel,value_flag,arg1,arg2)
register short card;
register short channel;
short value_flag;
@@ -596,7 +598,7 @@ int oms_count,oms_icount,oms_illcmd,oms_sleep,oms_isleep;
*
* Gives messages to the OMS card
*/
oms_send_msg(pmotor,pmsg)
int oms_send_msg(pmotor,pmsg)
struct vmex_motor *pmotor;
register char *pmsg;
{
@@ -631,9 +633,10 @@ i = 0;
}
/* release the mutual exclusion semaphore */
semGive(oms_send_sem);
return(0);
}
oms_io_report(level)
int oms_io_report(level)
short int level;
{
register short int i,j;
@@ -648,6 +651,7 @@ short int level;
}
}
return(0);
}
VOID oms_sm_stat(card,channel)

View File

@@ -34,18 +34,8 @@
#define DRVRS232_C
#include <vxWorks.h>
#include <types.h>
#if 0 /* COMMENTED OUT SOME INCLUDES */
#include <iosLib.h>
#include <taskLib.h>
#include <memLib.h>
#include <semLib.h>
#include <wdLib.h>
#include <wdLib.h>
#include <tickLib.h>
#include <vme.h>
#endif /* COMMENTED OUT SOME INCLUDES */
#include <stdlib.h>
#include <stdio.h>
#include <task_params.h>
#include <module_types.h>

View File

@@ -52,6 +52,9 @@
static char *sccsID = "@(#)drvVmi4100.c 1.5\t8/27/93";
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vxLib.h>
#include <vme.h>
#include <dbDefs.h>
#include <drvSup.h>
@@ -139,7 +142,7 @@ long vmi4100_init()
*
* VMI4100 analog output driver
*/
vmi4100_driver(card,chan,prval,prbval)
int vmi4100_driver(card,chan,prval,prbval)
register unsigned short card;
register unsigned short chan;
unsigned short *prval;
@@ -162,12 +165,11 @@ unsigned short *prbval;
*
* VME analog output driver
*/
vmi4100_read(card,chan,pval)
int vmi4100_read(card,chan,pval)
register unsigned short card;
register unsigned short chan;
unsigned short *pval;
{
register unsigned short *pcard;
/* check on the card and channel number as kept in module_types.h */

View File

@@ -40,6 +40,10 @@
static char *sccsID = "@(#)drvXy010.c 1.3\t6/3/93";
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <sysLib.h>
#include <vxLib.h>
#include <vme.h>
#include <drvSup.h>
@@ -163,7 +167,6 @@ char *pBase;
*/
long xy010_io_report(int level)
{
char id;
if(xy010_map()<0){
return ERROR;

View File

@@ -50,6 +50,10 @@
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vxLib.h>
#include <sysLib.h>
#include <vme.h>
#include <module_types.h>
#include <drvSup.h>
@@ -111,7 +115,7 @@ static char *xy210_addr;
*
* intialization for the binary input cards
*/
xy210_driver_init(){
int xy210_driver_init(){
int bimode;
int status;
register short i;
@@ -146,7 +150,7 @@ xy210_driver_init(){
*
* interface to the xy210 binary inputs
*/
xy210_driver(card, mask, prval)
int xy210_driver(card, mask, prval)
register unsigned short card;
unsigned int mask;
register unsigned int *prval;
@@ -179,7 +183,7 @@ void xy210_io_report(level)
if (pbi_xy210s[card]){
value = (pbi_xy210s[card]->high_value << 16) /* high */
+ pbi_xy210s[card]->low_value; /* low */
printf("BI: XY210: card %d value=0x%08.8x\n",card,value);
printf("BI: XY210: card %d value=0x%8.8x\n",card,value);
}
}
}

View File

@@ -49,6 +49,10 @@ static char SccsId[] = "@(#)drvXy220.c 1.6\t9/20/93";
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <sysLib.h>
#include <vxLib.h>
#include <vme.h>
#include "module_types.h"
#include <drvSup.h>
@@ -182,7 +186,6 @@ register unsigned short card;
unsigned int mask;
register unsigned int *pval;
{
register unsigned int work;
/* verify card exists */
if (!pbo_xy220s[card])
@@ -213,7 +216,7 @@ void xy220_io_report(level)
if (pbo_xy220s[card]){
value = (pbo_xy220s[card]->high_value << 16) /* high */
+ pbo_xy220s[card]->low_value; /* low */
printf("BO: XY220: card %d value=0x%08.8x\n",card,value);
printf("BO: XY220: card %d value=0x%8.8x\n",card,value);
}
}

View File

@@ -152,7 +152,7 @@ dio_int(ptr)
*task to check for change of state
*
*/
dio_scan()
int dio_scan()
{
int i;
@@ -193,7 +193,7 @@ dio_scan()
*
*initialize xy240 dig i/o card
*/
xy240_init()
int xy240_init()
{
short junk;
register short i;
@@ -261,7 +261,7 @@ xy240_init()
}
xy240_getioscanpvt(card,scanpvt)
int xy240_getioscanpvt(card,scanpvt)
short card;
IOSCANPVT *scanpvt;
{
@@ -277,7 +277,7 @@ IOSCANPVT *scanpvt;
*interface to binary inputs
*/
xy240_bi_driver(card,mask,prval)
int xy240_bi_driver(card,mask,prval)
register short card;
unsigned int mask;
register unsigned int *prval;
@@ -300,7 +300,7 @@ register unsigned int *prval;
*interface to binary outputs
*/
xy240_bo_read(card,mask,prval)
int xy240_bo_read(card,mask,prval)
register short card;
unsigned int mask;
register unsigned int *prval;
@@ -325,7 +325,7 @@ register unsigned int *prval;
*interface to binary outputs
*/
xy240_bo_driver(card,val,mask)
int xy240_bo_driver(card,val,mask)
register short card;
unsigned int mask;
register unsigned int val;
@@ -354,7 +354,7 @@ register unsigned int val;
*
*test routine for xy240 output
*/
dio_out(card,port,val)
int dio_out(card,port,val)
short card,port,val;
{
@@ -404,7 +404,7 @@ else{
*command line interface to test bo driver
*
*/
xy240_write(card,val)
int xy240_write(card,val)
short card;
unsigned int val;
{
@@ -429,15 +429,14 @@ short int level;
}
}
}
return(0);
}
void xy240_bi_io_report(int card)
{
short int num_chans,j,k,l,m,status;
int ival,jval,kval,lval,mval;
unsigned int *prval;
short int num_chans,j,k,l,m;
int jval,kval,lval,mval;
num_chans = XY240_MAX_CHANS;
@@ -481,9 +480,8 @@ void xy240_bi_io_report(int card)
void xy240_bo_io_report(int card)
{
short int num_chans,j,k,l,m,status;
int ival,jval,kval,lval,mval;
unsigned int *prval;
short int num_chans,j,k,l,m;
int jval,kval,lval,mval;
num_chans = XY240_MAX_CHANS;

View File

@@ -82,6 +82,10 @@
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <rebootLib.h>
#include <intLib.h>
#include <vme.h>
#include <dbDefs.h>
#include <dbScan.h>
@@ -132,6 +136,7 @@ static long report()
{
ai_xy566_io_report();
xy566_io_report();
return(0);
}
#define MAX_SE_CARDS (ai_num_cards[XY566SE])
@@ -257,9 +262,10 @@ static VOID rval_convert();
static VOID xy566_rval_report();
static acro_intr(ap)
static int acro_intr(ap)
register struct acroregs *ap;
{
return(0);
}
/* The following two subroutines introduce a delay between
@@ -275,14 +281,14 @@ unsigned short val;
*addr = val;
}
senb (addr, val)
void senb (addr, val)
unsigned char *addr;
unsigned char val;
{
*addr = val;
}
ai566_intr(i)
int ai566_intr(i)
short i;
{
register struct ai566 *ap;
@@ -293,7 +299,7 @@ short i;
/* reset the CSR - needed to allow next interrupt */
senw(&ap->a566_csr,XY566L_CSR);
return(0);
}
/*
@@ -620,7 +626,7 @@ register short ***pppmem_present;
return OK;
}
ai_xy566_getioscanpvt(card,scanpvt)
int ai_xy566_getioscanpvt(card,scanpvt)
unsigned short card;
IOSCANPVT *scanpvt;
{
@@ -628,7 +634,7 @@ IOSCANPVT *scanpvt;
return(0);
}
ai_xy566_driver(card,chan,type,prval)
int ai_xy566_driver(card,chan,type,prval)
register short card;
short chan;
register unsigned int type;
@@ -636,8 +642,6 @@ register unsigned short *prval;
{
/* the register short i is used to calculate the delay for the */
/* conversion of the XYCOM 566. Make sure it stays a register */
register unsigned short *pcard;
register unsigned short i;
/* check on the card and channel number as kept in module_types.h */
if (card >= ai_num_cards[type]) return(-1);
@@ -647,7 +651,6 @@ register unsigned short *prval;
case (XY566SE):
{
register struct ai566 *pai566;
/* check card specified exists */
if (pai_xy566se[card] == 0) return(-1);
@@ -660,7 +663,6 @@ register unsigned short *prval;
case (XY566DI):
{
register struct ai566 *pai566;
/* check card specified exists */
if (pai_xy566di[card] == 0) return(-1);
@@ -675,7 +677,6 @@ register unsigned short *prval;
case (XY566DIL):
{
register struct ai566 *pai566;
/* check card specified exists */
if (pai_xy566dil[card] == 0) return(-1);
@@ -755,8 +756,7 @@ VOID xy566_reset(){
long ai_xy566_io_report(level)
char level;
{
short i,j;
unsigned short rval;
short i;
for (i = 0; i < MAX_SE_CARDS; i++){
@@ -798,7 +798,7 @@ long ai_xy566_io_report(level)
VOID xy566_rval_report(card,type)
short int card,type;
{
short i,j,k,l,m,num_chans;
short j,k,l,m,num_chans;
unsigned short jrval,krval,lrval,mrval;
printf("\n");
@@ -845,7 +845,7 @@ VOID xy566_rval_report(card,type)
* xy566_driver
*
*/
xy566_driver(slot,pcbroutine,parg)
int xy566_driver(slot,pcbroutine,parg)
register unsigned short slot;
register unsigned int *pcbroutine;
register unsigned int *parg; /* number of values read */
@@ -886,7 +886,7 @@ register unsigned int *parg; /* number of values read */
* polls the busy bit on the Xycom 566 latched waveform records
* The busy bit is set externally when data collection is completed
*/
xy566DoneTask()
int xy566DoneTask()
{
register unsigned int **pproutines;
register unsigned int (*pcbroutine)();
@@ -923,7 +923,7 @@ xy566DoneTask()
*
* intialize the xycom 566 waveform input card
*/
xy566_init()
int xy566_init()
{
register struct ai566 **pcards_present = pwf_xy566;
register struct wf085 **parms_present = pwf_xy085;
@@ -1135,7 +1135,7 @@ long
xy566_io_report(level)
short int level;
{
int i,xy566_bytes;
int i;
/* report all of the xy566 waveform inputs present */
for (i = 0; i < wf_num_cards[XY566WF]; i++)
@@ -1143,6 +1143,7 @@ short int level;
printf("WF: XY566: card %d\n",i);
}
return(0);
}

View File

@@ -32,7 +32,7 @@
#include <module_types.h>
module_types()
int module_types()
{
ai_num_cards[AB1771IL] = 12;

View File

@@ -69,8 +69,9 @@ static char *sccsID = "@(#)drvComet.c 1.11\t9/16/92";
*
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <iv.h>
#include <types.h>
#include <module_types.h>
#include <task_params.h>
#include <fast_lock.h>
@@ -83,7 +84,6 @@ static char *sccsID = "@(#)drvComet.c 1.11\t9/16/92";
#define COMET_NCHAN 4
#define COMET_CHANNEL_MEM_SIZE 0x20000 /* bytes */
#define COMET_DATA_MEM_SIZE (COMET_CHANNEL_MEM_SIZE*COMET_NCHAN)
static char *shortaddr;
static short scan_control; /* scan type/rate (if >0 normal, <=0 external control) */
/* comet conrtol register map */
@@ -185,7 +185,6 @@ cometDoneTask()
{
register unsigned card;
register struct comet_config *pconfig;
register long i;
while(TRUE)
{
@@ -287,7 +286,7 @@ cometDoneTask()
* intialize the driver for the COMET digitizer from omnibyte
*
*/
comet_init()
int comet_init()
{
register struct comet_config *pconfig;
short readback,got_one,card;
@@ -308,18 +307,18 @@ comet_init()
if (pcomet_config == 0)
{
logMsg("\nCOMET: Couldn't allocate memory for the configuration data");
return;
return(0);
}
}
/* get the standard and short address locations */
if ((status = sysBusToLocalAdrs(VME_AM_SUP_SHORT_IO,wf_addrs[COMET],&pcomet_cr)) != OK){
logMsg("\nCOMET: failed to map VME A16 base address\n");
return;
return(0);
}
if ((status = sysBusToLocalAdrs(VME_AM_EXT_SUP_DATA,wf_memaddrs[COMET],&extaddr)) != OK){
logMsg("\nCOMET: failed to map VME A32 base address\n");
return;
return(0);
}
/* determine which cards are present */
@@ -376,6 +375,7 @@ comet_init()
cometDoneTaskId = taskSpawn("cometWFTask",WFDONE_PRI,WFDONE_OPT,WFDONE_STACK,(FUNCPTR) cometDoneTask);
taskwdInsert(cometDoneTaskId,NULL,NULL);
}
return(0);
}
@@ -400,7 +400,7 @@ static long init()
* initiate waveform read
*
*/
comet_driver(card, signal, pcbroutine, parg, nelements)
int comet_driver(card, signal, pcbroutine, parg, nelements)
register short card;
register unsigned short signal;
unsigned int *pcbroutine;
@@ -409,8 +409,6 @@ unsigned long nelements;
{
register struct comet_cr *pcomet_csr;
register struct comet_config *pconfig;
register unsigned short *pcomet_data;
register char *dummy;
/* printf("comet_driver: BEGIN...\n"); */
/* printf("comet_driver: nelements: %d ...\n",nelements); */
@@ -485,7 +483,7 @@ unsigned long nelements;
*
* print status for all cards in the specified COMET address range
*/
comet_io_report(level)
int comet_io_report(level)
short int level;
{
struct comet_config *pconfig;
@@ -566,12 +564,11 @@ unsigned n;
* controls and reports operating mode
*
*/
comet_mode(card,mode,arg,val)
int comet_mode(card,mode,arg,val)
short card;
unsigned short mode, arg, val;
{
unsigned char *cptr;
int i;
if (card >= wf_num_cards[COMET])
return ERROR;
@@ -614,7 +611,7 @@ unsigned short mode, arg, val;
}
/*********************************************/
cometGetioscanpvt(card,scanpvt)
int cometGetioscanpvt(card,scanpvt)
short card;
IOSCANPVT *scanpvt;
{

View File

@@ -56,9 +56,13 @@
* .17 04-09-96 ric Added SM_FIND_LIMIT, SM_FIND_HOME
*/
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <vme.h>
#include <sysLib.h>
#include <semLib.h> /* library for semaphore support */
#include <intLib.h> /* library for semaphore support */
#include <vxLib.h> /* library for semaphore support */
#include <rebootLib.h> /* library for semaphore support */
#include <wdLib.h>
#include <rngLib.h> /* library for ring buffer support */
@@ -388,10 +392,9 @@ struct motor_data compu_motor_data_array[MAX_COMPU_MOTORS];
* is returned to the database library layer every .1 second while a motor
* is moving
*/
compu_resp_task()
int compu_resp_task()
{
unsigned char resp[RESPBUF_SZ];
register short i;
register struct motor_data *pmotor_data;
FOREVER {
@@ -477,7 +480,7 @@ char compu_pos_reqs[] = { SM_GET_ABS_ENC, SM_GET_Z_REL_POS, SM_GET_MOV_STAT };
* task to solicit currnet status from the compumotor 1830 cards while they
* are active
*/
compu_task()
int compu_task()
{
register short inactive_count;
register short card;
@@ -518,7 +521,7 @@ compu_task()
*
* interrupt vector for the compumotor 1830 card
*/
compu_intr(mdnum)
int compu_intr(mdnum)
register int mdnum;
{
register struct compumotor *pmtr; /* memory port to motor card */
@@ -633,7 +636,7 @@ short trigger = 0;
*
* driver interface to the database library layer
*/
compu_driver(card, channel, value_flag,arg1,arg2)
int compu_driver(card, channel, value_flag,arg1,arg2)
register short card;
short channel;
short value_flag;
@@ -771,7 +774,7 @@ register int arg2;
* send a message to the compumotor 1830
*/
int wait_count;
compu_send_msg(pmotor,pmsg,count)
int compu_send_msg(pmotor,pmsg,count)
register struct compumotor *pmotor;
register char *pmsg;
register short count;
@@ -798,6 +801,7 @@ register short count;
pmotor->cm_cb = SND_MORE;
}
}
return(0);
}
@@ -827,7 +831,6 @@ long compu_sm_io_report(level)
VOID compu_sm_stat(compu_num)
short int compu_num;
{
struct motor_data *pmotor_data;
printf("\tCW limit = %d\t,CCW limit = %d\tMoving = %d\tDirection = %d\n",
compu_motor_data_array[compu_num].cw_limit,
compu_motor_data_array[compu_num].ccw_limit,

View File

@@ -91,6 +91,10 @@
static char *sccsId = "@(#)drvFp.c 1.12\t6/4/93";
#include "vxWorks.h"
#include "stdlib.h"
#include "stdio.h"
#include "intLib.h"
#include "rebootLib.h"
#include "vme.h"
#include "taskLib.h"
#include <iv.h> /* in h/68k if this is compiling for a 68xxx */
@@ -115,6 +119,7 @@ struct {
static long report()
{
fp_io_report();
return(0);
}
static long init()
@@ -198,7 +203,7 @@ static void fp_reboot();
* interrupt service routine
*
*/
fp_int(card)
int fp_int(card)
unsigned card;
{
register struct fp_rec *ptr = &fp[card];
@@ -236,6 +241,7 @@ unsigned card;
ptr->int_num++; /* log interrupt */
regptr->csr |= CSR_RST; /* clear status and rearm */
regptr->csr ^= CSR_RST;
return(0);
}
@@ -246,7 +252,7 @@ unsigned card;
*
*
*/
fp_init(addr)
int fp_init(addr)
unsigned int addr;
{
int i;
@@ -356,10 +362,9 @@ void fp_reboot()
* (toggles the interrupt enable - joh)
*
*/
fp_en(card)
int fp_en(card)
short card;
{
unsigned short temp;
if (card < 0 || (card > fp_num))
return -1;
@@ -376,7 +381,7 @@ short card;
* set interrupt reporting mode
*
*/
fp_mode(card,mode)
int fp_mode(card,mode)
short card, mode;
{
if (card < 0 || (card > fp_num))
@@ -390,7 +395,7 @@ fp_mode(card,mode)
* read current local inputs and enable switches
*
*/
fp_srd(card,option)
int fp_srd(card,option)
short card;
short option;
{
@@ -406,7 +411,7 @@ fp_srd(card,option)
* read latched local inputs
*
*/
fp_frd(card)
int fp_frd(card)
short card;
{
if (card < 0 || (card > fp_num))
@@ -419,7 +424,7 @@ fp_frd(card)
* read csr contents
*
*/
fp_csrd(card)
int fp_csrd(card)
short card;
{
if (card < 0 || (card > fp_num))
@@ -432,7 +437,7 @@ fp_csrd(card)
* epics interface to fast protect
*
*/
fp_driver(card,mask,prval)
int fp_driver(card,mask,prval)
register unsigned short card;
unsigned int mask;
register unsigned int *prval;
@@ -451,7 +456,7 @@ fp_driver(card,mask,prval)
* command line interface to fp_driver
*
*/
fp_read(card)
int fp_read(card)
short card;
{
unsigned int fpval,ret;
@@ -470,7 +475,7 @@ fp_read(card)
* dump fast protect status to console
*
*/
fp_dump()
int fp_dump()
{
int i;
@@ -487,11 +492,11 @@ fp_dump()
* monitor fast protect cards and report failures to console
*
*/
fp_mon()
void fp_mon()
{
for(semTake(fp_semid,WAIT_FOREVER);fp_dump() != 0;semTake(fp_semid,WAIT_FOREVER));
}
fp_monitor()
int fp_monitor()
{
static char *name = "fpmon";
int tid;
@@ -506,7 +511,7 @@ fp_monitor()
return 0;
}
fp_io_report(level)
int fp_io_report(level)
int level;
{
int i;
@@ -514,9 +519,10 @@ int level;
for(i=0; i<=fp_num; i++){
printf("BI: AT8-FP-S: card %d\n", i);
}
return(0);
}
fp_getioscanpvt(card,scanpvt)
int fp_getioscanpvt(card,scanpvt)
short card;
IOSCANPVT *scanpvt;
{

View File

@@ -83,8 +83,13 @@
static char *sccsId = "@(#)drvFpm.c 1.12\t8/4/93";
#include "vxWorks.h"
#include "vme.h"
#include <vxWorks.h>
#include <stdlib.h>
#include <stdio.h>
#include <rebootLib.h>
#include <intLib.h>
#include <vxLib.h>
#include <vme.h>
#include <iv.h> /* in h/68k if this is compiling for a 68xxx */
#include "module_types.h"
#include <dbDefs.h>
@@ -104,6 +109,7 @@ struct {
static long report()
{
fpm_io_report();
return(0);
}
static long init()
@@ -173,7 +179,7 @@ static void fpm_reboot();
* interrupt service routine
*
*/
fpm_int(ptr)
int fpm_int(ptr)
register struct fpm_rec *ptr;
{
register struct fp10m *regptr;
@@ -190,6 +196,7 @@ fpm_int(ptr)
break;
}
ptr->int_num++;
return(0);
}
/*
* fpm_init
@@ -197,7 +204,7 @@ fpm_int(ptr)
* initialization for fp10m fast protect master modules
*
*/
fpm_init(addr)
int fpm_init(addr)
unsigned int addr;
{
int i;
@@ -290,7 +297,7 @@ void fpm_reboot()
* (toggles the int enable state - joh)
*
*/
fpm_en(card)
int fpm_en(card)
short card;
{
if (card < 0 || (card > fpm_num))
@@ -308,7 +315,7 @@ fpm_en(card)
* set interrupt reporting mode
*
*/
fpm_mode(card,mode)
int fpm_mode(card,mode)
short card, mode;
{
if (card < 0 || (card > fpm_num))
@@ -322,7 +329,7 @@ fpm_mode(card,mode)
* carrier disable (1), enable (0)
*
*/
fpm_cdis(card,disable)
int fpm_cdis(card,disable)
short card, disable;
{
unsigned short temp;
@@ -341,7 +348,7 @@ fpm_cdis(card,disable)
* set failure mode
*
*/
fpm_fail(card,mode)
int fpm_fail(card,mode)
short card, mode;
{
unsigned short temp;
@@ -360,7 +367,7 @@ fpm_fail(card,mode)
* read status bits
*
*/
fpm_srd(card)
int fpm_srd(card)
short card;
{
if (card < 0 || ( card > fpm_num))
@@ -373,7 +380,7 @@ fpm_srd(card)
* epics interface to fast protect master
*
*/
fpm_driver(card,mask,prval)
int fpm_driver(card,mask,prval)
register unsigned short card;
unsigned int mask;
register unsigned int prval;
@@ -392,7 +399,7 @@ register unsigned int prval;
* command line interface to fpm_driver
*
*/
fpm_write(card,val)
int fpm_write(card,val)
short card;
unsigned int val;
{
@@ -404,7 +411,7 @@ fpm_write(card,val)
* read the current control register contents (readback)
*
*/
fpm_read(card,mask,pval)
int fpm_read(card,mask,pval)
register unsigned short card;
unsigned int mask;
register unsigned int *pval;
@@ -421,7 +428,7 @@ register unsigned int *pval;
* fpm_io_report()
*
*/
fpm_io_report(level)
int fpm_io_report(level)
int level;
{
int i;
@@ -429,4 +436,5 @@ int level;
for(i=0; i<=fpm_num; i++){
printf("BO: AT8-FP-M: card %d\n", i);
}
return(0);
}

View File

@@ -72,11 +72,10 @@ static char *sccsID = "@(#)drvJgvtr1.c 1.17\t9/9/93";
/* drvJgvtr1.c - Driver Support Routines for Jgvtr1 */
#include <vxWorks.h>
#include <types.h>
#include <stdlib.h>
#include <stdio.h>
#include <vme.h>
#include <iv.h>
#include <sysLib.h>
#include <stdioLib.h>
#include <dbDefs.h>
#include <drvSup.h>

View File

@@ -32,7 +32,7 @@
#include <module_types.h>
module_types()
int module_types()
{
ai_num_cards[AB1771IL] = 12;