home *** CD-ROM | disk | FTP | other *** search
- /*
- * @(#) systm.h 2.6 88/07/13
- *
- * Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
- * Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
- * This Module contains Proprietary Information of
- * The Santa Cruz Operation, Microsoft Corporation
- * and AT&T, and should be treated as Confidential.
- */
-
- /*
- * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
- * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
- * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
- * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
- */
-
- /*
- * Random set of variables used by more than one routine.
- */
- inodep_t rootdir; /* pointer to inode of root directory */
- struct proc *runq; /* head of linked list of running processes */
- extern struct proc *curproc; /* current proc */
- struct proc *Hogproc; /* if non-NULL, schedule only this process */
- short cputype; /* type of cpu */
- time_t lbolt; /* time in HZ since last boot */
- time_t time; /* time in sec from 1970 */
- int Hz; /* configurable clock speed */
- int Timezone; /* configurable timezone */
- int Dstflag; /* configurable DST flag */
-
- int mpid; /* generic for unique process id's */
- char runin; /* scheduling flag */
- short runout; /* scheduling flag */
- char runrun; /* scheduling flag */
- char runtxt; /* scheduling flag */
- char curpri; /* more scheduling */
- unsigned maxmem; /* actual max memory per process */
- #ifdef M_I386
- long physmem; /* physical memory in clicks */
- #else
- paddr_t physmem; /* physical memory on this CPU */
- #endif
- 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 */
- int Cmask; /* default creation mask */
- extern char regloc[]; /* locs of saved user registers (trap.c) */
- extern short reglocc; /* size of regloc array */
- dev_t rootdev; /* device of the root */
- dev_t swapdev; /* swapping device */
- dev_t pipedev; /* pipe device */
- int blkacty; /* active block devices */
- int selwait; /* selecting processes wait on this */
- #define pollwait selwait /* link poll and select with common address */
-
- /* machine dependent part */
-
- /* function defs */
- dev_t getmdev();
- daddr_t bmap();
- inodep_t ialloc();
- inodep_t iget();
- inodep_t owner();
- inodep_t maknode();
- inodep_t namei();
- struct buf *alloc();
- struct buf *getblk();
- struct buf *getablk();
- struct buf *bread();
- struct buf *breada();
- filep_t getf();
- filep_t falloc();
- int uchar();
-
- extern char maxmask[]; /* 8259 dependent flag set in init8259.c*/
- extern paddr_t kmemstart;
-
-
- #ifdef M_I386
-
- #define DATAP 0x01 /* argument is a DATA pointer */
- #define TEXTP 0x02 /* argument is a TEXT pointer */
- #define CONST 0x03 /* argument is an int-sized constant */
- /* (16-bit for 286, 32-bit for 386) */
- #define UCONST 0x04 /* argument is unsigned int-sized constant */
- /* (16-bit for 286, 32-bit for 386) */
- #define LCONST 0x05 /* argument is a long-sized constant */
- /* (32-bit for both 286 and 386) */
- #define FDATAP 0x06 /* argument is FAR data pointer, regardless */
- /* of memory model. */
- #define SODATAP 0x07 /* 286 only: low word is 16 bit data pointer */
- /* offset, high word is 16 bit selector */
- /* 386: 32-bit offset */
- #define SOTEXTP 0x08 /* 286 only: low word is 16 bit text pointer,*/
- /* offset, high word is 16 bit selector */
- /* 386: 32-bit offset */
- #define MASKSZ 4
- #define MASKON 0xf
-
- #define MASK(arg1,arg2,arg3,arg4,arg5,arg6) \
- (((((((((((arg6) << MASKSZ) | arg5) << MASKSZ) | arg4) << MASKSZ) | arg3) << MASKSZ) | arg2 ) << MASKSZ) | arg1)
-
- #define NULLP ((int (*)())0)
-
- /* return types, to force search of other tables */
-
- #define XNXTYP 0x08 /* cxenix type */
- #define UTSTYP 0x09 /* utssys type */
- #define LCLTYP 0x0A /* clocal type */
-
- /*
- * Structure of the system-entry table
- */
- extern struct sysent {
- unsigned char sy_ret; /* Type of return value (int, long,
- pointer) */
- unsigned char sy_arg386; /* number of 386 args on user stack
- */
- unsigned char sy_nlarg286; /* Large model 286: number of word args
- (args are on user stack) */
- unsigned char sy_nmarg286; /* Small/Middle model 286: max number
- of word args passed on user stack,
- instead of in registers */
- unsigned sy_argmask; /* mask for args */
- int (*sy_call)(); /* handler */
- } sysent[];
-
- #else
-
- struct sysent {
- char sy_nlarg; /* large model arg word count */
- char sy_nmarg; /* middle model arg words (if reg overflow) */
- unsigned sy_argmask; /* mask to show type of argument(s) */
- int (*sy_call)(); /* handler */
- };
-
- /* idt table entry format */
-
- #ifdef M_I286
- struct idt {
- int (far *i_func)();
- char i_hbase;
- char i_type;
- short i_pad;
- };
- #endif
-
- extern short icode[];
- ushort szicode;
-
- #endif
-
- #define insque(q,p) _insque((faddr_t)q,(faddr_t)p)
- #define remque(q) _remque((faddr_t)q)
-