-#include <linux/futex.h>
+#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
+#include <linux/futex.h>
/* hack for mips: */
#define CONFIG_RCU_HAVE_FUTEX 1
#include <urcu/futex.h>
-#include <linux/math64.h>
-#include <linux/printk.h>
#include <linux/rcupdate.h>
#include <linux/sched.h>
-#include <linux/slab.h>
#include <linux/timer.h>
__thread struct task_struct *current;
rcu_quiescent_state();
- while ((v = current->state) != TASK_RUNNING)
+ while ((v = READ_ONCE(current->state)) != TASK_RUNNING)
futex(¤t->state, FUTEX_WAIT|FUTEX_PRIVATE_FLAG,
v, NULL, NULL, 0);
}
* that will tell you if something is gone wrong and where.
*/
if (timeout < 0) {
- printk(KERN_ERR "schedule_timeout: wrong timeout "
+ fprintf(stderr, "schedule_timeout: wrong timeout "
"value %lx\n", timeout);
current->state = TASK_RUNNING;
goto out;
{
struct task_struct *p = malloc(sizeof(*p));
- mlockall(MCL_CURRENT|MCL_FUTURE);
-
memset(p, 0, sizeof(*p));
p->state = TASK_RUNNING;
rcu_register_thread();
}
-#ifndef __NR_getrandom
+#ifndef SYS_getrandom
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>