win-pvdrivers

view liblfds.6/test/src/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 /***** ANSI includes *****/
2 #include <assert.h>
3 #include <math.h>
4 #include <stdio.h>
5 #include <stdarg.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <time.h>
10 /***** internal includes *****/
11 #include "abstraction.h"
13 /***** external includes *****/
14 #include "liblfds.h"
16 /***** defines *****/
17 #define and &&
18 #define or ||
20 #define RAISED 1
21 #define LOWERED 0
23 #define NO_FLAGS 0x0
25 /***** enums *****/
26 enum test_operation
27 {
28 UNKNOWN,
29 HELP,
30 TEST,
31 BENCHMARK
32 };
34 /***** structs *****/
35 #include "structures.h"
37 /***** prototypes *****/
38 int main( int argc, char **argv );
40 void internal_display_test_name( char *test_name );
41 void internal_display_test_result( unsigned int number_name_dvs_pairs, ... );
42 void internal_display_data_structure_validity( enum data_structure_validity dvs );
44 void benchmark_freelist( void );
45 thread_return_t CALLING_CONVENTION benchmark_freelist_thread_pop_and_push( void *freelist_benchmark );
47 void benchmark_queue( void );
48 thread_return_t CALLING_CONVENTION benchmark_queue_thread_dequeue_and_enqueue( void *queue_benchmark );
50 void benchmark_ringbuffer( void );
51 thread_return_t CALLING_CONVENTION benchmark_ringbuffer_thread_write_and_read( void *ringbuffer_benchmark );
53 void benchmark_stack( void );
54 thread_return_t CALLING_CONVENTION benchmark_stack_thread_push_and_pop( void *stack_benchmark );
56 void test_abstraction( void );
57 void abstraction_test_increment( void );
58 thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_increment( void *shared_counter );
59 thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_atomic_increment( void *shared_counter );
60 void abstraction_test_dcas( void );
61 thread_return_t CALLING_CONVENTION abstraction_test_internal_thread_dcas( void *abstraction_test_dcas_state );
63 void test_freelist( void );
64 void freelist_test_internal_popping( void );
65 int freelist_test_internal_popping_init( void **user_data, void *user_state );
66 thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping( void *freelist_test_popping_state );
67 void freelist_test_internal_pushing( void );
68 int freelist_test_internal_pushing_init( void **user_data, void *user_state );
69 void freelist_test_internal_pushing_delete( void *user_data, void *user_state );
70 thread_return_t CALLING_CONVENTION freelist_test_internal_thread_pushing( void *freelist_test_pushing_state );
71 void freelist_test_internal_popping_and_pushing( void );
72 thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping_and_pushing_start_popping( void *freelist_test_popping_and_pushing_state );
73 thread_return_t CALLING_CONVENTION freelist_test_internal_thread_popping_and_pushing_start_pushing( void *freelist_test_popping_and_pushing_state );
74 void freelist_test_internal_rapid_popping_and_pushing( void );
75 thread_return_t CALLING_CONVENTION freelist_test_internal_thread_rapid_popping_and_pushing( void *freelist_state );
77 void test_queue( void );
78 void queue_test_enqueuing( void );
79 thread_return_t CALLING_CONVENTION queue_test_internal_thread_simple_enqueuer( void *queue_test_enqueuing_state );
80 void queue_test_dequeuing( void );
81 thread_return_t CALLING_CONVENTION queue_test_internal_thread_simple_dequeuer( void *queue_test_dequeuing_state );
82 void queue_test_enqueuing_and_dequeuing( void );
83 thread_return_t CALLING_CONVENTION queue_test_internal_thread_enqueuer_and_dequeuer( void *queue_test_rapid_enqueuing_and_dequeuing_state );
84 void queue_test_rapid_enqueuing_and_dequeuing( void );
85 thread_return_t CALLING_CONVENTION queue_test_internal_thread_rapid_enqueuer_and_dequeuer( void *queue_test_rapid_enqueuing_and_dequeuing_state );
87 void test_ringbuffer( void );
88 void ringbuffer_test_reading( void );
89 thread_return_t CALLING_CONVENTION ringbuffer_test_thread_simple_reader( void *ringbuffer_test_reading_state );
90 void ringbuffer_test_writing( void );
91 thread_return_t CALLING_CONVENTION ringbuffer_test_thread_simple_writer( void *ringbuffer_test_writing_state );
92 void ringbuffer_test_reading_and_writing( void );
93 thread_return_t CALLING_CONVENTION ringbuffer_test_thread_reader_writer( void *ringbuffer_test_reading_and_writing_state );
95 void test_slist( void );
96 thread_return_t CALLING_CONVENTION slist_internal_thread_head_writer( void *slist_thread_start_state );
97 thread_return_t CALLING_CONVENTION slist_internal_thread_after_writer( void *slist_thread_start_state );
98 thread_return_t CALLING_CONVENTION slist_internal_thread_traverser( void *slist_thread_start_state );
99 thread_return_t CALLING_CONVENTION slist_internal_thread_deleter_traverser( void *slist_thread_start_state );
101 void test_stack( void );
102 thread_return_t CALLING_CONVENTION stack_internal_thread_reader( void *stack_state );
103 thread_return_t CALLING_CONVENTION stack_internal_thread_writer( void *stack_state );