+ uint32_t *kernel_addr);
+
+extern int copyin_atomic64(
+ const user_addr_t user_addr,
+ uint64_t *kernel_addr);
+
+/*
+ * Does an atomic copyin at the specified user_address and compares
+ * it to the passed in value, and if it matches, waits.
+ *
+ * This is used to implement adaptive spinning for userspace synchronization
+ *
+ * Returns:
+ * 0: the value mached, and it paused efficiently for the platform
+ * ESTALE: the value didn't match, and it returned immediately
+ * other: the copyin failed (EFAULT, EINVAL, ...)
+ */
+extern int copyin_atomic32_wait_if_equals(
+ const user_addr_t user_addr,
+ uint32_t value);
+
+/*
+ * Move a 32 or 64-bit word from kernel space to user space
+ * using a single write instruction
+ */
+extern int copyout_atomic32(
+ uint32_t u32,
+ user_addr_t user_addr);
+
+extern int copyout_atomic64(
+ uint64_t u64,
+ user_addr_t user_addr);