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

/*=~=~=~=~ McGill-Computer-Vision-and-Robotics-Laboratory--C-Module ~=~=~=~=
 *		
 * NAME:	sys.h
 *
 * DESCRIPTION:	Definitions for system data structures used by the LSI11
 *		microkernel.
 * 
 * AUTHOR/DATE:	John Lloyd, Spring 1988
 *
 *~=~=~=~=~=~= McGill-Computer-Vision-and-Robotics-Laboratory ~=~=~=~=~=~=*/

#ifndef _SYS_H_
#define _SYS_H_

/* system cpu types */

#define LSI11_02		1
#define LSI11_23		2
#define LSI11_73		3

typedef struct {
	int (*fxn)();		/* interrupt service routine function */
	int arg;		/* argument to the service routine */
       	int saveregs;		/* true if system should save registers */
} VECT_DESC;

typedef struct _vector {
	unsigned buf[6];	/* block containing dispatch code */
	struct _vector *next;	/* pointer to linking into free list */
} VECTOR;

typedef struct {
	unsigned *addr;		/* bus address */
	unsigned vect;		/* vector number */
} DEV_DESC;

/* Structure set up by the system for each serial line unit formally 
   configured into the system (i.e., described in the table 'serialDevs'). */

typedef struct slu {
	unsigned short *rcsr;	/* device receive csr address */
	unsigned short *rbuf;	/* device receive buffer address */
	unsigned short *wcsr;	/* device transmit csr address */
	unsigned short *wbuf;	/* device transmit buffer address */
	short ipending;		/* an transmit interrupt is pending */
	char *rqueue;		/* address of read buffer */
	short rsize;		/* max. size of read buffer */
	short rhead;		/* read buffer head */
  	short rtail;		/* read buffer tail */
  	char *wqueue;		/* address of write buffer */
	short wsize;		/* max. size of write buffer */
  	short whead;		/* write buffer head */
  	short wtail;		/* write buffer tail */
} SLU;

extern SLU *sluGet();

#endif
