2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/vdm.h
5 * PURPOSE: Internal header for V86 and VDM Support
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
10 // Define this if you want debugging support
12 #define _VM_DEBUG_ 0x00
15 // These define the Debug Masks Supported
17 #define VM_EXEC_DEBUG 0x01
20 // Debug/Tracing support
23 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
24 #define VMTRACE DbgPrintEx
26 #define VMTRACE(x, ...) \
27 if (x & VdmpTraceLevel) DbgPrint(__VA_ARGS__)
30 #define VMTRACE(x, ...) DPRINT(__VA_ARGS__)
34 // Memory addresses inside CSRSS for V86 Support
36 #define TRAMPOLINE_BASE 0x10000
37 #define TRAMPOLINE_TIB 0x12000
38 #define TRAMPOLINE_TEB 0x13000
41 // BOP (Magic Opcode) to exit V86 Mode
43 #define TRAMPOLINE_BOP 0xFEC4C4
49 (PULONG)FIXED_NTVDMSTATE_LINEAR_PC_AT
54 typedef enum _VdmEventClass
63 } VDMEVENTCLASS
, *PVDMEVENTCLASS
;
66 // VDM Interrupt and Fault Handler Definitions
68 typedef struct _Vdm_InterruptHandler
73 } VDM_INTERRUPTHANDLER
, *PVDM_INTERRUPTHANDLER
;
75 typedef struct _Vdm_FaultHandler
82 } VDM_FAULTHANDLER
, *PVDM_FAULTHANDLER
;
85 // VDM Event Information
87 typedef struct _VdmEventInfo
91 ULONG InstructionSize
;
95 //VDMSTRINGIOINFO StringIoInfo;
97 //VDMFAULTINFO FaultInfo;
101 } VDMEVENTINFO
, *PVDMEVENTINFO
;
104 // VDM Printer Information
106 typedef struct _Vdm_Printer_Info
110 } VDM_PRINTER_INFO
, *PVDM_PRINTER_INFO
;
113 // VDM Trace Information
115 typedef struct _VdmTraceInfo
120 } VDMTRACEINFO
, *PVDMTRACEINFO
;
125 typedef struct _tagFAMILY_TABLE
129 } FAMILY_TABLE
, *PFAMILY_TABLE
;
132 // Thread Information Block for VDM Threads
134 typedef struct _Vdm_Tib
137 PVDM_INTERRUPTHANDLER VdmInterruptTable
;
138 PVDM_FAULTHANDLER VdmFaultTable
;
139 CONTEXT MonitorContext
;
141 VDMEVENTINFO EventInfo
;
142 VDM_PRINTER_INFO PrinterInfo
;
145 VDMTRACEINFO TraceInfo
;
148 PFAMILY_TABLE
*pDpmFamTbls
;
149 BOOLEAN ContinueExecution
;
150 } VDM_TIB
, *PVDM_TIB
;
153 // Process Information Block for VDM Processes
155 typedef struct _VDM_PROCESS_OBJECTS
157 PVOID VdmIoListHead
; // PVDM_IO_LISTHEAD
159 KAPC QueuedIntUserApc
;
160 FAST_MUTEX DelayIntFastMutex
;
161 KSPIN_LOCK DelayIntSpinLock
;
162 LIST_ENTRY DelayIntListHead
;
163 PVOID pIcaUserData
; // VDMICAUSERDATA
167 UCHAR PrinterControl
;
169 UCHAR PrinterHostState
;
171 USHORT AdlibIndexRegister
;
172 USHORT AdlibPhysPortStart
;
173 USHORT AdlibPhysPortEnd
;
174 USHORT AdlibVirtPortStart
;
175 USHORT AdlibVirtPortEnd
;
178 ULONG PMCliTimeStamp
;
179 } VDM_PROCESS_OBJECTS
, *PVDM_PROCESS_OBJECTS
;
191 // Global data inside the VDM