36,20 → 36,44 |
#define KERN_TIMEOUT_H_ |
|
#include <arch/types.h> |
#ifdef CONFIG_TIMEOUT_EXTAVL_TREE |
#if defined CONFIG_TIMEOUT_AVL_TREE |
#include <adt/avl.h> |
#elif defined CONFIG_TIMEOUT_EXTAVL_TREE |
#include <adt/extavl.h> |
#elif defined CONFIG_TIMEOUT_EXTAVLREL_TREE |
#include <adt/extavlrel.h> |
#else |
#include <adt/list.h> |
#endif |
#include <adt/list.h> |
#include <cpu.h> |
|
typedef void (* timeout_handler_t)(void *arg); |
|
#ifdef CONFIG_TIMEOUT_EXTAVL_TREE |
|
#if defined CONFIG_TIMEOUT_AVL_TREE |
|
typedef struct { |
SPINLOCK_DECLARE(lock); |
|
/** |
* AVL tree node structure holds information |
* about connections with other timeouts. |
*/ |
avltree_node_t node; |
/** Function that will be called on timeout activation. */ |
timeout_handler_t handler; |
/** Argument to be passed to handler() function. */ |
void *arg; |
/** On which processor is this timeout registered. */ |
cpu_t *cpu; |
} timeout_t; |
|
#elif defined CONFIG_TIMEOUT_EXTAVL_TREE |
|
typedef struct { |
SPINLOCK_DECLARE(lock); |
|
/** |
* Extended AVL tree node structure holds information |
* about connections with other timeouts. |
*/ |
62,6 → 86,24 |
cpu_t *cpu; |
} timeout_t; |
|
#elif defined CONFIG_TIMEOUT_EXTAVLREL_TREE |
|
typedef struct { |
SPINLOCK_DECLARE(lock); |
|
/** |
* Extended AVL tree with relative keys node structure holds information |
* about connections with other timeouts. |
*/ |
extavlreltree_node_t node; |
/** Function that will be called on timeout activation. */ |
timeout_handler_t handler; |
/** Argument to be passed to handler() function. */ |
void *arg; |
/** On which processor is this timeout registered. */ |
cpu_t *cpu; |
} timeout_t; |
|
#else |
|
typedef struct { |