
/***    VPM.H
 *
 *      SCCSID = @(#)vpm.h      6.3 91/07/08
 *
 *      Version 1.10, for src/dos/mvdm/vpm.h, em86, mer.krnl, 960610.1
 *
 *      IBM/Microsoft Confidential
 *
 *      Copyright (c) IBM Corporation 1987, 1989
 *      Copyright (c) Microsoft Corporation 1987, 1989
 *
 *      All Rights Reserved
 *
 *      Title:
 *
 *      DPMI host per task data
 *
 *      Description:
 *
 *      Contains the vpm definitions
 *
 *      Modification History:
 *
 *      03-12-96 Gil Pratte - Implementing feature 149002    * 149002 *
 *        Changed DPMI Version Number from 0.95 to 1.0       * 149002 *
 *
 *      Gordon Kuo    02-24-96                 149007
 *      Add vpmd_pav86exc to VPMD to handle the V86 Excepton Handler
 *
 *      Gordon Kuo    05-29-96                 153491
 *      Dbase IV Check Version # to process its timer process
 *
 */

//#define DPMI_VERSION  0x100                                 /* 149002 */
#define DPMI_VERSION  0x05F             /* Put back to 0.95      153491 */

//masm-begin
//DefType LIDTS,df                        ;fword for lidt
//DefType SELSWINFO,selswitchvdm_s
//masm-end

/***LT+ VPMD - DPMI em86 per task data block
 *
 *      This is the em86 DPMI instance data for a task.
 *      Note: there is one structure per dpmi start call in a VDM.
 */

typedef struct vpmd_s {
//c-begin
    VPMINT (*vpmd_pavpmint)[VPM_NUM_INTS];       /* Interrupt shadow table */
    VPMEXC (*vpmd_pavpmexc)[VPM_NUM_EXCEPTIONS]; /* Exception shadow table(PM)*/
    VPMEXC (*vpmd_pav86exc)[VPM_NUM_EXCEPTIONS]; /* 149007 */
             /* Exception shadow table V86*/     /* GK 149007 */
    struct gate (*vpmd_pagateVPMIDT)[VPM_NUM_INTS]; /* IDT base address    */
//c-end
//masm-begin
//  PVOID  vpmd_pavpmint            ;Interrupt shadow table
//  PVOID  vpmd_pavpmexc            ;Exception shadow table
//  PVOID  vpmd_pav86exc            ;Exception shadow table  149007
//  PVOID  vpmd_pagateVPMIDT        ;IDT base address
//masm-end
    SEL    vpmd_selBIOSarea;        /* LDT selector for BIOS data area    */
    SEL    vpmd_selVIDEOarea;       /* LDT selector for video data area   */
    ULONG  vpmd_flSaveVdmStatus;    /* VDM status flags for this client   */
    ULONG  vpmd_aulVPMCurrentState[VSF_ALT_SIZE/4];
    PVOID  vpmd_pVPMStack;          /* ptr to protect mode stack          */
    SEL    vpmd_selVPMStack;        /* selector for PM "locked" stack     */
    ULONG  vpmd_cVPMStack;          /* usage count for PM stack           */
    SEL    vpmd_selOldVPMSS;        /* sel before stack switch            */
    ULONG  vpmd_ulOldVPMESP;        /* offset before stack switch         */
    SELSWINFO vpmd_LDTswinfo;       /* Info for SELSwitchVdmLDT           */
//c-begin
    struct lidt_s vpmd_lidtVPMIDT;   /* limit/base of VDM prot mode IDT    */
//c-end
//masm-begin
//  LIDTS  vpmd_lidtVPMIDT          ;limit/base of VDM prot mode IDT
//masm-end
    em86AssertDef(VPMD)               // assertion checking
} VPMD;

typedef VPMD *PVPMD;


#define VPMD_SIGNATURE                   0x444D5056      // "VPMD"
