summaryrefslogtreecommitdiff
path: root/include/linux/acall.h
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-10-11 13:36:15 -0700
committerKent Overstreet <koverstreet@google.com>2012-10-11 13:36:15 -0700
commit21a0765a50fff349155964432b9529541eee5e8a (patch)
treef605ce5afbeb7d2dce0ee8c546f47d98ea5f48fb /include/linux/acall.h
parent07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff)
acallacall
Diffstat (limited to 'include/linux/acall.h')
-rw-r--r--include/linux/acall.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/linux/acall.h b/include/linux/acall.h
new file mode 100644
index 000000000000..f6d3f6b854af
--- /dev/null
+++ b/include/linux/acall.h
@@ -0,0 +1,54 @@
+#ifndef __LINUX_ACALL_H
+#define __LINUX_ACALL_H
+
+/*
+ * The kernel makes a private copy of this during sys_acall_submit(). Once
+ * that call returns userspace does not need to keep it around.
+ *
+ * The flags field will be used to indicate the presence of fields which
+ * are added to the end of the struct over time. To support this the
+ * submission call must refuse submission for structs which contain flags
+ * which it doesn't recognize.
+ */
+struct acall_submission {
+ u32 nr;
+ u32 flags;
+ u64 cookie;
+ u64 completion_ring_pointer;
+ u64 completion_pointer;
+ u64 id_pointer;
+ u64 args[6];
+};
+
+#define ACALL_SUBMIT_THREAD_POOL 1
+
+/*
+ * This is used by userspace to specify an operation for cancelation or
+ * waiting. The data here only has significance to the kernel.
+ */
+struct acall_id {
+ unsigned char opaque[16];
+};
+
+struct acall_completion {
+ u64 return_code;
+ u64 cookie;
+};
+
+/*
+ * 'nr' is read by the kernel each time it tries to store an event in
+ * the ring.
+ *
+ * 'head' is written by the kernel as it adds events. Once it changes than
+ * the kernel will be writing an acall_completion struct into the ring.
+ * A non-zero cookie field of the completion struct indicates that the
+ * completion has been written. Once it is non-zero then the return_code
+ * can be loaded after issuing a read memory barrier.
+ */
+struct acall_completion_ring {
+ u32 head;
+ u32 nr;
+ struct acall_completion comps[0];
+};
+
+#endif