Subversion Repositories Kolibri OS

Rev

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

Rev 9742 Rev 9743
Line 75... Line 75...
75
format binary as "mnt"
75
format binary as "mnt"
Line 76... Line 76...
76
 
76
 
77
include 'macros.inc'
77
include 'macros.inc'
Line 78... Line 78...
78
include 'struct.inc'
78
include 'struct.inc'
Line 79... Line 79...
79
 
79
 
80
$Revision: 9742 $
80
$Revision: 9743 $
Line 3487... Line 3487...
3487
; out: not return value
3487
; out: not return value
3488
align 4
3488
align 4
3489
set_io_access_rights:
3489
set_io_access_rights:
3490
        push    edi eax
3490
        push    edi eax
3491
        mov     edi, tss._io_map_0
3491
        mov     edi, tss._io_map_0
3492
;     mov   ecx,eax
-
 
3493
;     and   ecx,7    ; offset in byte
-
 
3494
;     shr   eax,3    ; number of byte
-
 
3495
;     add   edi,eax
-
 
3496
;     mov   ebx,1
-
 
3497
;     shl   ebx,cl
-
 
-
 
3492
 
3498
        test    ebp, ebp         ; enable access - ebp = 0
3493
        test    ebp, ebp         ; enable access - ebp = 0
3499
        jnz     .siar1
3494
        jnz     .siar1
3500
;     not   ebx
3495
 
3501
;     and   [edi],byte bl
-
 
3502
        btr     [edi], eax
3496
        btr     [edi], eax
3503
        pop     eax edi
3497
        pop     eax edi
3504
        ret
3498
        ret
3505
.siar1:
3499
.siar1:
3506
        bts     [edi], eax      ; disable access - ebp = 1
3500
        bts     [edi], eax      ; disable access - ebp = 1
3507
        pop     eax edi
3501
        pop     eax edi
3508
        ret
3502
        ret
Line 3509... Line 3503...
3509
 
3503
 
-
 
3504
align 4
-
 
3505
; @brief ReservePortArea and FreePortArea
-
 
3506
; @param edx number end arrea of ports (include last number of port)
-
 
3507
; @param ecx number start arrea of ports
-
 
3508
; @param ebx sub function 0 - reserve, 1 - free
-
 
3509
; @param eax 46 - number function
3510
align 4
3510
; @returns  eax = 0 - succesful eax = 1 - error
Line 3511... Line 3511...
3511
syscall_reserveportarea:                ; ReservePortArea and FreePortArea
3511
syscall_reserveportarea:        ; ReservePortArea and FreePortArea
3512
 
3512
 
3513
        call    r_f_port_area
3513
        call    r_f_port_area
Line 3530... Line 3530...
3530
        test    ebx, ebx
3530
        test    ebx, ebx
3531
        jnz     free_port_area
3531
        jnz     free_port_area
Line 3532... Line 3532...
3532
 
3532
 
3533
        cmp     ecx, edx      ; beginning > end ?
3533
        cmp     ecx, edx      ; beginning > end ?
3534
        ja      rpal1
3534
        ja      rpal1
3535
        cmp     edx, 65536
3535
        cmp     edx, 65536    ;test ebx, not 0xffff
3536
        jae     rpal1
3536
        jae     rpal1
3537
        mov     eax, [RESERVED_PORTS]
3537
        mov     eax, [RESERVED_PORTS]
3538
        test    eax, eax      ; no reserved areas ?
3538
        test    eax, eax      ; no reserved areas ?
3539
        je      rpal2
3539
        je      rpal2
3540
        cmp     eax, 255      ; max reserved
3540
        cmp     eax, 255      ; max reserved
3541
        jae     rpal1
3541
        jae     rpal1
3542
 rpal3:
3542
 rpal3:
3543
        mov     ebx, eax
3543
        mov     ebx, eax
3544
        shl     ebx, 4
3544
        shl     ebx, 4   ;16 byte is sizeof item in RESERVED_PORTS table
3545
        add     ebx, RESERVED_PORTS
3545
        add     ebx, RESERVED_PORTS
3546
        cmp     ecx, [ebx+8]
3546
        cmp     ecx, [ebx+8]
3547
        ja      rpal4
3547
        ja      rpal4
3548
        cmp     edx, [ebx+4]
3548
        cmp     edx, [ebx+4]
Line 3576... Line 3576...
3576
        mov     [RESERVED_PORTS], eax
3576
        mov     [RESERVED_PORTS], eax
3577
        shl     eax, 4
3577
        shl     eax, 4
3578
        add     eax, RESERVED_PORTS
3578
        add     eax, RESERVED_PORTS
3579
        mov     ebx, [current_slot]
3579
        mov     ebx, [current_slot]
3580
        mov     ebx, [ebx + APPDATA.tid]
3580
        mov     ebx, [ebx + APPDATA.tid]
3581
        mov     [eax], ebx
3581
        mov     [eax], ebx   ; tid
3582
        mov     [eax+4], ecx
3582
        mov     [eax+4], ecx ;start port
3583
        mov     [eax+8], edx
3583
        mov     [eax+8], edx ;finish port
Line 3584... Line 3584...
3584
 
3584
 
3585
        xor     eax, eax
3585
        xor     eax, eax
Line 3586... Line 3586...
3586
        ret
3586
        ret