home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / VPMX2.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  21KB  |  652 lines

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