home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / systm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-13  |  4.9 KB  |  157 lines

  1. /*
  2.  *    @(#) systm.h 2.6 88/07/13 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /*
  12.  * THIS FILE CONTAINS CODE WHICH IS DESIGNED TO BE
  13.  * PORTABLE BETWEEN DIFFERENT MACHINE ARCHITECTURES
  14.  * AND CONFIGURATIONS. IT SHOULD NOT REQUIRE ANY
  15.  * MODIFICATIONS WHEN ADAPTING XENIX TO NEW HARDWARE.
  16.  */
  17.  
  18. /*
  19.  * Random set of variables used by more than one routine.
  20.  */
  21. inodep_t rootdir;        /* pointer to inode of root directory */
  22. struct proc *runq;        /* head of linked list of running processes */
  23. extern struct proc *curproc;    /* current proc */
  24. struct proc *Hogproc;           /* if non-NULL, schedule only this process */
  25. short   cputype;                /* type of cpu */
  26. time_t    lbolt;            /* time in HZ since last boot */
  27. time_t    time;            /* time in sec from 1970 */
  28. int     Hz;                     /* configurable clock speed */
  29. int     Timezone;               /* configurable timezone */
  30. int     Dstflag;                /* configurable DST flag  */
  31.  
  32. int    mpid;            /* generic for unique process id's */
  33. char    runin;            /* scheduling flag */
  34. short    runout;            /* scheduling flag */
  35. char    runrun;            /* scheduling flag */
  36. char    runtxt;                 /* scheduling flag */
  37. char    curpri;            /* more scheduling */
  38. unsigned maxmem;        /* actual max memory per process */
  39. #ifdef M_I386
  40. long    physmem;        /* physical memory in clicks */
  41. #else
  42. paddr_t    physmem;        /* physical memory on this CPU */
  43. #endif
  44. daddr_t    swplo;            /* block number of swap space */
  45. int    nswap;            /* size of swap space */
  46. int    updlock;        /* lock for sync */
  47. daddr_t    rablock;        /* block to be read ahead */
  48. int     Cmask;                  /* default creation mask */
  49. extern    char    regloc[];    /* locs of saved user registers (trap.c) */
  50. extern short    reglocc;    /* size of regloc array */
  51. dev_t    rootdev;        /* device of the root */
  52. dev_t    swapdev;        /* swapping device */
  53. dev_t    pipedev;        /* pipe device */
  54. int    blkacty;        /* active block devices */
  55. int    selwait;        /* selecting processes wait on this */
  56. #define pollwait selwait    /* link poll and select with common address */
  57.  
  58. /* machine dependent part */
  59.  
  60. /* function defs */
  61. dev_t getmdev();
  62. daddr_t    bmap();
  63. inodep_t ialloc();
  64. inodep_t iget();
  65. inodep_t owner();
  66. inodep_t maknode();
  67. inodep_t namei();
  68. struct buf *alloc();
  69. struct buf *getblk();
  70. struct buf *getablk();
  71. struct buf *bread();
  72. struct buf *breada();
  73. filep_t getf();
  74. filep_t falloc();
  75. int    uchar();
  76.  
  77. extern    char    maxmask[];     /* 8259 dependent flag set in init8259.c*/
  78. extern paddr_t kmemstart;
  79.  
  80.  
  81. #ifdef M_I386
  82.  
  83. #define    DATAP    0x01        /* argument is a DATA pointer */
  84. #define TEXTP    0x02        /* argument is a TEXT pointer */
  85. #define    CONST    0x03        /* argument is an int-sized constant */
  86.                 /*    (16-bit for 286, 32-bit for 386) */
  87. #define UCONST    0x04        /* argument is unsigned int-sized constant */
  88.                 /*    (16-bit for 286, 32-bit for 386) */
  89. #define LCONST    0x05        /* argument is a long-sized constant */
  90.                 /*    (32-bit for both 286 and 386) */
  91. #define FDATAP    0x06        /* argument is FAR data pointer, regardless */
  92.                 /*    of memory model. */
  93. #define SODATAP 0x07        /* 286 only:  low word is 16 bit data pointer */
  94.                 /*    offset, high word is 16 bit selector */
  95.                 /* 386:  32-bit offset */
  96. #define SOTEXTP 0x08        /* 286 only:  low word is 16 bit text pointer,*/
  97.                 /*     offset, high word is 16 bit selector */
  98.                 /* 386:  32-bit offset */
  99. #define MASKSZ    4
  100. #define MASKON  0xf
  101.  
  102. #define MASK(arg1,arg2,arg3,arg4,arg5,arg6)    \
  103.     (((((((((((arg6) << MASKSZ) | arg5) << MASKSZ) | arg4) << MASKSZ) | arg3) << MASKSZ) | arg2 ) << MASKSZ) | arg1)
  104.  
  105. #define NULLP ((int (*)())0)
  106.  
  107. /* return types, to force search of other tables */
  108.  
  109. #define XNXTYP    0x08        /* cxenix type */
  110. #define UTSTYP    0x09        /* utssys type */
  111. #define LCLTYP    0x0A        /* clocal type */
  112.  
  113. /*
  114.  * Structure of the system-entry table
  115.  */
  116. extern struct sysent {
  117.     unsigned char    sy_ret;        /* Type of return value (int, long,
  118.                         pointer) */
  119.     unsigned char    sy_arg386;    /* number of 386 args on user stack
  120.                      */
  121.     unsigned char    sy_nlarg286;    /* Large model 286: number of word args
  122.                        (args are on user stack) */ 
  123.     unsigned char    sy_nmarg286;    /* Small/Middle model 286: max number 
  124.                        of word args passed on user stack, 
  125.                        instead of in registers */
  126.     unsigned    sy_argmask;    /* mask for args */
  127.     int        (*sy_call)();    /* handler */
  128. } sysent[];
  129.  
  130. #else
  131.  
  132. struct sysent {
  133.     char     sy_nlarg;    /* large model arg word count */
  134.     char     sy_nmarg;    /* middle model arg words (if reg overflow) */
  135.     unsigned sy_argmask;    /* mask to show type of argument(s) */
  136.     int     (*sy_call)();    /* handler */
  137. };
  138.  
  139. /*    idt table entry format */
  140.  
  141. #ifdef M_I286
  142. struct idt {
  143.     int    (far *i_func)();
  144.     char    i_hbase;
  145.     char    i_type;
  146.     short    i_pad;
  147. };
  148. #endif
  149.  
  150. extern short icode[];
  151. ushort szicode;
  152.  
  153. #endif
  154.  
  155. #define    insque(q,p)    _insque((faddr_t)q,(faddr_t)p)
  156. #define    remque(q)    _remque((faddr_t)q)
  157.