home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / vpmx2.h < prev    next >
C/C++ Source or Header  |  1999-03-15  |  24KB  |  657 lines

  1. /***************************************************************************
  2. *
  3. * Module Name: vpmx2.h
  4. *
  5. *
  6. * Copyright (c) 1993  IBM Corporation
  7. *
  8. *
  9. *      DPMI host per task data
  10. *
  11. *      Description:
  12. *
  13. *      Contains the vpm definitions
  14. *
  15. */
  16.  
  17. /* NOINC */
  18. #if __IBMC__ || __IBMCPP__
  19.    #pragma info( none )
  20.       #ifndef __CHKHDR__
  21.          #pragma info( none )
  22.       #endif
  23.    #pragma info( restore )
  24. #endif
  25. /* INC */
  26.  
  27. #ifndef VPMX2DEFINED
  28.  
  29. #define VPMX2DEFINED
  30.  
  31. #define VPMDBG_X  0x00010000    /* Execute   */
  32. #define VPMDBG_W  0x00020000    /* Write     */
  33. #define VPMDBG_R  0x00030000    /* ReadWrite */
  34.  
  35. /* Definitions used to determine if DPX initialization was successful */
  36. #define     VPMINITOK      0x01              // VDPX and DPMI initialized OK
  37. #define     DPXLEAVEV86    0x02              // DPX will switch VDM into VPM
  38.  
  39. /***ET+ PFNVPMDBGWPALLOCVDM - allocate a watchpoint for a VDM
  40.  *
  41.  *      This type is a pointer to a function that allocates
  42.  *      a local watchpointfor the current VDM process.
  43.  *
  44.  *      (*PFNVPMDBGALLOCVDM) (laddr, cb, type, piwp)
  45.  *
  46.  *      ENTRY   laddr           - linear address of watchpoint
  47.  *              cb              - size of watchpoint (1, 2, or 4 bytes)
  48.  *              type            - type of watchpoint
  49.  *              piwp            - place to return watchpoint index
  50.  *      RETURN  int             - return code (NO_ERROR if successful)
  51.  */
  52. typedef INT (*PFNVPMDBGWPALLOCVDM)(ULONG,ULONG,ULONG,PULONG);
  53. /*end*/
  54.  
  55. /***ET+ PFNVPMDBGWPFREEVDM - free a watchpoint for a VDM
  56.  *
  57.  *      This type is a pointer to a function that frees
  58.  *      a local watchpointfor the current VDM process.
  59.  *
  60.  *      (*PFNVPMDBGWPFREEVDM) (iwp)
  61.  *
  62.  *      ENTRY   iwp             - watchpoint index
  63.  *      RETURN  int             - return code (NO_ERROR if successful)
  64.  */
  65. typedef INT (*PFNVPMDBGWPFREEVDM)(ULONG);
  66. /*end*/
  67.  
  68. /***ET+ PFNVPMDBGDR6QUERYVDM - query/update DR6 for a VDM process
  69.  *
  70.  *      This type is a pointer to a function that is used to query
  71.  *      bits B0-B3 in DR6 for the current VDM process.  It is also
  72.  *      used to reset any of those bits.
  73.  *
  74.  *      (*PFNVPMDBGDR6QUERYVDM) (flquery, flreset, pfl)
  75.  *
  76.  *      ENTRY   flquery         - bit mask of bits to query
  77.  *              flreset         - bit mask of bits to reset
  78.  *              pfl             - place to return bits
  79.  *      RETURN  int             - return code (NO_ERROR if successful)
  80.  */
  81. typedef INT (*PFNVPMDBGDR6QUERYVDM)(ULONG,ULONG,PULONG);
  82. /*end*/
  83.  
  84. /***ET+ PFNVPMSELCREATEVDMLDT - allocate an LDT for a VDM
  85.  *
  86.  *      This type is a pointer to a function that allocates
  87.  *      an LDT object for a DPMI VDM process.
  88.  *
  89.  *      This routine must be called in the context of the VDM we are
  90.  *      allocating the LDT for.
  91.  *
  92.  *      (*PFNVPMSELCREATEVDMLDT) (pladdr)
  93.  *
  94.  *      ENTRY:  pladdr - pointer to location to return
  95.  *                       pointer to the new ldt
  96.  *      EXIT:   NO_ERROR if success, else error code
  97.  *
  98.  */
  99. typedef INT (*PFNVPMSELCREATEVDMLDT)(PVOID*);
  100. /*end*/
  101.  
  102. /***ET+ PFNVPMSELDESTROYVDMLDT - free VDM protected mode LDT
  103.  *
  104.  *      This type is a pointer to a function that frees the
  105.  *      VDM's protected mode LDT.
  106.  *
  107.  *      (*PFNVPMSELDESTROYVDMLDT) ()
  108.  *
  109.  *      ENTRY   NONE
  110.  *
  111.  *      EXIT    NONE
  112.  *
  113.  *      CONTEXT VDM Task
  114.  *
  115.  */
  116. typedef VOID (*PFNVPMSELDESTROYVDMLDT)(VOID);
  117. /*end*/
  118.  
  119. /***ET+ PFNVPMSELALLOCVDM - allocate consecutive LDT selectors
  120.  *
  121.  *      This type is a pointer to a function that returns "csel"
  122.  *      consecutive free selectors from the current process's LDT.
  123.  *
  124.  *      (*PFNVPMSELALLOCVDM) (csel,psel)
  125.  *
  126.  *      ENTRY:  csel - number of contiguous selectors to allocate.
  127.  *              psel - on entry: if *psel == -1, allocate any selector,
  128.  *                            otherwise allocate that specific selector
  129.  *      EXIT:   NO_ERROR if success, else error code
  130.  */
  131. typedef INT (*PFNVPMSELALLOCVDM)(USHORT,PUSHORT,PSEL);
  132. /*end*/
  133.  
  134. /***ET+ PFNVPMSELFREEVDM - free a DPMI LDT selector
  135.  *
  136.  *      This type is a pointer to a function that marks a single LDT
  137.  *      selector in the current process as free.
  138.  *
  139.  *      (*PFNVPMSELFREEVDM) (sel)
  140.  *
  141.  *      ENTRY:  sel - selector to free
  142.  *      EXIT:   NO_ERROR if success, else error
  143.  */
  144. typedef INT (*PFNVPMSELFREEVDM)(SEL,USHORT);
  145. /*end*/
  146.  
  147.  
  148. /***ET+ PAGERANGE - page range structure used by *PFNVPMSELGETVDMINFO */
  149. #ifndef SMP
  150. typedef struct pagerange_s {
  151.     ULONG pr_lastframe;           /* last valid page in range */
  152.     ULONG pr_firstframe;          /* first valid page in range */
  153. } PAGERANGE;
  154. #endif
  155. /*end*/
  156.  
  157. #ifndef SMP
  158. typedef PAGERANGE *PPAGERANGE;
  159. #else
  160. typedef struct pagerange_s *PPAGERANGE;
  161. #endif
  162.  
  163.  
  164. /***ET+ VPMVMINF - data returned by *PFNVPMSELGETVDMINFO */
  165.  
  166. typedef struct vpmvminfo_s {
  167.         ULONG  vpmsel_linmax;       /* top linear address in user space   */
  168.         ULONG  vpmsel_cphysranges;  /* number of entries in array below   */
  169.     PPAGERANGE  vpmsel_physranges;   /* pointer to array of physical frame */
  170. } VPMINF;
  171.  
  172. typedef VPMINF *PVPMINF;
  173. /*end*/
  174.  
  175. /***ET+ PFNVPMSELGETVDMINFO - return memory manager info for VDM use
  176.  *
  177.  *      This type is a pointer to a function that fills in the
  178.  *      vpmvminfo_s structure.
  179.  *
  180.  *      (*PFNVPMSELGETVDMINFO) (psvi)
  181.  *
  182.  *      ENTRY:  psvi - pointer to vpmvminfo_s struction to fill in
  183.  *      EXIT:   none
  184.  */
  185. typedef INT (*PFNVPMSELGETVDMINFO)(PVPMINF);
  186. /*end*/
  187.  
  188. /***ET+ PFNVPMPGMOVE - move page table entries.
  189.  *
  190.  *      This type is a pointer to a function that moves page table
  191.  *      entries in the virtual address space. The destination must
  192.  *      invalid pages.
  193.  *
  194.  *      Locked pages cannot be moved and will cause an internal error.
  195.  *
  196.  *      (*PFNVPMPGMOVE) (pagesrc, dummy1, pagedst, dummy2, npages, hob)
  197.  *
  198.  *      ENTRY   pagesrc - source virtual page
  199.  *              reserved - must be NULL
  200.  *              pagedst - destination virtual page
  201.  *              reserved - must be NULL
  202.  *              npages - number of pages
  203.  *              hob - object handle for destination
  204.  *      EXIT    0 on success, else error code
  205.  */
  206. typedef INT (*PFNVPMPGMOVE)(ULONG,PVOID,ULONG,PVOID,INT,USHORT);
  207. /*end*/
  208.  
  209. /***ET+ PFNVPMPGGETACCESS - query access permissions for range of pages
  210.  *
  211.  *      This type is a pointer to a function that returns the permission
  212.  *      bits for a range of pages in a byte array. The high bit of the
  213.  *      byte is set if the page is unallocated. The caller must verify that
  214.  *      the buffer is of the correct size and accessible.
  215.  *
  216.  *      (*PFNVPMPGGETACCESS) (page, reserved, npages, flags, pbuf)
  217.  *
  218.  *      ENTRY:  page - target virtual page number
  219.  *              reserved - must be NULL
  220.  *              npages - number of pages to query
  221.  *              flags - VPMPG_SKIPFREE
  222.  *                      - do not stop when invalid page is found
  223.  *              pbuf - pointer to return array of bytes
  224.  *      EXIT:   0 if success, else error code
  225.  */
  226. typedef INT (*PFNVPMPGGETACCESS)(ULONG,PVOID,INT,INT,PCHAR);
  227. /*end*/
  228.  
  229. /***ET+ PFNVPMPGALLOCSIZEQUERY - return number of allocatable pages.
  230.  *
  231.  *      This type is a pointer to a function that returns the number
  232.  *      of pages the page manager believes could be allocated as swappable.
  233.  *      The returned value approximates a snapshot of reality and should
  234.  *      only be used as a guide; its accuracy is not to be relied upon.
  235.  *
  236.  *      This routine is swappable.
  237.  *
  238.  *      (*PFNVPMPGALLOCSIZEQUERY) (pnpages)
  239.  *
  240.  *      ENTRY   pnpages - pointer to unitialized integer
  241.  *      EXIT    0 on success
  242.  *                  *pnpages = number of pages believed to be allocatable
  243.  *              else error code
  244.  *
  245.  */
  246. typedef INT (*PFNVPMPGALLOCSIZEQUERY)(PINT);
  247. /*end*/
  248.  
  249. /* Structures and defines for *PFNVPMVMALLOCMEM */
  250.  
  251. /***ET+ VPMVMAC - VPMVMAllocMem packet structure */
  252.  
  253. typedef struct vpmvmac_s {
  254.         ULONG  vpmac_va;            /* Object's virtual address */
  255.         USHORT vpmac_res;           /* Reserved */
  256.         USHORT vpmac_hob;           /* Object's handle */
  257. } VPMVMAC;
  258.  
  259. typedef VPMVMAC *PVPMVMAC;
  260. /*end*/
  261.  
  262. /* VPMPG_W, VPMPG_U,VPMPG_X, VPMPG_R  - see v8086.h */
  263. #define VPMPG_SWAPPABLE    0x00000000      /* Swappable */
  264. #define VPMVMAC_OBSHIFT    23              /* Object record flag shift */
  265. #define VPMOB_SHRINKABLE   0x0001          /* Object is Shrinkable */
  266. #define VPMVMAC_OBSHRINK   ((LONG) VPMOB_SHRINKABLE << VPMVMAC_OBSHIFT)
  267. #define VPMVMAC_ALIGNPAGE  0x18000000L     /* Page alignment */
  268. #define VPMVMAC_ARENAPRV   0x02000000L     /* Private arena */
  269. #define VPMVMAC_LOCABOVE   0x40000000L     /* Allocate above address */
  270. #define VPMVMAC_LOCSPECIFIC 0x80000000L    /* Allocate at specific address */
  271. #define VPMVMAC_VDM        (0x00040000L)   /* VDM allocation */
  272. #define VPMVMFM_VDM        (0x00000004L)   /* Request on behalf of VDM */
  273.  
  274. //c-begin
  275. /***ET+ PFNVPMVMALLOCMEM - Reserve/commit virtual memory
  276.  *
  277.  *      This type is a pointer to a function that is used
  278.  *      to allocate virtual address space and optionally commit
  279.  *      physical storage to a contiguous region of the address
  280.  *      space beginning at the base of the object.
  281.  *
  282.  *      WARNING: This function is in swappable code.
  283.  *
  284.  *      (*PFNVPMVMALLOCMEM) (cb, cbCommit, fl, dummy1, dummy2, dummy3,
  285.  *                                              dummy4, dummy5, pac)
  286.  *
  287.  *      ENTRY  cb          - Size of virtual memory object in
  288.  *                           bytes.  This may not be changed
  289.  *                           subsequently.  Note that the size
  290.  *                           will be rounded up to page
  291.  *                           granularity, by adding the offset of
  292.  *                           the specific base address (if any)
  293.  *                           and rounding the result up to a
  294.  *                           multiple of the page size (4K).
  295.  *             cbCommit    - Amount of physical storage to be
  296.  *                           committed to contiguous virtual
  297.  *                           space  starting from the base of the
  298.  *                           object.
  299.  *             fl          - Allocation flags (see notes below)
  300.  *             reserved    - Must be NULL.
  301.  *             reserved    - Must be NULL.
  302.  *             reserved    - Must be NULL.
  303.  *             reserved    - Must be NULL.
  304.  *             reserved    - Must be NULL.
  305.  *             pac         - Address of output buffer.
  306.  *                           The buffer has the following format:
  307.  *
  308.  *                         struct vpmvmac_s
  309.  *                           {
  310.  *                             ulong_t ac_va;
  311.  *                             - Base virtual address
  312.  *                               A specific base virtual address
  313.  *                               or minimum base virtual address
  314.  *                               may be requested by setting its
  315.  *                               value here and specifying
  316.  *                               VPMVMAC_LOCSPECIFIC/VPMVMAC_LOCANY in
  317.  *                               the allocation flags.  The base
  318.  *                               address is rounded down to the
  319.  *                               nearest page boundary.  In all
  320.  *                               cases, the actual base address
  321.  *                               allocated to the object is
  322.  *                               returned.
  323.  *                             VMHOB ac_hob;
  324.  *                             - Object's handle
  325.  *                               The handle allocated to the object
  326.  *                               is returned.
  327.  *                             SEL dummy;
  328.  *                           }
  329.  *
  330.  *      EXIT            int       - Result code (NO_ERROR if successful)
  331.  *
  332.  *      NOTES on flags usage and calling VMAllocMem
  333.  *
  334.  *      (1) Give information about the base virtual address
  335.  *          of the object
  336.  *
  337.  *          VPMVMAC_LOCABOVE  - Base address must be above that given
  338.  *                              Not valid for heap allocs.
  339.  *
  340.  *      (2) Indicate the alignment of the base address
  341.  *          (4K page alignment is enforced; input addresses,
  342.  *          byte counts will be rounded automatically so that
  343.  *          the actual region allocated contains the whole of
  344.  *          its first and last page)
  345.  *
  346.  *          VPMVMAC_ALIGNPAGE - Page granularity
  347.  *
  348.  *      (3) Specify properties of object.
  349.  *
  350.  *          VPMVMAC_OBSHRINK  - Object is shrinkable
  351.  *          (physical commitment only, not virtual address space)
  352.  *
  353.  *      (4) Specify Page Manager information
  354.  *
  355.  *          Select one of each of the VPMPG_ state flags
  356.  *          and zero or more VPMPG_ permission and modifier flags.
  357.  *
  358.  */
  359. typedef INT (*PFNVPMVMALLOCMEM)(ULONG,ULONG,ULONG,USHORT,USHORT,USHORT, \
  360.                 ULONG,ULONG,PVPMVMAC);
  361. /*end*/
  362. //c-end
  363. //masm-begin
  364. /* DefType PFNVPMVMALLOCMEM,dd */
  365. //masm-end
  366.  
  367. #define VPMVMS_COMMIT      (0x00100000L)    /* Commit physical storage */
  368. #define VPMVMS_DECOMMIT    (0x00080000L)    /* Reserved for VMS_DECOMMIT */
  369. #define VPMVMS_DFLTPERM    VPMVMAC_LOCABOVE /* Use (initial) permissions */
  370. #define VPMPG_SKIPFREE     0x00008000       /* ignore free pages */
  371.  
  372. /***ET+ PFNVPMVMSETMEM - Commit/Decommit/Set Protection for Region
  373.  *
  374.  *      This type is a pointer to a function that performs one of three
  375.  *      functions:
  376.  *
  377.  *      Commit memory resources for region
  378.  *      Decommit memory resources for region
  379.  *      Set protection for memory region
  380.  *
  381.  *      Attempts to commit memory that is already committed
  382.  *      will return error.
  383.  *
  384.  *      WARNING: This procedure is in swappable code
  385.  *
  386.  *      (*PFNVPMVMSETMEM) (p, cb, reserved, fl, blkno)
  387.  *
  388.  *      ENTRY   p           - region's virtual address
  389.  *              cb          - region's size in bytes
  390.  *              reserved            - must be NULL
  391.  *              fl          - flags
  392.  *                            VPMVMS_COMMIT
  393.  *                              Commit memory resources
  394.  *                              NOTE:  The Page Manager storage
  395.  *                                     type and state must also be
  396.  *                                     specified using the appropriate
  397.  *                                     VPMPG_x and PAS_y flags, see
  398.  *                                     pgexport.h.
  399.  *                            VPMVMS_DECOMMIT
  400.  *                              Decommit memory resources
  401.  *                            VPMVMS_DFLTPERM
  402.  *                              Set access permissions to the default
  403.  *                              value (initial).
  404.  *                            VPMPG_SKIPFREE
  405.  *                              Ignore non-committed pages when setting
  406.  *                              access permissions or decommitting.  If
  407.  *                              not specified, attempting to decommit or
  408.  *                              set access permissions on uncommitted memory
  409.  *                              will return error.
  410.  *              dumm1       - reserved and must be 0.
  411.  *
  412.  *      RETURN  int         - return code (NO_ERROR if successful)
  413.  */
  414. typedef INT (*PFNVPMVMSETMEM)(ULONG,ULONG,USHORT,ULONG,ULONG);
  415. /*end*/
  416.  
  417. /***ET+ PFNVPMVMFREEMEM - Free reference to an object given base address.
  418.  *
  419.  *      This type is a pointer to a function that frees a reference to an
  420.  *      object from a given context given the base virtual address of the
  421.  *      object.
  422.  *
  423.  *      If there are memory resources committed to the region, they are freed
  424.  *      To decommit memory resources without dereserving address space a task
  425.  *      must use the VPMVMSetMem function.
  426.  *
  427.  *      WARNING: This function is in swappable code
  428.  *
  429.  *      (*PFNVPMVMFREEMEM) (p, reserved, fl)
  430.  *
  431.  *      ENTRY   p           - region's virtual address
  432.  *              reserved    - must be NULL
  433.  *              fl          - Flags
  434.  *                            VPMVMFM_VDM - call on behalf of VDM
  435.  *      RETURN  int         - Result code
  436.  *                              NO_ERROR = success
  437.  *                              non-zero = failure
  438.  *                              NOTE: ERROR_INTERRUPT will not
  439.  *                              be returned.  All free operations
  440.  *                              ignore interrupts.
  441.  *
  442.  */
  443. typedef INT (*PFNVPMVMFREEMEM)(ULONG,USHORT,ULONG);
  444. /*end*/
  445.  
  446.  
  447. /***ET+ PFNVPMDPMITASKSWITCH - report task switch
  448.  *
  449.  *      This type is a pointer to a function that reports a DPMI
  450.  *      task switch.
  451.  *
  452.  *      (*PFNVPMDPMITASKSWITCH) (pdhd)
  453.  *
  454.  *      ENTRY:  pdhd - pointer to new task
  455.  *      EXIT:   NONE
  456.  *
  457.  *
  458.  */
  459. typedef VOID (*PFNVPMDPMITASKSWITCH)(PVOID);
  460. /*end*/
  461.  
  462.  /* Definitions for the possible values returned in vpmx_CpuType */
  463. #define VPMCPU_286            0               /* processor is a 286 */
  464. #define VPMCPU_386            1               /* processor is a 386 */
  465. #define VPMCPU_486            2               /* processor is a 486 */
  466.  
  467. /***ET+ PFNVPMPGSWAP - note that page can be swapped out
  468.  *
  469.  *      This type is a pointer to a function that receives
  470.  *      notification that a page can be swapped.  The
  471.  *      kernel can choose to ignore the call or it can
  472.  *      arrange to swap out the page.
  473.  *
  474.  *      (*PFNVPMPGSWAP)(ipg, cpg)
  475.  *
  476.  *      ENTRY:  ipg      - target virtual page number
  477.  *              npages   - number of pages to query
  478.  *
  479.  *      EXIT:   NONE
  480.  */
  481. typedef VOID (*PFNVPMPGSWAP)(ULONG,ULONG);
  482. /*end*/
  483.  
  484. /***ET+ PFNVPMPGDISCARD - note that page can be discarded
  485.  *
  486.  *      This type is a pointer to a function that receives
  487.  *      notification that a page can be discarded.  The
  488.  *      kernel can choose to ignore the call or it can
  489.  *      free the page and mark it as allocated on access.
  490.  *
  491.  *      (*PFNVPMPGDISCARD)(ipg, cpg)
  492.  *
  493.  *      ENTRY:  ipg      - target virtual page number
  494.  *              npages   - number of pages to query
  495.  *
  496.  *      EXIT:   NONE
  497.  */
  498. typedef VOID (*PFNVPMPGDISCARD)(ULONG,ULONG);
  499. /*end*/
  500.  
  501. /***ET+ PFNVPMPGMAPPHYS - map physical page
  502.  *
  503.  *      This type is a pointer to a function that receives
  504.  *      requests to map physical pages in the VDM for
  505.  *      use by the client.  The kernel can decide whether
  506.  *      honoring a request is safe and refuse to honor
  507.  *      those that are not.
  508.  *
  509.  *    (*PFNVPMPGMAPPHYS)(pvpmac, ulPhys, cb)
  510.  *    ENTRY:    pvpmac      - VPMVMAllocMem pack structure
  511.  *                pvpmac->vpmac_va == -1 means any arbitrary address
  512.  *                (must be on page boundary)
  513.  *
  514.  *      (*PFNVPMPGMAPPHYS)(pladdr, ulPhys, cb)
  515.  *
  516.  *      ENTRY:  pladdr    - pointer to target linear address
  517.  *                          *pladdr == -1 means any arbitrary address
  518.  *                          (must be on page boundary)
  519.  *              ulPhys    - physical address to map
  520.  *              cb        - count of bytes
  521.  *
  522.  *      EXIT:   TRUE     - indicates success
  523.  *              FALSE    - indicates request was refused
  524.  */
  525. typedef BOOL (*PFNVPMPGMAPPHYS)(PVPMVMAC,ULONG,ULONG);
  526. /*end*/
  527.  
  528. /***ET+ PFNVPMNPXSTATUS - get NPX status
  529.  *
  530.  *      This type is a pointer to a function that returns
  531.  *      the information passed back for DPMI 1.0 function
  532.  *      0E01H.
  533.  *
  534.  *      (*PFNVPMNPXSTATUS)(pfl)
  535.  *
  536.  *      ENTRY:  pfl       - pointer to flags variable
  537.  *
  538.  *      EXIT:   TRUE     - indicates success
  539.  *                  *pfl filled as follows (see DPMI 1.0 spec)
  540.  *                      bit 0 set == coprocessor enabled for client
  541.  *                      bit 1 set == client is emulating
  542.  *                      bit 2 set == numeric coprocessor is present
  543.  *                      bit 3 set == host is emulating coprocessor
  544.  *                      bits 4-7  == 00h nocoprocessor
  545.  *                                   02h 80287
  546.  *                                   03h 80387
  547.  *                                   04h 80486 with coprocessor
  548.  *                      bits 8-31 == 0
  549.  *              FALSE    - indicates request was refused
  550.  */
  551. typedef BOOL (*PFNVPMNPXSTATUS)(PULONG);
  552. /*end*/
  553.  
  554. /***ET+ PFNVPMNPXSET - set NPX status
  555.  *
  556.  *      This type is a pointer to a function that turns
  557.  *      emulation on or off for a protect mode client.
  558.  *
  559.  *      (*PFNVPMNPXSET)(fl)
  560.  *
  561.  *      ENTRY:  fl       - flags variable
  562.  *                         bit 0 reset == disable coprocessor (ignore)
  563.  *                         bit 0 set   == enable coprocessor  (ignore)
  564.  *                         bit 1 reset == turn EM bit off
  565.  *                         bit 1 set   == turn EM bit on
  566.  *
  567.  *      EXIT:   TRUE     - indicates success
  568.  *              FALSE    - indicates request was refused
  569.  */
  570. typedef BOOL (*PFNVPMNPXSET)(ULONG);
  571. /*end*/
  572.  
  573. /***ET+  PFNVPMSELALLOCVDMSELS - allocate consecutive LDT sels for a DPMI VDM
  574.  *
  575.  *    This type is a pointer to a function that returns "csel" consecutive
  576.  *    free selectors from the current process's LDT. If csel consecutive
  577.  *    free selectors are not available and cselmin is not 0
  578.  *
  579.  *    (*PFNVPMSELALLOCVDMSELS) (csel,cselmin,psel)
  580.  *
  581.  *    The format of the free list is described in SELCreateVdmLDT().
  582.  *
  583.  *    ENTRY:    csel - number of contiguous selectors to allocate.
  584.  *        cselmin -
  585.  *        psel - on entry: if *psel == -1, allocate any selector,
  586.  *                  otherwise allocate that specific selector
  587.  *    EXIT:    NO_ERROR if success, else error code
  588.  *
  589.  */
  590. typedef INT (*PFNVPMSELALLOCVDMSELS)(ULONG, ULONG, PSEL);
  591. /*end*/
  592.  
  593. /***ET+  PFNSELFREEVDMSELS - free a group of DPMI LDT selectors
  594.  *
  595.  *    This type is a pointer to a function that frees a group of selectors
  596.  *    in the current process's LDT, and coallesces them with other adjacent
  597.  *    free selectors.
  598.  *
  599.  *     (*PFNSELFREEVDMSELS)(sel, cnt)
  600.  *
  601.  *    ENTRY:    sel - selector to free
  602.  *        cnt - number of contiguous selectors to free
  603.  *
  604.  *    EXIT:    NO_ERROR if success, else error
  605.  */
  606. typedef INT (*PFNVPMSELFREEVDMSELS)(SEL, USHORT);
  607. /*end*/
  608.  
  609.  
  610. /***ET+ VPMEXP - kernel exports to DPMI VDD for VDHRegisterDPMI
  611.  *
  612.  *      These entry points are passed from the kernel during the
  613.  *      exchange of entry points in VDHRegisterDPMI.
  614.  */
  615. typedef struct vpmx_s {
  616. PFNVPMDBGWPALLOCVDM        vpmx_DBGWPAllocVDM;
  617. PFNVPMDBGWPFREEVDM         vpmx_DBGWPFreeVDM;
  618. PFNVPMDBGDR6QUERYVDM       vpmx_DBGDR6QueryVDM;
  619. PFNVPMSELCREATEVDMLDT      vpmx_SELCreateVdmLDT;
  620. PFNVPMSELDESTROYVDMLDT     vpmx_SELDestroyVdmLDT;
  621. PFNVPMSELALLOCVDM          vpmx_SELAllocVdm;
  622. PFNVPMSELFREEVDM           vpmx_SELFreeVdm;
  623. PFNVPMSELGETVDMINFO        vpmx_SELGetVdmInfo;
  624. PFNVPMPGMOVE               vpmx_PGMove;
  625. PFNVPMPGGETACCESS          vpmx_PGGetAccess;
  626. PFNVPMPGALLOCSIZEQUERY     vpmx_PGAllocSizeQuery;
  627. PFNVPMVMALLOCMEM           vpmx_VMAllocMem;
  628. PFNVPMVMSETMEM             vpmx_VMSetMem;
  629. PFNVPMVMFREEMEM            vpmx_VMFreeMem;
  630. PFNVPMDPMITASKSWITCH       vpmx_em86DPMITaskSwitch;
  631. ULONG                      vpmx_SEL_VDM_LDT_INCR;
  632. ULONG                      vpmx_CpuType;
  633. ULONG                      vpmx_MaxAppLinAddr;
  634. ULONG                      vpmx_V86StackSize;
  635. PFNVPMPGSWAP               vpmx_pfnVPMPgSwap;
  636. PFNVPMPGDISCARD            vpmx_pfnVPMPgDiscard;
  637. PFNVPMPGMAPPHYS            vpmx_pfnVPMPgMapPhys;
  638. PFNVPMNPXSTATUS            vpmx_pfnVPMNpxStatus;
  639. PFNVPMNPXSET               vpmx_pfnVPMNpxSet;
  640. } VPMX;      /* vpmx */
  641.  
  642. typedef VPMX *PVPMX;  /* pvpmx */
  643. /*end*/
  644.  
  645. #endif
  646.  
  647.  
  648. /* NOINC */
  649. #if __IBMC__ || __IBMCPP__
  650.    #pragma info( none )
  651.       #ifndef __CHKHDR__
  652.          #pragma info( restore )
  653.       #endif
  654.    #pragma info( restore )
  655. #endif
  656. /* INC */
  657.