Rev 5599 | Rev 6078 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5599 | Rev 5605 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | ;; ;; |
5 | ;; ;; |
6 | ;; Synhronization for MenuetOS. ;; |
6 | ;; Synhronization for MenuetOS. ;; |
7 | ;; Author: Halyavin Andrey, halyavin@land.ru ;; |
7 | ;; Author: Halyavin Andrey, halyavin@land.ru ;; |
8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 9... | Line 9... | ||
9 | 9 | ||
Line 10... | Line 10... | ||
10 | $Revision: 5599 $ |
10 | $Revision: 5605 $ |
11 | 11 | ||
12 | align 4 |
12 | align 4 |
13 | ;struct futex* __fastcall create_futex(int *ptr) |
13 | ;struct futex* __fastcall create_futex(int *ptr) |
Line 229... | Line 229... | ||
229 | ret |
229 | ret |
Line 230... | Line 230... | ||
230 | 230 | ||
231 | 231 | ||
- | 232 | align 4 |
|
232 | align 4 |
233 | ;ecx futex handle |
233 | ;ecx futex handle |
234 | ;edx numder of threads |
234 | ;esi current process |
- | |
235 | ;edi futex object |
235 | ;edi current process |
Line 236... | Line 236... | ||
236 | ;edx threads count |
236 | ;ebp futex object |
Line 237... | Line 237... | ||
237 | .futex_wake: |
237 | .futex_wake: |
238 | 238 | ||
Line 239... | Line 239... | ||
239 | xor ecx, ecx |
239 | xor ecx, ecx |
240 | 240 | ||
241 | pushfd |
241 | pushfd |
242 | cli |
242 | cli |
243 | 243 | ||
Line 244... | Line 244... | ||
244 | lea ebx, [edi+FUTEX.wait_list] |
244 | lea ebx, [ebp+FUTEX.wait_list] |
245 | mov esi, [ebx+LHEAD.next] |
245 | mov esi, [ebx+LHEAD.next] |
Line 246... | Line 246... | ||
246 | @@: |
246 | .wake: |
247 | cmp esi, ebx |
247 | cmp esi, ebx |
248 | je @F |
248 | je .done |
249 | 249 | ||
250 | mov eax, [esi+MUTEX_WAITER.task] |
250 | mov eax, [esi+MUTEX_WAITER.task] |
251 | mov [eax+TASKDATA.state], 0 |
251 | mov [eax+TASKDATA.state], 0 |
252 | 252 | ||
253 | mov esi, [esi+MUTEX_WAITER.list.next] |
253 | mov esi, [esi+MUTEX_WAITER.list.next] |
Line 254... | Line 254... | ||
254 | inc ecx |
254 | inc ecx |