/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1991 by John E. Lloyd.				    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#ifndef _VXWCTRLTASK_H_
#define _VXWCTRLTASK_H_

#include <vxWorks.h>

#include "../h/IOdevice.h"

typedef struct execReq {
	struct execReq *next;
	struct execReq *prev;
	int (*fxn)();
	int arg;
	int request;
  } EXEC_REQ;

typedef struct _IntrDevDesc {
	/* 
	   Structure describing RCI interrupts; allocated by 
	   rciInterruptDesc.
	 */
	struct _IntrDevDesc *flink;	/* for keeping list of */
	struct _IntrDevDesc *blink;	/*   allocated blocks */

	struct _IntrDevDesc *next;	/* for list of blocks attached */
       	struct _IntrDevDesc *prev;	/*   to an interrupt */

	int vector;			/* vector number */
	IO_INTERRUPT intr;		/* interrupt info block */

	int attached;			/* interrupt is active */
	EXEC_REQ exr;			/* fxn execute request block */
	FUNCPTR oldfxn;			/* previous vector handler */
} IntrDevDesc;

#define VXINT_LOCK()	(taskLock(), intLock())
#define VXINT_UNLOCK(s)	(intUnlock(s), taskUnlock())

#endif
