Subversion Repositories Kolibri OS

Rev

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

Rev 3520 Rev 3598
Line 296... Line 296...
296
.Buffer         dd      ?       ; request_queue_item.Buffer
296
.Buffer         dd      ?       ; request_queue_item.Buffer
297
.Callback       dd      ?       ; request_queue_item.Callback
297
.Callback       dd      ?       ; request_queue_item.Callback
298
.UserData       dd      ?       ; request_queue_item.UserData
298
.UserData       dd      ?       ; request_queue_item.UserData
299
end virtual
299
end virtual
300
; 1. Allocate the memory for the request description.
300
; 1. Allocate the memory for the request description.
301
        push    request_queue_item.sizeof
301
        movi    eax, request_queue_item.sizeof
302
        pop     eax
-
 
303
        call    Kmalloc
302
        call    Kmalloc
304
        test    eax, eax
303
        test    eax, eax
305
        jnz     @f
304
        jnz     @f
306
        mov     esi, nomemory
305
        mov     esi, nomemory
307
        call    SysMsgBoardStr
306
        call    SysMsgBoardStr
Line 1002... Line 1001...
1002
; waiting for results of USB requests, but we need to exit this callback
1001
; waiting for results of USB requests, but we need to exit this callback
1003
; to allow the USB thread to continue working and handling those requests.
1002
; to allow the USB thread to continue working and handling those requests.
1004
; 4. Thus, create a temporary kernel thread which would do it.
1003
; 4. Thus, create a temporary kernel thread which would do it.
1005
        mov     edx, [esp+8]
1004
        mov     edx, [esp+8]
1006
        push    ebx ecx
1005
        push    ebx ecx
1007
        push    51
-
 
1008
        pop     eax
1006
        movi    eax, 51
1009
        push    1
-
 
1010
        pop     ebx
1007
        movi    ebx, 1
1011
        mov     ecx, new_disk_thread
1008
        mov     ecx, new_disk_thread
1012
        ; edx = parameter
1009
        ; edx = parameter
1013
        int     0x40
1010
        int     0x40
1014
        pop     ecx ebx
1011
        pop     ecx ebx
1015
        cmp     eax, -1
1012
        cmp     eax, -1
Line 1067... Line 1064...
1067
; Otherwise, go to 4.
1064
; Otherwise, go to 4.
1068
        inc     [edx+usb_unit_data.UnitReadyAttempts]
1065
        inc     [edx+usb_unit_data.UnitReadyAttempts]
1069
        cmp     [edx+usb_unit_data.UnitReadyAttempts], 3
1066
        cmp     [edx+usb_unit_data.UnitReadyAttempts], 3
1070
        jz      @f
1067
        jz      @f
1071
        push    ecx edx esi
1068
        push    ecx edx esi
1072
        push    10
-
 
1073
        pop     esi
1069
        movi    esi, 10
1074
        call    Sleep
1070
        call    Sleep
1075
        pop     esi edx ecx
1071
        pop     esi edx ecx
1076
        stdcall queue_request, ecx, test_unit_ready_req, 0, test_unit_ready_callback, edx
1072
        stdcall queue_request, ecx, test_unit_ready_req, 0, test_unit_ready_callback, edx
1077
        ret     8
1073
        ret     8
1078
@@:
1074
@@:
Line 1122... Line 1118...
1122
        mov     dword [esp], 'usbh'
1118
        mov     dword [esp], 'usbh'
1123
        lea     edi, [esp+5]
1119
        lea     edi, [esp+5]
1124
        mov     byte [edi-1], 'd'
1120
        mov     byte [edi-1], 'd'
1125
        push    eax
1121
        push    eax
1126
        push    -'0'
1122
        push    -'0'
1127
        push    10
-
 
1128
        pop     ecx
1123
        movi    ecx, 10
1129
@@:
1124
@@:
1130
        cdq
1125
        cdq
1131
        div     ecx
1126
        div     ecx
1132
        push    edx
1127
        push    edx
1133
        test    eax, eax
1128
        test    eax, eax