#sccs "@(#)uts/kern/sys:space.h 1.18" /* Convergent Technologies - System V - May 1983 */ #ifndef space_h #define space_h /* #define KERNEL */ #include #include "sys/acct.h" struct acct acctbuf; struct inode *acctp; #include "sys/buf.h" struct buf bfreelist; /* head of the free list of buffers */ struct pfree pfreelist; /* Head of physio header pool */ struct buf swbuf[NSWBUF]; int swpf [NSWBUF]; short swsize [NSWBUF]; int nswbuf = NSWBUF; struct buf bswlist; struct buf *bclnlist; struct hbuf hbuf[NHBUF]; /* buffer hash table */ #include "sys/inode.h" /* EAH: the inode table is about 2.5K, the lock list about .6K. Can * they be put into KVMEM? */ #ifdef BASSLOCKING struct locklist locklist[NFILEHI]; short nflocks = NFILEHI; #else BASSLOCKING #include "sys/flock.h" struct flckinfo flckinfo = { (long)NFILEHI }; struct filock flox[ NFILEHI ]; #endif BASSLOCKING #include "sys/map.h" struct map swapmap[SMAPSIZ]; int nswapmap = SMAPSIZ; #include "sys/mount.h" struct mount mount[NMOUNT]; #include "sys/err.h" struct err errbuf[NERR]; short err_cnt = NERR; #include "sys/sysinfo.h" struct sysinfo sysinfo; struct syswait syswait; struct syserr syserr; extern ipcnosys(), ipcnull(); #if MESG==1 extern imsgsys(), imsginit(); #endif typedef int (*Fint)(); Fint ipcdefault[] = { #if MESG==0 ipcnosys, /* msgsys */ ipcnull, /* msginit */ #else imsgsys, imsginit, #endif #if SEMA==0 ipcnosys, /* semsys */ ipcnull, /* seminit */ ipcnull, /* semexit */ #endif #if SHMEM==0 ipcnosys, /* shmsys */ ipcnull, /* shmexec */ ipcnull, /* shmfork */ ipcnull, /* shminit */ ipcnull, /* setupshm */ ipcnull /* freeshmseg */ #endif }; Fint *ipcfunc = ipcdefault; /* ipc function indirection table */ #if DEBUGGER==0 dbmain(){} #endif #ifndef NOSTREAMS #ifdef SLAN_0 #include "sys/stream.h" #include "sys/strconf.h" #define NDBLOCK NBLK4096+NBLK2048+NBLK1024+NBLK512+NBLK256+NBLK128+NBLK64+NBLK16+NBLK4 #define NMBLOCK NDBLOCK+((NDBLOCK)/4) queue_t queue[NQUEUE]; struct stdata streams[NSTREAM]; mblk_t mblock[NMBLOCK]; dblk_t dblock[NDBLOCK]; int strmsgsz = STRMSGSZ; int nmblock = NMBLOCK; struct fmodsw fmodsw[NFMODS]; int fmodcnt = 0; char strdarray[ (NBLK4096+1)*4096 + NBLK2048*2048 + NBLK1024*1024 + NBLK512*512 + NBLK256*256 + NBLK128*128 + NBLK64*64 + NBLK16*16 + NBLK4*4 ]; /* Declare the indirect pointer routines to stream entry points */ extern stropen(), strclose(), strread(), strwrite(), strioctl(), runqueues(); Fint si_open = stropen, si_close = strclose, si_read = strread, si_write = strwrite, si_ioctl = strioctl, si_sched = runqueues; #else /* Declare the indirect pointer routines to stream entry points; * These get patched by the steam module init routine to the right * values. These are dummy panic routines for now */ extern nulldev (); char qrunflag; char queueflag; d_stropen() { panic ("d_stropen"); } d_strclose() { panic ("d_strclose"); } d_strread() { panic ("d_stropen"); } d_strwrite() { panic ("d_strwrite"); } d_strioctl() { panic ("d_strioctl"); } d_strsched() { panic ("d_strsched"); } Fint si_open = d_stropen, si_close = d_strclose, si_read = d_strread, si_write = d_strwrite, si_ioctl = d_strioctl, si_sched = d_strsched, si_trace = nulldev; #endif SLAN_0 #endif NOSTREAMS #include "sys/tune.h" struct tunable tulo = { NBUF, NINODE, NFILE, NPROC, NTEXT, NCLIST, NPBUF, NCALL }; struct tunable tuhi = { NBUFHI, NINODEHI, NFILEHI, NPROCHI, NTEXTHI, NCLISTHI, NPBUFHI, NCALLHI }; /* default table in case tuhi is modified by user program to exceed system limit */ struct tunable deftuhi = { NBUFHI, NINODEHI, NFILEHI, NPROCHI, NTEXTHI, NCLISTHI, NPBUFHI, NCALLHI }; #include "sys/var.h" struct var v = { 0, 0, 0, 0, 0, 0, NMOUNT, (char *)(&mount[NMOUNT]), 0, 0, 0, 0, 0, NSABUF, MAXUP, SMAPSIZ, NHBUF, NHBUF-1, 0, }; #include "sys/init.h" #ifndef PRF_0 prfintr() {} unsigned prfstat; #endif #ifdef DISK_0 #ifndef DISK_1 #define DISK_1 0 #endif #ifndef DISK_2 #define DISK_2 0 #endif #ifndef DISK_3 #define DISK_3 0 #endif #include "sys/iobuf.h" #include "sys/gdisk.h" /* S4 general disk driver global variables */ char gdhdbbq[HDMAXCYL], gdsybbq[HDMAXCYL]; struct bbmcell gdhdbb[HDMAXBADBLK], gdsybb[HDMAXBADBLK]; extern ghdintr(), ghdstart(); extern gfpintr(), gfpstart(); struct gdswprt gddefault = { "Deflt",1,1,4,4,FPDENSITY,2,512}; /* sufficient to load vhb+bbt */ struct gdsw gdsw[] = { { 0,{"WIN", 1023, 4, 17, 68,0, 0, 512}, -1,0,16, 1023*16,40, ghdintr, ghdstart, HDMAXCYL, HDMAXBADBLK, gdhdbbq, gdhdbb,0}, { 0,{"WIN1", 1023, 4, 17, 68,0, 0, 512}, -1,0,16, 1023*16,40, ghdintr, ghdstart, HDMAXCYL, HDMAXBADBLK, gdsybbq, gdsybb,0}, { 0,{"FD", 80, 2, 8, 16,2, 0, 512}, -1,0,8, 80*8,60, gfpintr, gfpstart, FPMAXCYL, FPMAXBADBLK, NULL, NULL,0} }; struct iobuf gdutab[DISKS]; struct iobuf gdtab; #ifdef IOSTAT struct iotime gdstat[DISKS]; #endif struct driver gdreal; int gd_cnt = DISK_0; /* 1 general disk controller for HD SY FD */ char gdourunflg = 0; /* disk dma over/under run flag */ #endif #ifdef TRACE_0 #include "sys/trace.h" struct trace trace[TRACE_0]; int tr_cnt = TRACE_0; int tr_flag; char tr_buff [128]; char *tr_bp = tr_buff; #endif #if MESG==1 #include "sys/ipc.h" #include "sys/msg.h" struct map msgmap[MSGMAP]; struct msqid_ds msgque[MSGMNI]; struct msg msgh[MSGTQL]; struct msginfo msginfo = { MSGMAP, MSGMAX, MSGMNB, MSGMNI, MSGSSZ, MSGTQL, MSGSEG }; #endif /* data associated with the low level RS-232 input routine in ml/i8274.s */ #include "sys/iohw.h" #include "sys/i8274.h" #include "sys/tty.h" struct device sertty0 = { 0, NULL, A_CMND_ADDR, A_DATA_ADDR, A_CMND_ADDR, 0,0,0,0,0,0,A_BAUD_ADDR,0 }; /* this 8274 port used for the modem, always the last one in ser_addr[] */ struct device sermod0 = { 0, NULL, B_CMND_ADDR, B_DATA_ADDR, A_CMND_ADDR, 0,0,0,0,0,0,0,0 }; struct tty ser_tty[2] = {0}; /* modem uses the tty struct one above ser_cnt. */ /* This array of pointers to tty and device struct is initialized with the * struct for the RS-232 and phone port. The other six entries are reserved * for ports on the expansion boards. */ struct device *ser_addr[] = { &sertty0, &sermod0, 0,0,0, 0,0,0 }; struct tty *pser_tty[] = { &ser_tty[0], &ser_tty[1], 0,0,0, 0,0,0 }; #define SZSERBUF (NSERBUF) unsigned short serbuf[SZSERBUF]; unsigned short *inptr = serbuf; /* addr of next char to put in buffer */ unsigned short *outptr = serbuf; /* address of next char to take from buffer */ int nttyhog = NTTYHOG; int serbufcnt = 0; /* count of characters in buffer */ int serbufful = SZSERBUF; /* max characters that can be put in buffer */ unsigned char serinprogress = 0; /* 1 if input proc in progress */ unsigned char serxoff = 0; /* XOFF from RX blocking TX */ unsigned char serinxoff = 0; /* received XOFF blocking TX */ unsigned char sertxblkd = 0; /* received XOFF should restart TX */ unsigned char sercd = 0; /* state of CD for each line */ unsigned char sercts = 0; /* state of CTS for each line */ unsigned char serixon = 0; /* state of ixon for each line */ unsigned char serixany = 0; /* state of ixany for each line */ unsigned char serbpend = 0; /* state of BREAK for each line */ unsigned short *bserbuf = &serbuf[0]; /* start of serial buffer */ unsigned short *eserbuf = &serbuf[SZSERBUF]; /* first address past end of serbuf */ unsigned char ser_ports[8] = {0}; /* preserves extended control bits per 8274 port */ short ser_cnt = 2; /* how many serial ports, includes phone */ #include "sys/ph.h" #include "sys/dialer.h" #include "sys/hardware.h" #include "sys/phone.h" short int DTMFpad[] = { kDIGIT0, kDIGIT1, kDIGIT2, kDIGIT3, kDIGIT4, kDIGIT5, kDIGIT6, kDIGIT7, kDIGIT8, kDIGIT9, kDIGAST, kDIGPND }; struct phdef phndef[] = { { 0,0,0,0,0,0,0,0,15,1,LN1_CONNECT,DNLN1_CONNECT, DTMF|RINGON|NORMRNG|MEDRNG|SPEAKERON, 0,500,L1MD_GCR_ADDR,HOOK1_RELAY,A_LEAD1_RELAY, LINE1_ACTIVE, NULL, NULL, VOICE,0,0 }, { 0,1,0,0,0,0,0,0,15,1,LN2_CONNECT,DNLN2_CONNECT, DTMF|RINGON|NORMRNG|MEDRNG|SPEAKERON, 0,500,L2MD_GCR_ADDR,HOOK2_RELAY,A_LEAD2_RELAY, LINE2_ACTIVE, NULL, NULL, 0,0,0 } }; /* structure for the 2 lines */ struct mddef moddef[1] = {0}; /* structure used for modem ctl */ struct dndef dnwdef[1] = {0}; /* structure for dial network */ struct mddef *mdptr = moddef; /* global pointer to modem struct */ struct dndef *dnptr = dnwdef; /* global pointer to dial struct */ char teleline = UNUSED; /* used to recall which line the */ /* handset is connected to. */ char fcallprog= 0; /* true if monitoring call prog */ ushort telestat = 0; /* used for message wait and line */ /* 1 and 2 ringing. */ ushort msgstat = 0; #include "sys/wd.h" extern int khigh(),mscoord(), kbinit(); /* defaults for resident keyboard */ int (*ldmisc[])() = { nulldev, nulldev, nulldev, nulldev, kbinit, nulldev, nulldev, nulldev, nulldev, nulldev, nulldev, nulldev, nulldev, khigh, mscoord, nulldev, /*CT reserved*/ nulldev, nulldev, nulldev, nulldev, /* available for users */ }; #include "sys/slot.h" /* expansion slot table */ struct slot slots[NSLOTS]; /* table for loadable drivers */ #include "sys/drv.h" #define NLDDRV (NLBDRV+NLCDRV) struct drv_tbl Drv_tbl[NLDDRV]; ushort Drv_max = NLDDRV; extern struct drv_int dskdrv, kbddrv; struct drv_int *Drv_Int[] = { 0, &dskdrv, &kbddrv, 0, 0, 0 }; /* Virtual Space */ /* PXMEM must not be at the beginning of KVMEM due to rastop bug BG - 12/18/84 */ #define DLMEM KVMEM_VBASE #define DLSIZE (btopxc(NDL*sizeof(struct dldef))) #define PXMEM (btopxc(DLMEM+DLSIZE)) #define WTXTMEM (btopxc(PXMEM+PXMEMSIZE)) #define WTXTSIZE (NWINDOWS*WTXTNUM*WTXTLEN) #define FONTMEM (btopxc(WTXTMEM+WTXTSIZE)) #define ALTVMEM (btopxc(FONTMEM+FMEMSIZE)) #define ALTVSIZE (VIDBYTES*VIDHEIGHT) #define OLMEM (btopxc(ALTVMEM+ALTVSIZE)) #define OLSIZE (btopxc(NOL*sizeof(struct oldef))) #define MSGMEM (btopxc(OLMEM+OLSIZE)) #if MESG==1 #define MSGSIZE (btopxc(MSGSEG*MSGSSZ)) char *msgbuf = (char *)MSGMEM; #else #define MSGSIZE 0 #endif #define SEMMEM (btopxc(MSGMEM+MSGSIZE)) #define VTOTAL (DLSIZE+PXMEMSIZE+FMEMSIZE+WTXTSIZE+ALTVSIZE+OLSIZE+MSGSIZE) struct dldef *dlpool = (struct dldef *)DLMEM; short maxdl = NDL; short *pxmem = (short *)PXMEM; int pxmemsize = PXMEMSIZE; char *fontmem = (char *)FONTMEM; int fmemsize = FMEMSIZE; char *wtxt = (char *)WTXTMEM; unsigned short *altvmem = (unsigned short *)ALTVMEM; struct oldef *olheap = (struct oldef *)OLMEM; int ol_cnt = NOL; struct mpte kv_mpte[(KVMEM_VLIMIT-KVMEM_VBASE)>>BPCSHIFT]; int kv_pages = (VTOTAL+NBPC-1)>>BPCSHIFT; ushort kv_swap; int nofile = NOFILE; int nofilmax = NOFILMAX; /* * The following definitions support the functions called * from the system calls for networking, and network * semaphores. */ extern int nodev(), nullsys(); (*sock_write)() = nodev; (*sock_read)() = nodev; (*sock_ioctl)() = nodev; (*sock_close)() = nodev; (*sock_sema)() = nullsys; short softnetint = 0; short netbusy = 0; /* * The following network constants can be set from tunevars */ int net_mbsize = 64*1024; /* amount of space to reserve for mbufs */ int net_tcpdebug = 0; /* Number of tcp trace buffers */ int vt_defcnt = 0; /* Number of configured pseudo-terminals */ #endif space_h