win-pvdrivers

view 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 source
1 /***** the library wide include file *****/
2 #include "liblfds_internal.h"
4 /***** pragmas *****/
6 /***** defines *****/
7 #define STACK_POINTER 0
8 #define STACK_COUNTER 1
9 #define STACK_PAC_SIZE 2
11 /***** structures *****/
12 #pragma pack( push, ALIGN_DOUBLE_POINTER )
14 struct stack_state
15 {
16 // TRD : must come first for alignment
17 struct stack_element
18 *volatile top[STACK_PAC_SIZE];
20 atom_t
21 aba_counter;
23 struct freelist_state
24 *fs;
25 };
27 struct stack_element
28 {
29 struct stack_element
30 *next[STACK_PAC_SIZE];
32 struct freelist_element
33 *fe;
35 void
36 *user_data;
37 };
39 #pragma pack( pop )
41 /***** private prototypes *****/
42 int stack_internal_freelist_init_function( void **user_data, void *user_state );
43 void stack_internal_freelist_delete_function( void *user_data, void *user_state );
45 void stack_internal_new_element_from_freelist( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
46 void stack_internal_new_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
47 void stack_internal_init_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], struct freelist_element *fe, void *user_data );
49 void stack_internal_push( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE] );