Subversion Repositories Kolibri OS

Rev

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

Rev 9709 Rev 9715
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2021. 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: 9709 $
8
$Revision: 9715 $
9
 
9
 
10
align 4 ;3A08
10
align 4 ;3A08
11
build_interrupt_table:
11
build_interrupt_table:
Line 286... Line 286...
286
        add     ebx, 4
286
        add     ebx, 4
287
        call    .check_ESP
287
        call    .check_ESP
288
        test    eax, eax
288
        test    eax, eax
289
        jnz     .error_ESP
289
        jnz     .error_ESP
290
        DEBUGF  1, " [ESP+32]: %x\n",[ebx]
290
        DEBUGF  1, " [ESP+32]: %x\n",[ebx]
291
;for input instruction
-
 
292
        mov     ebx, [reg_eip+4]
-
 
293
        call    .check_ESP
-
 
294
        test    eax, eax
-
 
295
        jnz     .error_ESP
-
 
296
        DEBUGF  1, "K : [EIP]: %x",[ebx]
-
 
297
        add     ebx, 4
-
 
298
        call    .check_ESP
-
 
299
        test    eax, eax
-
 
300
        jnz     .error_ESP
-
 
301
        DEBUGF  1, " [EIP+4]: %x",[ebx]
-
 
302
        add     ebx, 4
-
 
303
        call    .check_ESP
-
 
304
        test    eax, eax
-
 
305
        jnz     .error_ESP
-
 
306
        DEBUGF  1, " [EIP+8]: %x\n",[ebx]
-
 
307
        add     ebx, 4
-
 
308
        call    .check_ESP
-
 
309
        test    eax, eax
-
 
310
        jnz     .error_ESP
-
 
311
        DEBUGF  1, "K : [EIP+12]: %x\n",[ebx]
-
 
312
        pop     edx ecx ebx eax
291
        pop     edx ecx ebx eax
313
        ret
292
        ret
314
.error_ESP:
293
.error_ESP:
315
        pop     edx ecx ebx eax
294
        pop     edx ecx ebx eax
316
        DEBUGF  1, "\n"
295
        DEBUGF  1, "\n"
Line 447... Line 426...
447
        call    lock_application_table
426
        call    lock_application_table
Line 448... Line 427...
448
 
427
 
449
; if the process is in V86 mode...
428
; if the process is in V86 mode...
450
        mov     eax, [.slot]
429
        mov     eax, [.slot]
451
        shl     eax, BSF sizeof.APPDATA
430
        shl     eax, BSF sizeof.APPDATA
452
        mov     esi, [eax+SLOT_BASE+APPDATA.pl0_stack]
431
        mov     esi, [SLOT_BASE + eax + APPDATA.pl0_stack]
453
        add     esi, RING0_STACK_SIZE
432
        add     esi, RING0_STACK_SIZE
454
        cmp     [eax+SLOT_BASE+APPDATA.saved_esp0], esi
433
        cmp     [SLOT_BASE + eax + APPDATA.saved_esp0], esi
455
        jz      .nov86
434
        jz      .nov86
456
; ...it has page directory for V86 mode
435
; ...it has page directory for V86 mode
457
        mov     esi, [eax+SLOT_BASE+APPDATA.saved_esp0]
436
        mov     esi, [SLOT_BASE + eax + APPDATA.saved_esp0]
458
        mov     ecx, [esi+4]
437
        mov     ecx, [esi+4]
459
        mov     [eax+SLOT_BASE+APPDATA.process], ecx
438
        mov     [SLOT_BASE + eax + APPDATA.process], ecx
460
; ...and I/O permission map for V86 mode
439
; ...and I/O permission map for V86 mode
461
        mov     ecx, [esi+12]
440
        mov     ecx, [esi+12]
462
        mov     [eax+SLOT_BASE+APPDATA.io_map], ecx
441
        mov     [SLOT_BASE + eax + APPDATA.io_map], ecx
463
        mov     ecx, [esi+8]
442
        mov     ecx, [esi+8]
464
        mov     [eax+SLOT_BASE+APPDATA.io_map+4], ecx
443
        mov     [SLOT_BASE + eax + APPDATA.io_map+4], ecx
465
.nov86:
444
.nov86:
466
; destroy per-thread kernel objects
445
; destroy per-thread kernel objects
467
        mov     esi, [.slot]
446
        mov     esi, [.slot]
468
        shl     esi, BSF sizeof.APPDATA
447
        shl     esi, BSF sizeof.APPDATA
Line 484... Line 463...
484
        mov     esi, [.slot]
463
        mov     esi, [.slot]
485
        cmp     [fpu_owner], esi ; if user fpu last -> fpu user = 2
464
        cmp     [fpu_owner], esi ; if user fpu last -> fpu user = 2
486
        jne     @F
465
        jne     @F
Line 487... Line 466...
487
 
466
 
488
        mov     [fpu_owner], 2
467
        mov     [fpu_owner], 2
489
        mov     eax, [sizeof.APPDATA*2+SLOT_BASE+APPDATA.fpu_state]
468
        mov     eax, [SLOT_BASE + sizeof.APPDATA*2 + APPDATA.fpu_state]
490
        clts
469
        clts
491
        bt      [cpu_caps], CAPS_SSE
470
        bt      [cpu_caps], CAPS_SSE
492
        jnc     .no_SSE
471
        jnc     .no_SSE
493
        fxrstor [eax]
472
        fxrstor [eax]
Line 672... Line 651...
672
        popad
651
        popad
673
 .dont_activate:
652
 .dont_activate:
Line 674... Line 653...
674
 
653
 
675
        push    esi     ; remove hd1 & cd & flp reservation
654
        push    esi     ; remove hd1 & cd & flp reservation
676
        shl     esi, BSF sizeof.APPDATA
655
        shl     esi, BSF sizeof.APPDATA
677
        mov     esi, [esi + SLOT_BASE + APPDATA.tid]
656
        mov     esi, [SLOT_BASE + esi + APPDATA.tid]
678
        cmp     [cd_status], esi
657
        cmp     [cd_status], esi
679
        jnz     @f
658
        jnz     @f
680
        call    free_cd_channel
659
        call    free_cd_channel
681
        and     [cd_status], 0
660
        and     [cd_status], 0
Line 688... Line 667...
688
@@:
667
@@:
Line 689... Line 668...
689
 
668
 
690
        pusha                 ; remove all port reservations
669
        pusha                 ; remove all port reservations
691
        mov     edx, esi
670
        mov     edx, esi
692
        shl     edx, BSF sizeof.APPDATA
671
        shl     edx, BSF sizeof.APPDATA
Line 693... Line 672...
693
        mov     edx, [edx + SLOT_BASE + APPDATA.tid]
672
        mov     edx, [SLOT_BASE + edx + APPDATA.tid]
Line 694... Line 673...
694
 
673
 
Line 731... Line 710...
731
  rmpr9:
710
  rmpr9:
Line 732... Line 711...
732
 
711
 
733
        popa
712
        popa
734
        mov     edi, esi ; do not run this process slot
713
        mov     edi, esi ; do not run this process slot
735
        shl     edi, BSF sizeof.APPDATA
714
        shl     edi, BSF sizeof.APPDATA
736
        mov     [edi + SLOT_BASE + APPDATA.state], TSTATE_FREE
715
        mov     [SLOT_BASE + edi + APPDATA.state], TSTATE_FREE
737
; debugger test - terminate all debuggees
716
; debugger test - terminate all debuggees
738
        mov     eax, 2
717
        mov     eax, 2
739
        mov     ecx, SLOT_BASE+2*sizeof.APPDATA + APPDATA.debugger_slot
718
        mov     ecx, SLOT_BASE + 2*sizeof.APPDATA + APPDATA.debugger_slot
740
.xd0:
719
.xd0: