Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2460 → Rev 2461

/branches/rcu/kernel/generic/include/time/timeout.h
38,6 → 38,8
#include <arch/types.h>
#if defined CONFIG_TIMEOUT_AVL_TREE
#include <adt/avl.h>
#elif defined CONFIG_TIMEOUT_FAVL_TREE
#include <adt/favl.h>
#elif defined CONFIG_TIMEOUT_EXTAVL_TREE
#include <adt/extavl.h>
#elif defined CONFIG_TIMEOUT_EXTAVLREL_TREE
50,69 → 52,31
typedef void (* timeout_handler_t)(void *arg);
 
 
#if defined CONFIG_TIMEOUT_AVL_TREE
 
typedef struct {
SPINLOCK_DECLARE(lock);
/**
* AVL tree node structure holds information
* about connections with other timeouts.
*/
 
#if defined CONFIG_TIMEOUT_AVL_TREE
/** Avl tree holding information about connections with other timeouts.
* Experimental use only. */
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_FAVL_TREE
/** Fast Avl tree holding information about connections with other timeouts.
* Use this structure instead of Avl tree. */
favltree_node_t node;
#elif defined CONFIG_TIMEOUT_EXTAVL_TREE
 
typedef struct {
SPINLOCK_DECLARE(lock);
/**
* Extended AVL tree node structure holds information
* about connections with other timeouts.
*/
/** Extended Avl tree holding information about connections with other timeouts. */
extavltree_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_EXTAVLREL_TREE
 
typedef struct {
SPINLOCK_DECLARE(lock);
/**
* Extended AVL tree with relative keys node structure holds information
* about connections with other timeouts.
*/
/** Extended Avl tree with relative keys holding 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 {
SPINLOCK_DECLARE(lock);
 
/** Link to the list of active timeouts on THE->cpu */
link_t link;
/** Timeout will be activated in this amount of clock() ticks. */
uint64_t ticks;
#endif
 
/** Function that will be called on timeout activation. */
timeout_handler_t handler;
/** Argument to be passed to handler() function. */
121,8 → 85,6
cpu_t *cpu;
} timeout_t;
 
#endif
 
#define us2ticks(us) ((uint64_t) (((uint32_t) (us) / (1000000 / HZ))))
 
extern void timeout_init(void);
/branches/rcu/kernel/generic/include/cpu.h
41,7 → 41,9
#include <arch/cpu.h>
#include <arch/context.h>
#if defined CONFIG_TIMEOUT_AVL_TREE
#include <adt/avl.h>
#include <adt/avl.h>
#elif defined CONFIG_TIMEOUT_FAVL_TREE
#include <adt/favl.h>
#elif defined CONFIG_TIMEOUT_EXTAVL_TREE
#include <adt/extavl.h>
#elif defined CONFIG_TIMEOUT_EXTAVLREL_TREE
70,6 → 72,9
#if defined CONFIG_TIMEOUT_AVL_TREE
/** AVL tree structure. */
avltree_t timeout_active_tree;
#elif defined CONFIG_TIMEOUT_FAVL_TREE
/** Fast AVL tree structure. */
favltree_t timeout_active_tree;
#elif defined CONFIG_TIMEOUT_EXTAVL_TREE
/** Extended AVL tree structure. */
extavltree_t timeout_active_tree;
/branches/rcu/kernel/generic/include/adt/avl.h
1,5 → 1,5
/*
* Copyright (C) 2006 Vojtech Mencl
* Copyright (C) 2007 Vojtech Mencl
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
87,7 → 87,8
struct avltree_node *root;
 
/**
* Base of tree is value that is smaller or equal then every value in tree.
* Base of tree is value that is smaller or equal then every value in tree
* (valid for positive keys otherwise ignore this atribute).
*
* Base is added to current key when new node is inserted into tree.
* Base is changed to the key of node which is deleted with function
/branches/rcu/kernel/generic/include/adt/extavl.h
98,7 → 98,8
extavltree_node_t head;
 
/**
* Base of tree is value that is smaller or equal then every value in tree.
* Base of tree is value that is smaller or equal then every value in tree
* (valid for positive keys otherwise ignore this atribute).
*
* Base is added to current key when new node is inserted into tree.
* Base is changed to the key of node which is deleted with function