Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2329 → Rev 2330

/branches/rcu/kernel/generic/include/synch/rcu.h
41,7 → 41,13
#include <arch.h>
#include <preemption.h>
 
typedef struct rcu_callback_list {
struct rcu_callback_list* next;
void (*func)(void*);
void* data;
} rcu_callback_list_t;
 
 
/** Read lock for RCU protected pointer */
#define rcu_read_lock() preemption_disable()
 
54,12 → 60,17
/** Assigning a value to an RCU protected pointer */
#define rcu_assign_pointer(p, newp) {write_barrier(); (p)=(newp);}
 
/** RCU sync callback for those who don't need custom allocation */
#define rcu_sync_callback(func, data) {\
rcu_callback_list_t* rd = malloc(sizeof(rcu_callback_list_t),0);\
rcu_sync_callback_custom_alloc(func, data, rd);}
 
void rcu_init(void);
void rcu_synchronize(void);
void rcu_synchronize_callback_function(void* waitq);
void rcu_sync_callback(void (*func)(void* data), void* data);
void rcu_sync_callback_custom_alloc(void (*func)(void* data), void* data, rcu_callback_list_t* rcu_struct);
void rcu_tasklet(void* data);
inline void rcu_passQS(void);
void rcu_passQS(void);
void rcu_run_callbacks(void);
 
#endif