Subversion Repositories HelenOS

Rev

Rev 2330 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2330 Rev 2400
Line 99... Line 99...
99
void rcu_synchronize(void)
99
void rcu_synchronize(void)
100
{
100
{
101
#ifdef CONFIG_SMP
101
#ifdef CONFIG_SMP
102
    waitq_t wq;
102
    waitq_t wq;
103
    waitq_initialize(&wq);
103
    waitq_initialize(&wq);
104
    rcu_sync_callback(&rcu_synchronize_callback_function, &wq);
104
    rcu_sync_callback_normal_alloc(&rcu_synchronize_callback_function, &wq);
105
    //sleep until the end of the grace period
105
    //sleep until the end of the grace period
106
    waitq_sleep(&wq);
106
    waitq_sleep(&wq);
107
#endif
107
#endif
108
}
108
}
109
 
109
 
Line 121... Line 121...
121
/**
121
/**
122
* appends this callback func to the queue of waiting callbacks, the rest
122
* appends this callback func to the queue of waiting callbacks, the rest
123
* is handled in rcu_run_callbacks and in the tasklet. This is a lock free variant,
123
* is handled in rcu_run_callbacks and in the tasklet. This is a lock free variant,
124
* which must be supplied with a preallocated rcu_callback_list_t structure
124
* which must be supplied with a preallocated rcu_callback_list_t structure
125
*/
125
*/
126
void rcu_sync_callback_custom_alloc(void (*func)(void* data), void* data, rcu_callback_list_t* rd)
126
void rcu_sync_callback(void (*func)(void* data), void* data, rcu_callback_list_t* rd)
127
{
127
{
128
#ifndef CONFIG_SMP
128
#ifndef CONFIG_SMP
129
    func(data);
129
    func(data);
130
#else
130
#else
131
 
131
 
Line 238... Line 238...
238
    else
238
    else
239
        interrupts_restore(ipl);
239
        interrupts_restore(ipl);
240
}
240
}
241
 
241
 
242
 
242
 
-
 
243
/**
-
 
244
* Generic callback for RCU, frees @paramref pointer
-
 
245
* @param pointer
-
 
246
*/
-
 
247
void rcu_callback_free(void* pointer)
-
 
248
{
-
 
249
    free(pointer);
-
 
250
}
-
 
251