Subversion Repositories Kolibri OS

Rev

Rev 9975 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9975 Rev 9976
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
4
;;  Distributed under terms of the GNU General Public License.  ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 9975 $
8
$Revision: 9976 $
9
 
9
 
10
struct EXCEPT_STACK
10
struct EXCEPT_STACK
11
    RegEIP     dd ?
11
    RegEIP     dd ?
Line 199... Line 199...
199
        call    change_task     ; SEE: core/shed.inc
199
        call    change_task     ; SEE: core/shed.inc
200
        restore_ring3_context
200
        restore_ring3_context
201
        iretd
201
        iretd
Line 202... Line 202...
202
 
202
 
-
 
203
IRetToUserHook:
-
 
204
        cmp     ebx, 12
-
 
205
        je      .ex_stack
-
 
206
        cmp     ebx, 14
-
 
207
        jne     .nostack
-
 
208
        mov     ecx, cr2
-
 
209
        sub     ecx, [reg_esp3]
-
 
210
        jg      .nostack
-
 
211
        add     ecx, 1000h
-
 
212
        jl      .nostack
-
 
213
.ex_stack:
-
 
214
        xor     ecx, ecx
-
 
215
        mov     ecx, [ecx+APP_HEADER_01_.except_stack_top]
-
 
216
        test    ecx, ecx
-
 
217
        jle     .nostack
-
 
218
        xchg    edi, eax
-
 
219
        sub     ecx, sizeof.EXCEPT_STACK
-
 
220
        push    ebx
-
 
221
        push    1
-
 
222
        pop     ebx
-
 
223
.lock:
-
 
224
        lock bts [ecx+EXCEPT_STACK.LockAccess], 0
-
 
225
        jnc     .lock1
-
 
226
        call    delay_hs_unprotected
-
 
227
        jmp     .lock
-
 
228
.lock1:
-
 
229
        pop     ebx
-
 
230
        cmp     ebx, 14
-
 
231
        jne     .ex12
-
 
232
        btr     [esi+APPDATA.except_mask], 12
-
 
233
        jc      .ex_stack1
-
 
234
        xchg    eax, edi
-
 
235
        jmp     .nostack
-
 
236
.ex_stack1:
-
 
237
        bts     [esi+APPDATA.except_mask], ebx
-
 
238
        dec     ebx
-
 
239
        dec     ebx
-
 
240
.ex12:
-
 
241
        mov     [ecx+EXCEPT_STACK.ExcCode], ebx
-
 
242
        mov     eax, ecx
-
 
243
        xchg    [reg_esp3], eax
-
 
244
        mov     [ecx+EXCEPT_STACK.OldESP], eax
-
 
245
        mov     eax, cr2
-
 
246
        mov     [ecx+EXCEPT_STACK.RegCR2], eax
-
 
247
        xchg    edi, [reg_eip]
-
 
248
        mov     [ecx+EXCEPT_STACK.RegEIP], edi
-
 
249
        jmp     .end
203
IRetToUserHook:
250
.nostack:
204
        xchg    eax, [reg_eip]
251
        xchg    eax, [reg_eip]
205
        sub     dword[reg_esp3], 8
252
        sub     dword[reg_esp3], 8
206
        mov     edi, [reg_esp3]
253
        mov     edi, [reg_esp3]
207
        stosd
254
        stosd
-
 
255
        mov     [edi], ebx
208
        mov     [edi], ebx
256
.end:
209
        restore_ring3_context
257
        restore_ring3_context
210
; simply return control to interrupted process
258
; simply return control to interrupted process
211
unknown_interrupt:
259
unknown_interrupt: