Rev 1056 | Rev 1076 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1056 | Rev 1074 | ||
---|---|---|---|
Line 9... | Line 9... | ||
9 | ;; Distributed under GPL. See file COPYING for details. ;; |
9 | ;; Distributed under GPL. See file COPYING for details. ;; |
10 | ;; Copyright 2003 Ville Turjanmaa ;; |
10 | ;; Copyright 2003 Ville Turjanmaa ;; |
11 | ;; ;; |
11 | ;; ;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
12 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 13... | Line 13... | ||
13 | 13 | ||
Line 14... | Line 14... | ||
14 | $Revision: 1056 $ |
14 | $Revision: 1074 $ |
15 | 15 | ||
16 | 16 | ||
Line 122... | Line 122... | ||
122 | reg_edi equ esp+0x00 |
122 | reg_edi equ esp+0x00 |
Line 123... | Line 123... | ||
123 | 123 | ||
124 | Mov ds,ax,app_data ; çàãðóçèì ïðàâèëüíûå çíà÷åíèÿ |
124 | Mov ds,ax,app_data ; çàãðóçèì ïðàâèëüíûå çíà÷åíèÿ |
125 | mov es,ax ; â ñåãìåíòíûå ðåãèñòðû |
125 | mov es,ax ; â ñåãìåíòíûå ðåãèñòðû |
- | 126 | cld ; è ïðèâîäèì DF ê ñòàíäàðòó |
|
126 | cld ; è ïðèâîäèì DF ê ñòàíäàðòó |
127 | movzx ebx,bl |
127 | ; redirect to V86 manager? (EFLAGS & 0x20000) != 0? |
128 | ; redirect to V86 manager? (EFLAGS & 0x20000) != 0? |
128 | test byte[reg_eflags+2],2 |
129 | test byte[reg_eflags+2],2 |
129 | jnz v86_exc_c |
130 | jnz v86_exc_c |
130 | cmp bl,14 ; #PF |
131 | cmp bl,14 ; #PF |
131 | jne .l0 |
132 | jne @f |
132 | call page_fault_handler |
133 | call page_fault_handler |
133 | .l0: mov esi, [current_slot] |
134 | @@: mov esi, [current_slot] |
134 | mov eax,[esi+APPDATA.fpu_handler] |
- | |
135 | cmp bl,16 ; #MF |
- | |
136 | je .l1 |
- | |
137 | cmp bl,19 ; #XF |
135 | btr [esi+APPDATA.except_mask], ebx |
138 | jne .l2 |
136 | jnc @f |
139 | mov eax,[esi+APPDATA.sse_handler] |
137 | mov eax,[esi+APPDATA.exc_handler] |
140 | .l1: test eax, eax |
138 | test eax, eax |
141 | jnz IRetToUserHook |
139 | jnz IRetToUserHook |
142 | .l2: cli |
140 | @@: cli |
143 | mov eax, [esi+APPDATA.debugger_slot] |
141 | mov eax, [esi+APPDATA.debugger_slot] |
144 | test eax, eax |
142 | test eax, eax |
145 | jnz .debug |
143 | jnz .debug |
146 | sti |
144 | sti |
Line 152... | Line 150... | ||
152 | .debug: |
150 | .debug: |
153 | ; we are debugged process, notify debugger and suspend ourself |
151 | ; we are debugged process, notify debugger and suspend ourself |
154 | ; eax=debugger PID |
152 | ; eax=debugger PID |
155 | cmp bl,1 ; #DB |
153 | cmp bl,1 ; #DB |
156 | je debug_ex |
154 | je debug_ex |
157 | movzx edx, bl ; debug_message data=Number_Of_Exception |
155 | mov edx, ebx ; debug_message data=Number_Of_Exception |
158 | mov ecx,1 ; debug_message code=other_exception |
156 | mov ecx,1 ; debug_message code=other_exception |
159 | jmp debug_ex.notify ; notify debugger and suspend ourself |
157 | jmp debug_ex.notify ; notify debugger and suspend ourself |
Line 160... | Line 158... | ||
160 | 158 | ||
161 | IRetToUserHook: |
159 | IRetToUserHook: |
162 | xchg eax, [reg_eip] |
160 | xchg eax, [reg_eip] |
163 | sub dword[reg_esp3], 4 |
161 | sub dword[reg_esp3], 8 |
164 | mov edi, [reg_esp3] |
162 | mov edi, [reg_esp3] |
- | 163 | stosd |
|
165 | stosd |
164 | mov [edi], ebx |
166 | restore_ring3_context |
165 | restore_ring3_context |
167 | unknown_interrupt: |
166 | unknown_interrupt: |
Line 168... | Line 167... | ||
168 | iretd |
167 | iretd |
Line 174... | Line 173... | ||
174 | cmp bl, 0x08 |
173 | cmp bl, 0x08 |
175 | jb .l0 |
174 | jb .l0 |
176 | cmp bl, 0x0e |
175 | cmp bl, 0x0e |
177 | jbe .l1 |
176 | jbe .l1 |
178 | .l0: mov bl, 0x09 |
177 | .l0: mov bl, 0x09 |
179 | .l1: movzx eax,bl |
- | |
180 | mov eax,[msg_fault_sel+eax*4 - 0x08*4] |
178 | .l1: mov eax,[msg_fault_sel+ebx*4 - 0x08*4] |
181 | DEBUGF 1, "K : %s\n", eax |
179 | DEBUGF 1, "K : %s\n", eax |
182 | mov eax, [reg_cs3+4] |
180 | mov eax, [reg_cs3+4] |
183 | mov edi, msg_sel_app |
181 | mov edi, msg_sel_app |
184 | mov ebx, [reg_esp3+4] |
182 | mov ebx, [reg_esp3+4] |
185 | cmp eax, app_code |
183 | cmp eax, app_code |