Subversion Repositories Kolibri OS

Rev

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

Rev 8876 Rev 9709
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2017. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2017. 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: 8876 $
8
$Revision: 9709 $
9
 
9
 
10
align 4
10
align 4
11
;struct futex*  __fastcall create_futex(int *ptr)
11
;struct futex*  __fastcall create_futex(int *ptr)
Line 124... Line 124...
124
.wait_slow:
124
.wait_slow:
125
        pushfd
125
        pushfd
126
        cli
126
        cli
Line 127... Line 127...
127
 
127
 
128
        sub     esp, sizeof.MUTEX_WAITER
128
        sub     esp, sizeof.MUTEX_WAITER
129
        mov     ebx, [TASK_BASE]
129
        mov     ebx, [current_slot]
130
        mov     [esp+MUTEX_WAITER.task], ebx
130
        mov     [esp+MUTEX_WAITER.task], ebx
Line 131... Line 131...
131
        lea     esi, [ebp+FUTEX.wait_list]
131
        lea     esi, [ebp+FUTEX.wait_list]
132
 
132
 
133
        list_add_tail esp, esi      ;esp= new waiter, esi= list head
133
        list_add_tail esp, esi      ;esp= new waiter, esi= list head
134
        mov     eax, edx
134
        mov     eax, edx
135
.again:
135
.again:
Line 136... Line 136...
136
        mov     [ebx+TASKDATA.state], TSTATE_RUN_SUSPENDED
136
        mov     [ebx + APPDATA.state], TSTATE_RUN_SUSPENDED
137
        call    change_task
137
        call    change_task
Line 177... Line 177...
177
        mov     [ebx+APPDATA.wait_test], sys_futex.wait_test
177
        mov     [ebx+APPDATA.wait_test], sys_futex.wait_test
178
        mov     [ebx+APPDATA.wait_timeout], esi
178
        mov     [ebx+APPDATA.wait_timeout], esi
179
        mov     [ebx+APPDATA.wait_param], ebp
179
        mov     [ebx+APPDATA.wait_param], ebp
180
        mov     eax, [timer_ticks]
180
        mov     eax, [timer_ticks]
181
        mov     [ebx+APPDATA.wait_begin], eax
181
        mov     [ebx+APPDATA.wait_begin], eax
182
        mov     eax, [TASK_BASE]
-
 
183
        mov     [eax+TASKDATA.state], TSTATE_WAITING
182
        mov     [ebx + APPDATA.state], TSTATE_WAITING
Line 184... Line 183...
184
 
183
 
185
        mov     [esp+MUTEX_WAITER.task], eax
184
        mov     [esp+MUTEX_WAITER.task], ebx
Line 186... Line 185...
186
        lea     esi, [ebp+FUTEX.wait_list]
185
        lea     esi, [ebp+FUTEX.wait_list]
Line 187... Line 186...
187
 
186
 
Line 230... Line 229...
230
.again_wake:
229
.again_wake:
231
        cmp     esi, ebx
230
        cmp     esi, ebx
232
        je      .done
231
        je      .done
Line 233... Line 232...
233
 
232
 
234
        mov     eax, [esi+MUTEX_WAITER.task]
233
        mov     eax, [esi+MUTEX_WAITER.task]
Line 235... Line 234...
235
        mov     [eax+TASKDATA.state], TSTATE_RUNNING
234
        mov     [eax + APPDATA.state], TSTATE_RUNNING
236
 
235
 
237
        mov     esi, [esi+MUTEX_WAITER.list.next]
236
        mov     esi, [esi+MUTEX_WAITER.list.next]
238
        inc     ecx
237
        inc     ecx