Subversion Repositories Kolibri OS

Rev

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

Rev 3737 Rev 3817
Line 752... Line 752...
752
        get_from_queue (eax + SOCKET_QUEUE_LOCATION), MAX_backlog, 4, .block
752
        get_from_queue (eax + SOCKET_QUEUE_LOCATION), MAX_backlog, 4, .block
Line 753... Line 753...
753
 
753
 
754
; Ok, we got a socket ptr
754
; Ok, we got a socket ptr
Line 755... Line -...
755
        mov     eax, [esi]
-
 
756
 
-
 
757
; Convert it to a socket number
-
 
758
        call    SOCKET_ptr_to_num
-
 
759
        jz      .invalid        ; FIXME ?
755
        mov     eax, [esi]
760
 
756
 
761
; Change thread ID to that of the current thread
757
; Change thread ID to that of the current thread
762
        mov     ebx, [TASK_BASE]
758
        mov     ebx, [TASK_BASE]
Line -... Line 759...
-
 
759
        mov     ebx, [ebx + TASKDATA.pid]
-
 
760
        mov     [eax + SOCKET.TID], ebx
-
 
761
 
-
 
762
; Convert it to a socket number
763
        mov     ebx, [ebx + TASKDATA.pid]
763
        call    SOCKET_ptr_to_num
764
        mov     [eax + SOCKET.TID], ebx
764
        jz      .invalid        ; FIXME ?
765
 
765
 
Line 766... Line 766...
766
; and return it to caller
766
; and return it to caller
Line 1892... Line 1892...
1892
 
1892
 
1893
  .found_pid:
1893
  .found_pid:
1894
        shl     ecx, 8
1894
        shl     ecx, 8
Line 1895... Line 1895...
1895
        or      [ecx + SLOT_BASE + APPDATA.event_mask], EVENT_NETWORK
1895
        or      [ecx + SLOT_BASE + APPDATA.event_mask], EVENT_NETWORK
1896
 
-
 
1897
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Raised a network event!\n"
1896
 
Line 1898... Line 1897...
1898
 
1897
        DEBUGF  DEBUG_NETWORK_VERBOSE, "SOCKET_notify: poking thread %u!\n", eax
1899
        jmp     .done
1898
        jmp     .done
1900
 
1899
 
Line 2150... Line 2149...
2150
        mov     esi, esp
2149
        mov     esi, esp
2151
        add_to_queue (ebx + SOCKET_QUEUE_LOCATION), MAX_backlog, 4, .fail2
2150
        add_to_queue (ebx + SOCKET_QUEUE_LOCATION), MAX_backlog, 4, .fail2
2152
        pop     eax
2151
        pop     eax
Line 2153... Line 2152...
2153
 
2152
 
2154
; Copy structure from current socket to new
2153
; Copy structure from current socket to new
-
 
2154
; We start at PID to preserve the socket num, 2 pointers and mutex
2155
; We start at PID to preserve the socket num, and the 2 pointers at beginning of socket
2155
; TID will be filled in later
2156
        lea     esi, [ebx + SOCKET.PID]
2156
        lea     esi, [ebx + SOCKET.PID]
2157
        lea     edi, [eax + SOCKET.PID]
2157
        lea     edi, [eax + SOCKET.PID]
2158
        mov     ecx, (SOCKET_QUEUE_LOCATION - SOCKET.PID + 3)/4
2158
        mov     ecx, (SOCKET_QUEUE_LOCATION - SOCKET.PID + 3)/4
Line 2159... Line 2159...
2159
        rep movsd
2159
        rep movsd
Line -... Line 2160...
-
 
2160
 
-
 
2161
        and     [eax + SOCKET.options], not SO_ACCEPTCON
-
 
2162
 
-
 
2163
; Notify owner of parent socket
-
 
2164
        push    eax
-
 
2165
        mov     eax, ebx
2160
 
2166
        call    SOCKET_notify
Line 2161... Line 2167...
2161
        and     [eax + SOCKET.options], not SO_ACCEPTCON
2167
        pop     eax
2162
 
2168
 
2163
        ret
2169
        ret