Rev 5363 | Rev 5998 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5363 | Rev 5595 | ||
---|---|---|---|
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: 5363 $ |
8 | $Revision: 5595 $ |
9 | 9 | ||
Line 1424... | Line 1424... | ||
1424 | mov [eax+12], edx |
1424 | mov [eax+12], edx |
1425 | mov [eax+16], edx |
1425 | mov [eax+16], edx |
Line 1426... | Line 1426... | ||
1426 | 1426 | ||
1427 | call free ;release object memory |
1427 | call free ;release object memory |
- | 1428 | ret |
|
- | 1429 | ||
- | 1430 | ; param |
|
- | 1431 | ; ecx= size |
|
- | 1432 | ||
- | 1433 | align 4 |
|
- | 1434 | create_object: |
|
- | 1435 | ||
- | 1436 | push esi |
|
- | 1437 | push edi |
|
- | 1438 | pushfd |
|
- | 1439 | cli |
|
- | 1440 | ||
- | 1441 | mov esi, [current_process] |
|
- | 1442 | mov eax, [esi+PROC.ht_free] |
|
- | 1443 | mov edi, [esi+PROC.ht_next] |
|
- | 1444 | dec eax |
|
- | 1445 | js .err0 |
|
- | 1446 | ||
- | 1447 | mov [esi+PROC.ht_free], eax |
|
- | 1448 | mov eax, [esi+PROC.htab+edi*4] |
|
- | 1449 | mov [esi+PROC.ht_next], eax |
|
- | 1450 | popfd |
|
- | 1451 | ||
- | 1452 | mov eax, ecx |
|
- | 1453 | call malloc |
|
- | 1454 | test eax, eax |
|
- | 1455 | jz .err1 |
|
- | 1456 | ||
- | 1457 | mov [eax+FUTEX.handle], edi |
|
- | 1458 | mov [esi+PROC.htab+edi*4], eax |
|
- | 1459 | pop edi |
|
- | 1460 | pop esi |
|
- | 1461 | ret |
|
- | 1462 | ||
- | 1463 | .err1: |
|
- | 1464 | pushfd |
|
- | 1465 | cli |
|
- | 1466 | ||
- | 1467 | mov eax, [esi+PROC.ht_next] |
|
- | 1468 | mov [esi+PROC.htab+edi*4], eax |
|
- | 1469 | mov [esi+PROC.ht_next], edi |
|
- | 1470 | inc [esi+PROC.ht_free] |
|
- | 1471 | .err0: |
|
- | 1472 | popfd |
|
- | 1473 | pop edi |
|
- | 1474 | pop esi |
|
- | 1475 | xor eax, eax |
|
- | 1476 | ret |