win-pvdrivers

view liblfds.6/src/single_dir_for_windows_kernel/slist_link.c @ 1025:aa2e51f67f7c

Fix hibernate under Win8. Change debugprints.
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 15:14:53 2013 +1100 (2013-02-19)
parents 6300617040e0
children
line source
1 #include "slist_internal.h"
7 /****************************************************************************/
8 void slist_internal_link_element_to_head( struct slist_state *ss, struct slist_element *volatile se )
9 {
10 ALIGN(ALIGN_SINGLE_POINTER) struct slist_element
11 *se_next;
13 assert( ss != NULL );
14 assert( se != NULL );
16 se_next = ss->head;
18 do
19 {
20 se->next = se_next;
21 }
22 while( se->next != (se_next = (struct slist_element *) abstraction_cas((volatile atom_t *) &ss->head, (atom_t) se, (atom_t) se->next)) );
24 return;
25 }
31 /****************************************************************************/
32 void slist_internal_link_element_after_element( struct slist_element *volatile slist_in_list_element, struct slist_element *volatile se )
33 {
34 ALIGN(ALIGN_SINGLE_POINTER) struct slist_element
35 *se_prev,
36 *se_next;
38 assert( slist_in_list_element != NULL );
39 assert( se != NULL );
41 se_prev = (struct slist_element *) slist_in_list_element;
43 se_next = se_prev->next;
45 do
46 {
47 se->next = se_next;
48 }
49 while( se->next != (se_next = (struct slist_element *) abstraction_cas((volatile atom_t *) &se_prev->next, (atom_t) se, (atom_t) se->next)) );
51 return;
52 }