home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / sysi86.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  7.4 KB  |  176 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  9. /*      All Rights Reserved    */
  10.  
  11. /*    This Module contains Proprietary Information of Microsoft  */
  12. /*    Corporation and should be treated as Confidential.       */
  13.  
  14.  
  15. #ident    "@(#)head.sys:sysi86.h    1.4.1.4"
  16.  
  17. #ifndef DIRSIZ
  18. #define    DIRSIZ    14
  19. #endif
  20.  
  21. /*
  22.  * Commands for sysi86 system call (1-?)
  23.  */
  24.  
  25. #define SI86SWPI        1       /* General swap interface.                */
  26. #define SI86SYM         2       /* acquire boot-built symbol table        */
  27. #define SI86CONF        4       /* acquire boot-built configuration table */
  28. #define SI86BOOT        5       /* acquire timestamp and name of program  */
  29.                 /* booted                                 */
  30. #define SI86DMM         7       /* double-map data segment for            */
  31.                 /* read/write/execute support             */
  32. #define SI86AUTO        9       /* was an auto-config boot done?          */
  33. #define SI86EDT         10      /* copy contents of EDT to user           */
  34. #define SI86SWAP        12      /* Declare swap space                     */
  35. #define SI86FPHW        40      /* what (if any?) floating-point hardware */
  36.  
  37. #define GRNON        52    /* set green light to solid on state */
  38. #define GRNFLASH    53    /* start green light flashing */
  39. #define STIME         54    /* set internal time */
  40. #define SETNAME        56    /* rename the system */
  41. #define RNVR         58    /* read NVRAM */
  42. #define WNVR         59    /* write NVRAM */
  43. #define RTODC        60    /* read time of day clock */
  44. #define CHKSER        61    /* check soft serial number */
  45. #define SI86NVPRT       62      /* print an xtra_nvr structure */
  46. #define SANUPD        63    /* sanity update of kernel buffers */
  47. #define SI86KSTR        64      /* make a copy of a kernel string */
  48. #define SI86MEM         65      /* return the memory size of system */
  49. #define SI86TODEMON     66      /* Transfer control to firmware.        */
  50. #define SI86CCDEMON     67      /* Control character access to demon.   */
  51. #define SI86CACHE       68      /* Turn cache on and off.               */
  52. #define SI86DELMEM      69      /* Delete available memory for testing. */
  53. #define SI86ADDMEM      70      /* Add back deleted memory.             */
  54. /* 71 through 74 reserved for VPIX */
  55. #define SI86V86         71      /* V86 system calls (see v86.h)         */
  56. #define    SI86SLTIME    72    /* Set local time correction        */
  57. #define SI86DSCR        75      /* Set a segment or gate descriptor     */
  58. #define RDUBLK        76    /* Read U Block */
  59. /* Merged Product defines */
  60. #define SI86SHFIL    100    /* map a file into addr space of a proc */
  61. #define SI86PCHRGN    101    /* make globally visible change to a region */
  62. #define SI86BADVISE    102    /* badvise subcommand - see below for   */
  63.                 /*    badvise subfunction definitions */
  64. #define SI86SHRGN    103    /* enable/disable XENIX small model shared */
  65.                 /*    data context switching           */ 
  66. #define    SI86CHIDT    104    /* set user level int 0xf0, ... 0xff handlers */
  67. #define    SI86EMULRDA    105    /* remove special emulator read access    */
  68.  
  69.  
  70. /*
  71.  *  The SI86DSCR subcommand of the sysi86() system call
  72.  *  sets a segment or gate descriptor in the kernel.
  73.  *  The following descriptor types are accepted:
  74.  *    - executable and data segments in the LDT at DPL 3
  75.  *    - a call gate in the GDT at DPL 3 that points to a segment in the LDT
  76.  *  The request structure declared below is used to pass the values
  77.  *  to be placed in the descriptor.  A pointer to the structure is
  78.  *  passed as the second argument of the system call.
  79.  *  If acc1 is zero, the descriptor is cleared.
  80. */
  81.  
  82. /* request structure passed by user */
  83. struct ssd {
  84.     unsigned int sel;   /* descriptor selector */
  85.     unsigned int bo;    /* segment base or gate offset */
  86.     unsigned int ls;    /* segment limit or gate selector */
  87.     unsigned int acc1;  /* access byte 5 */
  88.     unsigned int acc2;  /* access bits in byte 6 or gate count */
  89. };
  90.  
  91. /*
  92.  *  The SI86SHFIL subcommand of the sysi86() system call
  93.  *  maps a file into a region in user address space.
  94.  *  The request structure declared below is used to pass the
  95.  *  system call parameters.  A pointer to the structure is
  96.  *  passed as the second argument of the system call.
  97.  */
  98. struct mmf {
  99.     char *    mf_filename;    /* path name of file */
  100.     long    mf_filesz;    /* Size in bytes of section of file    */
  101.                 /* from which this region is mapped.    */
  102.     long    mf_regsz;    /* Size of region in bytes */
  103.     short    mf_flags;    /* Either 0 or RG_NOSHARE */
  104. };
  105.  
  106. /*
  107.  *  The SI86PCHRGN subcommand of the sysi86() system call
  108.  *  change the memory mapped image of a file.
  109.  *  The request structure declared below is used to pass the values
  110.  *  system call parameters.  A pointer to the structure is
  111.  *  passed as the second argument of the system call.
  112. */
  113. struct cmf {
  114.     char *    cf_srcva;    /* modified image address */
  115.     char *    cf_dstva;    /* location to patch */
  116.     long    cf_count;    /* size of patch */
  117. };
  118.  
  119. /*
  120.  * The SI86BADVISE subcommand of the sysi86() system call specifies
  121.  * XENIX variant behavior for certain system calls and kernel routines.
  122.  * The 'arg' argument of sysi86() for SI86BADVISE is an integer.  Bits
  123.  * 8..15 specify SI86B_SET or SI86B_GET.  Bits 0..7 contain
  124.  * SI86B_PRE_SV, SI86B_XOUT, or SI86B_XSDSWTCH.  All these constants are 
  125.  * defined below.  The 'arg' argument thus consists of either SI86B_SET 
  126.  * OR'ed with zero or more of SI86B_PRE_SV, SI86B_XOUT, and SI86B_XSDSWTCH,
  127.  * or of SI86B_GET. 
  128.  */
  129.  
  130. #define SI86B_SET        0x0100    /* set badvise bits      */
  131. #define SI86B_GET        0x0200    /* retrieve badvise bits */    
  132.  
  133. #define SI86B_PRE_SV        0x0008    /* follow pre-System V x.out behavior */
  134. #define SI86B_XOUT        0x0010     /* follow XENIX x.out behavior */
  135. #define SI86B_XSDSWTCH        0x0080    /* XENIX small model shared data    */
  136.                     /*    context switching enabled   */
  137. /*
  138.  *   The request structure declared below is used by the XENIX 286 emulator
  139.  *   (/bin/x286emul) in conjunction with the SI86SHRGN subcommand of sysi86().
  140.  *   The SI86SHRGN subcommand is used by the XENIX 286 emulator to support
  141.  *   XENIX shared data.  The second argument passed to sysi86() is a 
  142.  *   pointer to an xsdbuf struct.
  143.  *
  144.  *   If the 'xsd_cmd' field of xsdbuf is SI86SHR_CP, the XENIX 286 emulator is 
  145.  *   using the SI86SHRGN subcommand to set up XENIX small model shared data 
  146.  *   context switching support for a given XENIX shared data segment.  In this 
  147.  *   case, the xsdbuf struct contains the start addr for the shared data in 
  148.  *   386 space, followed by the start addr for the shared data in the 286 
  149.  *   executable's private data.  
  150.  *
  151.  *   If the 'xsd_cmd' field is SI86SHR_SZ, the XENIX 286 emulator is using the 
  152.  *   SI86SHRGN subcommand to retrieve the size of an existing XENIX shared 
  153.  *   data segment.  In this case, the xsdbuf struct contains the start addr
  154.  *   for the shared data in 386 space.
  155.  *   The size of the shared data segment starting at 'xsd_386vaddr' will
  156.  *   be returned in the 'xsd_size' field by sysi86().
  157.  */
  158.  
  159. #define SI86SHR_CP    0x1    /* SI86SHRGN used for XENIX sd context switch */
  160. #define SI86SHR_SZ    0x2    /* SI86SHRGN used to get XENIX sd seg size */
  161.  
  162. struct xsdbuf {
  163.     unsigned xsd_cmd;    /* SI86SHRGN subcommand, either SI86SHR_CP 
  164.                  *     or SI86SHR_SZ.
  165.                  */     
  166.     char    *xsd_386vaddr;    /* Addr of "real" XENIX shared data seg in 
  167.                  *     the emulator.
  168.                  */
  169.     union {
  170.        char    *xsd_286vaddr;    /* Addr of XENIX shared data seg in the
  171.                  *     286 data portion of the emulator.
  172.                  */
  173.        unsigned long xsd_size;/* Size of XENIX shared data seg */
  174.     } xsd_un;
  175. };
  176.