Rev 2336 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2336 | Rev 2416 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | 34 | ||
| 35 | #ifndef KERN_TIMEOUT_H_ |
35 | #ifndef KERN_TIMEOUT_H_ |
| 36 | #define KERN_TIMEOUT_H_ |
36 | #define KERN_TIMEOUT_H_ |
| 37 | 37 | ||
| 38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
| - | 39 | #if defined CONFIG_TIMEOUT_AVL_TREE |
|
| - | 40 | #include <adt/avl.h> |
|
| 39 | #ifdef CONFIG_TIMEOUT_EXTAVL_TREE |
41 | #elif defined CONFIG_TIMEOUT_EXTAVL_TREE |
| 40 | #include <adt/extavl.h> |
42 | #include <adt/extavl.h> |
| - | 43 | #elif defined CONFIG_TIMEOUT_EXTAVLREL_TREE |
|
| - | 44 | #include <adt/extavlrel.h> |
|
| 41 | #endif |
45 | #else |
| 42 | #include <adt/list.h> |
46 | #include <adt/list.h> |
| - | 47 | #endif |
|
| 43 | #include <cpu.h> |
48 | #include <cpu.h> |
| 44 | 49 | ||
| 45 | typedef void (* timeout_handler_t)(void *arg); |
50 | typedef void (* timeout_handler_t)(void *arg); |
| 46 | 51 | ||
| - | 52 | ||
| - | 53 | #if defined CONFIG_TIMEOUT_AVL_TREE |
|
| - | 54 | ||
| - | 55 | typedef struct { |
|
| - | 56 | SPINLOCK_DECLARE(lock); |
|
| - | 57 | ||
| - | 58 | /** |
|
| - | 59 | * AVL tree node structure holds information |
|
| - | 60 | * about connections with other timeouts. |
|
| - | 61 | */ |
|
| - | 62 | avltree_node_t node; |
|
| - | 63 | /** Function that will be called on timeout activation. */ |
|
| - | 64 | timeout_handler_t handler; |
|
| - | 65 | /** Argument to be passed to handler() function. */ |
|
| - | 66 | void *arg; |
|
| - | 67 | /** On which processor is this timeout registered. */ |
|
| - | 68 | cpu_t *cpu; |
|
| - | 69 | } timeout_t; |
|
| - | 70 | ||
| 47 | #ifdef CONFIG_TIMEOUT_EXTAVL_TREE |
71 | #elif defined CONFIG_TIMEOUT_EXTAVL_TREE |
| 48 | 72 | ||
| 49 | typedef struct { |
73 | typedef struct { |
| 50 | SPINLOCK_DECLARE(lock); |
74 | SPINLOCK_DECLARE(lock); |
| 51 | 75 | ||
| 52 | /** |
76 | /** |
| Line 57... | Line 81... | ||
| 57 | /** Function that will be called on timeout activation. */ |
81 | /** Function that will be called on timeout activation. */ |
| 58 | timeout_handler_t handler; |
82 | timeout_handler_t handler; |
| 59 | /** Argument to be passed to handler() function. */ |
83 | /** Argument to be passed to handler() function. */ |
| 60 | void *arg; |
84 | void *arg; |
| 61 | /** On which processor is this timeout registered. */ |
85 | /** On which processor is this timeout registered. */ |
| - | 86 | cpu_t *cpu; |
|
| - | 87 | } timeout_t; |
|
| - | 88 | ||
| - | 89 | #elif defined CONFIG_TIMEOUT_EXTAVLREL_TREE |
|
| - | 90 | ||
| - | 91 | typedef struct { |
|
| - | 92 | SPINLOCK_DECLARE(lock); |
|
| - | 93 | ||
| - | 94 | /** |
|
| - | 95 | * Extended AVL tree with relative keys node structure holds information |
|
| - | 96 | * about connections with other timeouts. |
|
| - | 97 | */ |
|
| - | 98 | extavlreltree_node_t node; |
|
| - | 99 | /** Function that will be called on timeout activation. */ |
|
| - | 100 | timeout_handler_t handler; |
|
| - | 101 | /** Argument to be passed to handler() function. */ |
|
| - | 102 | void *arg; |
|
| - | 103 | /** On which processor is this timeout registered. */ |
|
| 62 | cpu_t *cpu; |
104 | cpu_t *cpu; |
| 63 | } timeout_t; |
105 | } timeout_t; |
| 64 | 106 | ||
| 65 | #else |
107 | #else |
| 66 | 108 | ||