* User-space API/ABI definitions:
*/
+#ifndef __user
+# define __user
+#endif
+
/*
* This is the 'Syslet Atom' - the basic unit of execution
* within the syslet framework. A syslet always represents
* jump a full syslet_uatom number of bytes.) ]
*/
struct syslet_uatom {
- unsigned long flags;
- unsigned long nr;
- long __user *ret_ptr;
- struct syslet_uatom __user *next;
- unsigned long __user *arg_ptr[6];
+ uint32_t flags;
+ uint32_t nr;
+ uint64_t ret_ptr;
+ uint64_t next;
+ uint64_t arg_ptr[6];
/*
* User-space can put anything in here, kernel will not
* touch it:
*/
- void __user *private;
+ uint64_t private;
};
/*
/*
* Execution control: conditions upon the return code
- * of the previous syslet atom. 'Stop' means syslet
+ * of the just executed syslet atom. 'Stop' means syslet
* execution is stopped and the atom is put into the
* completion ring:
*/
/*
* This is the (per-user-context) descriptor of the async completion
- * ring. This gets registered via sys_async_register().
+ * ring. This gets passed in to sys_async_exec():
*/
struct async_head_user {
/*
- * Pointers to completed async syslets (i.e. syslets that
+ * Current completion ring index - managed by the kernel:
+ */
+ uint64_t kernel_ring_idx;
+ /*
+ * User-side ring index:
+ */
+ uint64_t user_ring_idx;
+
+ /*
+ * Ring of pointers to completed async syslets (i.e. syslets that
* generated a cachemiss and went async, returning -EASYNCSYSLET
* to the user context by sys_async_exec()) are queued here.
- * Syslets that were executed synchronously are not queued here.
+ * Syslets that were executed synchronously (cached) are not
+ * queued here.
*
* Note: the final atom that generated the exit condition is
* queued here. Normally this would be the last atom of a syslet.
*/
- struct syslet_uatom __user **completion_ring;
+ uint64_t completion_ring_ptr;
+
/*
* Ring size in bytes:
*/
- unsigned long ring_size_bytes;
+ uint64_t ring_size_bytes;
/*
- * Maximum number of asynchronous contexts the kernel creates.
- *
- * -1UL has a special meaning: the kernel manages the optimal
- * size of the async pool.
- *
- * Note: this field should be valid for the lifetime of async
- * processing, because future kernels detect changes to this
- * field. (enabling user-space to control the size of the async
- * pool in a low-overhead fashion)
+ * The head task can become a cachemiss thread later on
+ * too, if it blocks - so it needs its separate thread
+ * stack and start address too:
+ */
+ uint64_t head_stack;
+ uint64_t head_ip;
+
+ /*
+ * Newly started async kernel threads will take their
+ * user stack and user start address from here. User-space
+ * code has to check for new_thread_stack going to NULL
+ * and has to refill it with a new stack if that happens.
*/
- unsigned long max_nr_threads;
+ uint64_t new_thread_stack;
+ uint64_t new_thread_ip;
};
#endif