Changeset 656 for trunk/kernel/libk/list.h
- Timestamp:
- Dec 6, 2019, 12:07:51 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/list.h
r651 r656 1 1 /* 2 * list.h - Double circular linked list2 * list.h - Local double circular linked list, using local pointers. 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) … … 91 91 92 92 /*************************************************************************** 93 * This macro returns tpointer on the first element of a list.93 * This macro returns a pointer on the first element of a list. 94 94 *************************************************************************** 95 95 * @ root : pointer on the list root … … 171 171 list_entry_t * entry ) 172 172 { 173 list_entry_t * next = root->next;174 175 entry->next = next;173 list_entry_t * first = root->next; 174 175 entry->next = first; 176 176 entry->pred = root; 177 177 178 root->next = entry;179 next->pred = entry;178 root->next = entry; 179 first->pred = entry; 180 180 } 181 181 … … 190 190 list_entry_t * entry ) 191 191 { 192 list_entry_t * pred= root->pred;192 list_entry_t * last = root->pred; 193 193 194 194 entry->next = root; 195 entry->pred = pred;195 entry->pred = last; 196 196 197 197 root->pred = entry; 198 pred->next = entry;198 last->next = entry; 199 199 } 200 200 … … 366 366 list_entry_t * entry ) 367 367 { 368 list_entry_t * next = hal_remote_lpt( XPTR( cxy , &root->next ) );368 list_entry_t * first = hal_remote_lpt( XPTR( cxy , &root->next ) ); 369 369 370 hal_remote_spt( XPTR( cxy , &entry->next ) , next );370 hal_remote_spt( XPTR( cxy , &entry->next ) , first ); 371 371 hal_remote_spt( XPTR( cxy , &entry->pred ) , root ); 372 372 373 hal_remote_spt( XPTR( cxy , &root->next ) , entry );374 hal_remote_spt( XPTR( cxy , & next->pred ) , entry );373 hal_remote_spt( XPTR( cxy , &root->next ) , entry ); 374 hal_remote_spt( XPTR( cxy , &first->pred ) , entry ); 375 375 } 376 376 … … 387 387 list_entry_t * entry ) 388 388 { 389 list_entry_t * pred= hal_remote_lpt( XPTR( cxy , &root->pred ) );389 list_entry_t * last = hal_remote_lpt( XPTR( cxy , &root->pred ) ); 390 390 391 391 hal_remote_spt( XPTR( cxy , &entry->next ) , root ); 392 hal_remote_spt( XPTR( cxy , &entry->pred ) , pred);392 hal_remote_spt( XPTR( cxy , &entry->pred ) , last ); 393 393 394 394 hal_remote_spt( XPTR( cxy , &root->pred ) , entry ); 395 hal_remote_spt( XPTR( cxy , & pred->next ) , entry );395 hal_remote_spt( XPTR( cxy , &last->next ) , entry ); 396 396 } 397 397 … … 401 401 *************************************************************************** 402 402 * @ cxy : remote list cluster identifier 403 * @ entry : pointer on the entry to be removed.403 * @ entry : local pointer on the remote entry to be removed. 404 404 **************************************************************************/ 405 405 static inline void list_remote_unlink( cxy_t cxy,
Note: See TracChangeset
for help on using the changeset viewer.