X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=Documentation%2Fatomic_ops.txt;h=ac4d47187122f93fc860db817a9d8970bbc80002;hb=e17ab5cbed795d3823da830f5e8d3ffe25a38446;hp=4ef245010457fc9301f21f6e78f2b1fc16c1d014;hpb=02c608c1fefe821a4c6fc34c45a0dea3cebf4764;p=safe%2Fjmp%2Flinux-2.6 diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index 4ef2450..ac4d471 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -229,10 +229,10 @@ kernel. It is the use of atomic counters to implement reference counting, and it works such that once the counter falls to zero it can be guaranteed that no other entity can be accessing the object: -static void obj_list_add(struct obj *obj) +static void obj_list_add(struct obj *obj, struct list_head *head) { obj->active = 1; - list_add(&obj->list); + list_add(&obj->list, head); } static void obj_list_del(struct obj *obj) @@ -320,7 +320,7 @@ counter decrement would not become globally visible until the obj->active update does. As a historical note, 32-bit Sparc used to only allow usage of -24-bits of it's atomic_t type. This was because it used 8 bits +24-bits of its atomic_t type. This was because it used 8 bits as a spinlock for SMP safety. Sparc32 lacked a "compare and swap" type instruction. However, 32-bit Sparc has since been moved over to a "hash table of spinlocks" scheme, that allows the full 32-bit