win-pvdrivers

diff liblfds.6/src/single_dir_for_windows_kernel/stack_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/stack_internal.h	Sun Jan 31 21:28:42 2010 +1100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/***** the library wide include file *****/
     1.5 +#include "liblfds_internal.h"
     1.6 +
     1.7 +/***** pragmas *****/
     1.8 +
     1.9 +/***** defines *****/
    1.10 +#define STACK_POINTER 0
    1.11 +#define STACK_COUNTER 1
    1.12 +#define STACK_PAC_SIZE 2
    1.13 +
    1.14 +/***** structures *****/
    1.15 +#pragma pack( push, ALIGN_DOUBLE_POINTER )
    1.16 +
    1.17 +struct stack_state
    1.18 +{
    1.19 +  // TRD : must come first for alignment
    1.20 +  struct stack_element
    1.21 +    *volatile top[STACK_PAC_SIZE];
    1.22 +
    1.23 +  atom_t
    1.24 +    aba_counter;
    1.25 +
    1.26 +  struct freelist_state
    1.27 +    *fs;
    1.28 +};
    1.29 +
    1.30 +struct stack_element
    1.31 +{
    1.32 +  struct stack_element
    1.33 +    *next[STACK_PAC_SIZE];
    1.34 +
    1.35 +  struct freelist_element
    1.36 +    *fe;
    1.37 +
    1.38 +  void
    1.39 +    *user_data;
    1.40 +};
    1.41 +
    1.42 +#pragma pack( pop )
    1.43 +
    1.44 +/***** private prototypes *****/
    1.45 +int stack_internal_freelist_init_function( void **user_data, void *user_state );
    1.46 +void stack_internal_freelist_delete_function( void *user_data, void *user_state );
    1.47 +
    1.48 +void stack_internal_new_element_from_freelist( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
    1.49 +void stack_internal_new_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
    1.50 +void stack_internal_init_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], struct freelist_element *fe, void *user_data );
    1.51 +
    1.52 +void stack_internal_push( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE] );
    1.53 +