/* SCCS_ID @(#)systm.h    	3.3	 02:16:57 - 81/12/10 */

#ifndef LOCALS_INCLUDED
# include <sys/local.h>
#endif

/*
 * Random set of variables
 * used by more than one
 * routine.
 */
char    canonb[CANBSIZ];        /* buffer for erase and kill (#@) */
struct inode *rootdir;          /* pointer to inode of root directory */
struct proc *runq;              /* head of linked list of running processes */
int     cputype;                /* type of cpu */
int     lbolt;                  /* time of day in HZ not in time */
time_t  time;                   /* time in sec from 1970 */
int     timezone;               /* Minutes westward from Greenwich */
int     dstflag;                /* Daylight Saving Time applies here */
#ifdef  UCB_METER
time_t  bootime;                /* time of last reboot */
#endif  UCB_METER

/*
 * Nblkdev is the number of entries
 * (rows) in the block switch. It is
 * set in binit/bio.c by making
 * a pass over the switch.
 * Used in bounds checking on major
 * device numbers.
 */
int     nblkdev;

/*
 * Number of character switch entries.
 * Set by cinit/tty.c
 */
int     nchrdev;

int     mpid;                   /* generic for unique process id's */
char    runin;                  /* scheduling flag */
char    runout;                 /* scheduling flag */
char    runrun;                 /* scheduling flag */
char    curpri;                 /* more scheduling */
int     maxmem;                 /* actual max memory per process */
caddr_t memtop;                 /* highest memory address */
int     freemem;                /* free memory (CLICKS) - for display only */
physadr lks;                    /* pointer to clock device */
daddr_t swplo;                  /* block number of swap space */
int     nswap;                  /* size of swap space */
int     updlock;                /* lock for sync */
daddr_t rablock;                /* block to be read ahead */
extern  int     regloc[NREGS];  /* locs. of saved user registers (trap.c) */
char    *msgbuf;                /* saved "printf" characters */
char    *msgbufMSGBUFS;         /* &msgbuf[msgbufs] */
char    *msgbufp;               /* Next saved printf character */
dev_t   rootdev;                /* device of the root */
dev_t   swapdev;                /* swapping device */
dev_t   pipedev;                /* pipe device */
extern  int     icode[];        /* user init code */
extern  int     szicode;        /* its size */
#ifdef  CGL_RTP
struct proc *rtpp;              /* pointer to real time process entry */
#endif  CGL_RTP
#ifdef  UCB_FRCSWAP
int     idleflg;                /* if set allow incore forks & expands */
#endif  UCB_FRCSWAP
#ifdef  UCB_LOAD
time_t  bootime;
#endif  UCB_LOAD

dev_t getmdev();
daddr_t bmap();
struct inode *ialloc();
struct inode *iget();
struct inode *owner();
struct inode *maknode();
struct inode *namei();
struct buf *alloc();
struct buf *getblk();
struct buf *geteblk();
struct buf *bread();
struct buf *breada();
struct filsys *getfs();
struct file *getf();
struct file *falloc();
int     uchar();
/*
 * Instrumentation
 */
int     dk_busy;
#ifdef  DEC
long    dk_time[32];
long    dk_numb[3];
long    dk_wds[3];
#else   DEC
long    dk_time[64];
long    dk_numb[4];
long    dk_wds[4];
#endif  DEC
long    tk_nin;
long    tk_nout;

/*
 * Structure of the system-entry table
 */
extern struct sysent {
	char    sy_narg;                /* total number of arguments */
	char    sy_nrarg;               /* number of args in registers */
	int     (*sy_call)();           /* handler */
} sysent[];
