win-pvdrivers

view liblfds.6/src/queue/queue_delete.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 "queue_internal.h"
7 /****************************************************************************/
8 void queue_delete( struct queue_state *qs, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state )
9 {
10 void
11 *user_data;
13 assert( qs != NULL );
14 // TRD : user_data_delete_function can be NULL
15 // TRD : user_state can be NULL
17 while( queue_dequeue(qs, &user_data) )
18 if( user_data_delete_function != NULL )
19 user_data_delete_function( user_data, user_state );
21 /* TRD : fully dequeuing will leave us
22 with a single dummy element
23 which both qs->enqueue and qs->dequeue point at
24 we push this back onto the freelist
25 before we delete the freelist
26 */
28 freelist_push( qs->fs, qs->enqueue[QUEUE_POINTER]->fe );
30 freelist_delete( qs->fs, queue_internal_freelist_delete_function, NULL );
32 abstraction_aligned_free( qs );
34 return;
35 }
41 /****************************************************************************/
42 #pragma warning( disable : 4100 )
44 void queue_internal_freelist_delete_function( void *user_data, void *user_state )
45 {
46 assert( user_data != NULL );
47 assert( user_state == NULL );
49 abstraction_aligned_free( user_data );
51 return;
52 }
54 #pragma warning( default : 4100 )