Changeset 636 for trunk/kernel/libk
- Timestamp:
- Jul 1, 2019, 9:34:16 AM (5 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/list.h
r635 r636 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016,2017,2018 i,2019)5 * Alain Greiner (2016,2017,2018,2019) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites … … 314 314 * item(s) from the traversed list. 315 315 *************************************************************************** 316 * @ cxy : remote cluster identifier 317 * @ root : pointer on the root list_entry 318 * @ iter : pointer on the current list_entry 319 **************************************************************************/ 320 321 #define LIST_REMOTE_FOREACH( cxy , root , iter ) \322 for( (iter) = hal_remote_lpt( XPTR( cxy, &(root)->next ) ) ; \323 (iter) != (root) ; \324 (iter) = hal_remote_lpt( XPTR( cxy, &(iter)->next ) ) )316 * @ cxy : remote cluster identifier. 317 * @ root : pointer on the root list_entry. 318 * @ iter : pointer on the current list_entry. 319 **************************************************************************/ 320 321 #define LIST_REMOTE_FOREACH( cxy , root , iter ) \ 322 for( (iter) = hal_remote_lpt( XPTR( (cxy) , &(root)->next ) ) ; \ 323 (iter) != (root) ; \ 324 (iter) = hal_remote_lpt( XPTR( (cxy) , &(iter)->next ) ) ) 325 325 326 /*************************************************************************** 327 * This macro can be used by a thread running in any cluster to access 328 * a remote local list. It traverse the list in backward order. 329 * WARNING : same as the forward traversal 330 *************************************************************************** 331 * @ cxy : remote cluster identifier. 332 * @ root : pointer on the root list_entry. 333 * @ iter : pointer on the current list_entry. 334 **************************************************************************/ 335 336 #define LIST_REMOTE_FOREACH_BACKWARD( cxy , root , iter ) \ 337 for( (iter) = hal_remote_lpt( XPTR( (cxy) , &(root)->pred ) ) ; \ 338 (iter) != (root) ; \ 339 (iter) = hal_remote_lpt( XPTR( (cxy) , &(iter)->pred ) ) ) 340 326 341 /*************************************************************************** 327 342 * This function can be called by a thread running in any cluster to access … … 350 365 list_entry_t * entry ) 351 366 { 352 list_entry_t * first; // local pointer on current first entry 353 list_entry_t * next; // local pointer on current first->next entry 354 355 first = hal_remote_lpt( XPTR( cxy , &root->next ) ); 356 next = hal_remote_lpt( XPTR( cxy , &first->next ) ); 367 list_entry_t * next = hal_remote_lpt( XPTR( cxy , &root->next ) ); 357 368 358 hal_remote_spt( XPTR( cxy , &entry->next ) , first );369 hal_remote_spt( XPTR( cxy , &entry->next ) , next ); 359 370 hal_remote_spt( XPTR( cxy , &entry->pred ) , root ); 360 371 … … 375 386 list_entry_t * entry ) 376 387 { 377 list_entry_t * last; // local pointer on current last entry 378 list_entry_t * pred; // local pointer on current last->pred entry 379 380 last = hal_remote_lpt( XPTR( cxy , &root->pred ) ); 381 pred = hal_remote_lpt( XPTR( cxy , &last->pred ) ); 388 list_entry_t * pred = hal_remote_lpt( XPTR( cxy , &root->pred ) ); 382 389 383 390 hal_remote_spt( XPTR( cxy , &entry->next ) , root ); … … 409 416 410 417 411 412 418 #endif /* _LIST_H_ */ -
trunk/kernel/libk/xlist.h
r610 r636 1 1 /* 2 // check calling thread can yield3 thread_assert_can_yield( this , __FUNCTION__ );4 5 2 * xlist.h - Double Circular Linked lists, using extended pointers. 6 3 * 7 * Author : Alain Greiner (2016,2017,2018 )4 * Author : Alain Greiner (2016,2017,2018,2019) 8 5 * 9 6 * Copyright (c) UPMC Sorbonne Universites
Note: See TracChangeset
for help on using the changeset viewer.