3 ;******************************************************************************
5 ; (C) Copyright MICROSOFT Corp. 1986
7 ; Title: MEMM - MICROSOFT Expanded Memory Manager 386
17 ;******************************************************************************
21 ; DATE REVISION DESCRIPTION
22 ; -------- -------- -------------------------------------------------------
24 ; 05/12/86 A Cleanup and segment reorganization
25 ; 06/08/86 B Added Disable A20 equates
26 ; 06/14/86 C Added MOV_CDTR_FRAME, PROT_INS_FRAME, and changed
27 ; VTFO from 2 to 4 to reflect push of EBP from BP
28 ; 06/15/86 D Added GPFAULT_FRAME
29 ; 06/28/86 0.02 Name change from MEMM386 to MEMM
30 ; 07/01/86 0.03 Added structures for accessing memory
32 ;******************************************************************************
38 ; Structures for accessing memory
51 ; Structure for accessing stack frame pushed during trap exit from VM
55 VMTF_EIP dw ? ; EIP (low)
59 VMTF_EFLAGS dw ? ; EFLAGS (low)
60 VMTF_EFLAGShi dw ? ; EFLAGS (high)
61 VMTF_ESP dw ? ; ESP (low)
75 ; Used in EmMovCDTR (vminst.asm)
77 MCF_WBP dw ? ; Work BP
78 MCF_WES dw ? ; Work ES
87 MCF_VMERR dw ? ; VM Error Code (low)
88 dw ? ; VM Error Code (high)
89 MCF_VMEIP dw ? ; VM EIP (low)
93 MCF_VMEFLAGS dw ? ; VM EFLAGS (low)
94 MCF_VMEFLAGShi dw ? ; VM EFLAGS (high)
95 MCF_VMESP dw ? ; VM ESP (low)
101 MCF_VMDS dw ? ; VM DS
103 MCF_VMFS dw ? ; VM FS
105 MCF_VMGS dw ? ; VM GS
109 ; Used in EmProtIns (vminst.asm)
111 PIF_WBP dw ? ; Work BP
112 PIF_WES dw ? ; Work ES
121 PIF_VMERR dw ? ; VM Error Code (low)
122 dw ? ; VM Error Code (high)
123 PIF_VMEIP dw ? ; VM EIP (low)
125 PIF_VMCS dw ? ; VM CS
127 PIF_VMEFLAGS dw ? ; VM EFLAGS (low)
128 PIF_VMEFLAGShi dw ? ; VM EFLAGS (high)
129 PIF_VMESP dw ? ; VM ESP (low)
131 PIF_VMSS dw ? ; VM SS
133 PIF_VMES dw ? ; VM ES
135 PIF_VMDS dw ? ; VM DS
137 PIF_VMFS dw ? ; VM FS
139 PIF_VMGS dw ? ; VM GS
152 ; The following constants define the offset of the Virtual Mode trap stack
153 ; frame (from current SP assuming BP has been pushed) for the two cases:
154 ; 1) exceptions that don't push error codes and 2) those that do.
156 VTFO equ 4 ; offset of VM trap stack frame
157 VTFOE equ VTFO + 4 ; as above, but including error code
159 ; These constants are used to sanity-check the value of SP when one of
160 ; the exception handlers has been entered:
163 extrn kstack_top:byte
167 VMT_STACK equ offset STACK:kstack_top - size VM_TRAP_FRAME - VTFO
169 VMTERR_STACK equ offset STACK:kstack_top - size VM_TRAP_FRAME - VTFOE
171 ;******************************************************************************
172 ; E R R O R C O D E S
173 ;******************************************************************************
175 PrivErr equ 0000h ; Privileged Operation Error class
176 ErrLGDT equ 0000h ; Client tried to execute a LGDT
177 ErrLIDT equ 0001h ; Client tried to execute a LIDT
178 ErrLMSW equ 0002h ; Client tried to execute a LMSW
179 Err2LL equ 0003h ; Client tried to execute a 286 Loadall
180 Err3LL equ 0004h ; Client tried to execute a 386 Loadall
181 ErrMovCR equ 0005h ; Client tried to execute a CRn mov
182 ErrMovDR equ 0006h ; Client tried to execute a DRn mov
183 ErrMovTR equ 0007h ; Client tried to execute a TRn mov
185 ExcpErr equ 0001h ; Exception Error class
186 ErrDIV equ 0000h ; Divide Error
187 ErrINT1 equ 0001h ; Debug Exception
188 ErrNMI equ 0002h ; NMI
189 ErrINT3 equ 0003h ; Int 3
190 ErrINTO equ 0004h ; Int O error
191 ErrBounds equ 0005h ; Array Bounds Check
192 ErrOpCode equ 0006h ; Invalid Opcode
193 ErrCoPNA equ 0007h ; Coprocessor Device not available
194 ErrDouble equ 0008h ; Double Fault
195 ErrCoPseg equ 0009h ; Coprocessor Segment Overrun
196 ErrTSS equ 000Ah ; Invalid TSS
197 ErrSegNP equ 000Bh ; Segment not Present
198 ErrStack equ 000Ch ; Stack Fault
199 ErrGP equ 000Dh ; General Protection Fault
200 ErrPage equ 000Eh ; Page Fault
201 ErrCoPerr equ 0010h ; Coprocessor Error
202 ErrWrite equ 0020h ; Attempt to write to protected area
203 ErrDMA equ 0021h ; Attempt to DMA into page frame (not for user)
204 ErrINTProt equ 0022h ; General Protected interrupt error
206 .list ; end of VM386.INC