void *data,
unsigned int size);
+/* Routine to send a message from user memory across a service */
+extern int
+vchi_queue_user_message(VCHI_SERVICE_HANDLE_T handle,
+ void __user *data,
+ unsigned int size);
+
// Routine to receive a msg from a service
// Dequeue is equivalent to hold, copy into client buffer, release
extern int32_t vchi_msg_dequeue( VCHI_SERVICE_HANDLE_T handle,
}
EXPORT_SYMBOL(vchi_queue_kernel_message);
+struct vchi_queue_user_message_context {
+ void __user *data;
+};
+
+static ssize_t
+vchi_queue_user_message_callback(void *context,
+ void *dest,
+ size_t offset,
+ size_t maxsize)
+{
+ struct vchi_queue_user_message_context *copycontext = context;
+
+ if (copy_from_user(dest, copycontext->data + offset, maxsize))
+ return -EFAULT;
+
+ return maxsize;
+}
+
+int
+vchi_queue_user_message(VCHI_SERVICE_HANDLE_T handle,
+ void __user *data,
+ unsigned int size)
+{
+ struct vchi_queue_user_message_context copycontext = {
+ .data = data
+ };
+
+ return vchi_msg_queue(handle,
+ vchi_queue_user_message_callback,
+ ©context,
+ size);
+}
+EXPORT_SYMBOL(vchi_queue_user_message);
+
/***********************************************************
* Name: vchi_bulk_queue_receive
*