Rev 5565 | Rev 5585 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5565 | Rev 5577 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. 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: 5565 $ |
8 | $Revision: 5577 $ |
9 | 9 | ||
Line 1338... | Line 1338... | ||
1338 | mov [eax+12], edx |
1338 | mov [eax+12], edx |
1339 | mov [eax+16], edx |
1339 | mov [eax+16], edx |
Line 1340... | Line 1340... | ||
1340 | 1340 | ||
1341 | call free ;release object memory |
1341 | call free ;release object memory |
- | 1342 | ret |
|
- | 1343 | ||
- | 1344 | ||
- | 1345 | ||
- | 1346 | ; param |
|
- | 1347 | ; eñõ= size |
|
- | 1348 | ||
- | 1349 | align 4 |
|
- | 1350 | create_object: |
|
- | 1351 | ||
- | 1352 | push esi |
|
- | 1353 | push edi |
|
- | 1354 | pushfd |
|
- | 1355 | cli |
|
- | 1356 | ||
- | 1357 | mov esi, [current_process] |
|
- | 1358 | mov eax, [esi+PROC.ht_free] |
|
- | 1359 | mov edi, [esi+PROC.ht_next] |
|
- | 1360 | dec eax |
|
- | 1361 | js .err0 |
|
- | 1362 | ||
- | 1363 | mov [esi+PROC.ht_free], eax |
|
- | 1364 | mov eax, [esi+PROC.htab+edi*4] |
|
- | 1365 | mov [esi+PROC.ht_next], eax |
|
- | 1366 | popfd |
|
- | 1367 | ||
- | 1368 | mov eax, ecx |
|
- | 1369 | call malloc |
|
- | 1370 | test eax, eax |
|
- | 1371 | jz .err1 |
|
- | 1372 | ||
- | 1373 | mov [eax+FUTEX.handle], edi |
|
- | 1374 | mov [esi+PROC.htab+edi*4], eax |
|
- | 1375 | pop edi |
|
- | 1376 | pop esi |
|
- | 1377 | ret |
|
- | 1378 | ||
- | 1379 | .err1: |
|
- | 1380 | pushfd |
|
- | 1381 | cli |
|
- | 1382 | ||
- | 1383 | mov eax, [esi+PROC.ht_next] |
|
- | 1384 | mov [esi+PROC.htab+edi*4], eax |
|
- | 1385 | mov [esi+PROC.ht_next], edi |
|
- | 1386 | inc [esi+PROC.ht_free] |
|
- | 1387 | .err0: |
|
- | 1388 | popfd |
|
- | 1389 | pop edi |
|
- | 1390 | pop esi |
|
- | 1391 | xor eax, eax |
|
- | 1392 | ret |
|
- | 1393 | ||
- | 1394 | ||
- | 1395 | align 4 |
|
- | 1396 | create_futex: |
|
- | 1397 | mov ecx, sizeof.FUTEX |
|
- | 1398 | call create_object |
|
- | 1399 | test eax, eax |
|
- | 1400 | jz .fail |
|
- | 1401 | ||
- | 1402 | mov [eax+FUTEX.magic], 'FUTX' |
|
- | 1403 | mov [eax+FUTEX.destroy], 0 |
|
- | 1404 | lea ecx, [eax+FUTEX.wait_list] |
|
- | 1405 | list_init ecx |
|
- | 1406 | mov [eax+FUTEX.pointer], 0 |
|
- | 1407 | mov [eax+FUTEX.flags], 0 |
|
- | 1408 | ||
- | 1409 | .fail: |
|
- | 1410 | ret |