summaryrefslogtreecommitdiffstats
path: root/private/mvdm/inc/dpmi.h
blob: 2131cdc801734482471b0c44a345fc351fa8dab2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*++

Copyright (c) 1991  Microsoft Corporation

Module Name:

    dpmi.h

Abstract:

    This file contains code to implement support for the DPMI bops

Author:

    Dave Hastings (daveh) 27-Jun-1991

Revision History:


--*/

/* ASM
ifdef WOW_x86
include vint.inc
endif
include bop.inc
*/
#define LDT_SIZE 0x1FFF

// DPMI Bop Sub Functions

#define SetDescriptorTableEntries   0
#define DPMISwitchToProtectedMode   1 /* prefix necessary */
#define SetProtectedmodeInterrupt   2
#define GetFastBopAddress           3
#define InitDosx                    4
#define InitApp                     5
#define XlatInt21Call               6
#define AllocXmem                   7
#define FreeXmem                    8
#define ReallocXmem                 9
#define SetFaultHandler             10
#define GetMemoryInformation        11
#define DpmiInUse                   12
#define DpmiNoLongerInUse           13
#define SetDebugRegisters           14
#define PassTableAddress            15
#define TerminateApp                16
#define InitializePmStackInfo       17
#define VcdPmSvcCall32              18
#define FreeAllXmem                 19
#define IntHandlerIret              20
#define IntHandlerIretd             21
#define FaultHandlerIret            22
#define FaultHandlerIretd           23
#define DpmiUnhandledException      24

#define MAX_DPMI_BOP_FUNC DpmiUnhandledException + 1

/* ASM
DPMIBOP macro SubFun
    BOP BOP_DPMI
    db SubFun
    endm
*/

/* XLATOFF */
#if DBG

#define DBGTRACE(Type, v1, v2, v3) DpmiDbgTrace(Type, v1, v2, v3)

#else

#define DBGTRACE(Type, v1, v2, v3) {}

#endif

/* XLATON */


VOID DpmiDbgTrace(
    int Type,
    ULONG v1,
    ULONG v2,
    ULONG v3
    );


#define DPMI_SET_PMODE_INT_HANDLER  1
#define DPMI_SET_FAULT_HANDLER      2
#define DPMI_DISPATCH_INT           3
#define DPMI_HW_INT                 4
#define DPMI_SW_INT                 5
#define DPMI_INT_IRET16             6
#define DPMI_INT_IRET32             7
#define DPMI_FAULT                  8
#define DPMI_DISPATCH_FAULT         9
#define DPMI_FAULT_IRET             10
#define DPMI_OP_EMULATION           11
#define DPMI_DISPATCH_ENTRY         12


typedef struct _DPMI_TRACE_ENTRY { /* DPMITRACE */
    int Type;
    ULONG v1;
    ULONG v2;
    ULONG v3;
    ULONG eax;
    ULONG ebx;
    ULONG ecx;
    ULONG edx;
    ULONG esi;
    ULONG edi;
    ULONG ebp;
    ULONG esp;
    ULONG eip;
    ULONG eflags;
    USHORT cs;
    USHORT ds;
    USHORT es;
    USHORT fs;
    USHORT gs;
    USHORT ss;
} DPMI_TRACE_ENTRY;