win-pvdrivers

view liblfds.6/src/slist/slist_link.c @ 766:6300617040e0

Big changes - not ready for production use.
Removed all the custom DMA handling code as it was completely incompatible with the Windows verifier.
Added liblfds (using the lock free stack) from liblfds.org so that grant's can be obtained at DIRQL.
Fixed xennet and xenvbd to support the changes.
xenusb and xenscsi almost certainly will not yet work after the changes.
author James Harper <james.harper@bendigoit.com.au>
date Sun Jan 31 21:28:42 2010 +1100 (2010-01-31)
parents
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 }