win-pvdrivers

diff liblfds.6/src/single_dir_for_windows_kernel/slist_internal.h @ 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/liblfds.6/src/single_dir_for_windows_kernel/slist_internal.h	Sun Jan 31 21:28:42 2010 +1100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/***** the library wide include file *****/
     1.5 +#include "liblfds_internal.h"
     1.6 +
     1.7 +/***** defines *****/
     1.8 +#define SLIST_USER_DATA  0
     1.9 +#define SLIST_FLAGS      1
    1.10 +
    1.11 +#define SLIST_NO_FLAGS      0x0
    1.12 +#define SLIST_FLAG_DELETED  0x1
    1.13 +
    1.14 +/***** structures *****/
    1.15 +#pragma pack( push, ALIGN_SINGLE_POINTER )
    1.16 +
    1.17 +struct slist_state
    1.18 +{
    1.19 +  struct slist_element
    1.20 +    *volatile head;
    1.21 +
    1.22 +  void
    1.23 +    (*user_data_delete_function)( void *user_data, void *user_state ),
    1.24 +    *user_state;
    1.25 +};
    1.26 +
    1.27 +#pragma pack( pop )
    1.28 +
    1.29 +#pragma pack( push, ALIGN_DOUBLE_POINTER )
    1.30 +
    1.31 +/* TRD : this pragma pack doesn't seem to work under Windows
    1.32 +         if the structure members are the correct way round
    1.33 +         (next first), then user_data_and_flags ends up on
    1.34 +         a single pointer boundary and DCAS crashes
    1.35 +
    1.36 +         accordingly, I've moved user_data_and_flags first
    1.37 +*/
    1.38 +
    1.39 +struct slist_element
    1.40 +{
    1.41 +  void
    1.42 +    *volatile user_data_and_flags[2];
    1.43 +
    1.44 +  // TRD : requires volatile as is target of CAS
    1.45 +  struct slist_element
    1.46 +    *volatile next;
    1.47 +};
    1.48 +
    1.49 +#pragma pack( pop )
    1.50 +
    1.51 +/***** private prototypes *****/
    1.52 +void slist_internal_init_slist( struct slist_state *ss, void (*user_data_delete_function)(void *user_data, void *user_state), void *user_state );
    1.53 +
    1.54 +void slist_internal_link_element_to_head( struct slist_state *slist_state, struct slist_element *volatile se );
    1.55 +void slist_internal_link_element_after_element( struct slist_element *volatile slist_in_list_element, struct slist_element *volatile se );
    1.56 +
    1.57 +void slist_internal_move_to_first_undeleted_element( struct slist_element **se );
    1.58 +