Improved code style. Changed linkedlist_delete to linkedlist_unlink to make linkedlist.inc universal

git-svn-id: svn://kolibrios.org@5085 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
gtament 2014-09-02 20:15:13 +00:00
parent 10723a5892
commit 3d808905f1

View File

@ -15,12 +15,13 @@ linkedlist_add:
pop ebx
ret
linkedlist_delete:
linkedlist_unlink:
push ebx ecx
mov ebx, eax ; eax - pointer to node for delete
test eax, eax
jz .invalid_pointer
mov ebx, eax ; eax - pointer to node for unlink
cmp eax, [head]
jz .unlink_head
.getnext:
cmp [ebx+node.next], eax
jz .unlink
@ -28,18 +29,14 @@ linkedlist_delete:
jz .invalid_pointer
mov ebx, [ebx+node.next]
jmp .getnext
.unlink:
mov ecx, [eax+node.next]
mov [ebx+node.next], ecx
jmp @f
.unlink_head:
mov ebx, [eax+node.next]
mov [head], ebx
@@:
mov ecx, eax
call Kfree
.invalid_pointer:
pop ecx ebx
ret