Add spawn, spawn_with_caps and span calls to the Process Manager API.
[barrelfish] / include / barrelfish / domain.h
index 5c3c119..0ef645a 100644 (file)
 #define BARRELFISH_DOMAIN_H
 
 #include <sys/cdefs.h>
+#include <barrelfish/event_queue.h>
 #include <barrelfish/threads.h>
 
 __BEGIN_DECLS
 
 typedef void (*domain_spanned_callback_t)(void *arg, errval_t err);
 
+///< Struct for spanning domains state machine
+struct span_domain_state {
+    struct thread *thread;              ///< Thread to run on remote core
+    uint8_t core_id;                    ///< Id of the remote core
+    errval_t err;                       ///< To propagate error value
+    domain_spanned_callback_t callback; ///< Callback for when domain has spanned
+    void *callback_arg;                 ///< Optional argument to pass with callback
+    struct capref frame;                ///< Dispatcher frame
+    struct capref vroot;                ///< VRoot cap
+    struct event_queue_node event_qnode;       ///< Event queue node
+    struct waitset_chanstate initev;    ///< Dispatcher initialized event
+    bool initialized;                   ///< True if remote initialized
+};
+
 struct mem_binding;
 struct octopus_binding;
 struct monitor_binding;
@@ -73,6 +88,8 @@ errval_t domain_init(void);
 errval_t domain_new_dispatcher(coreid_t core_id,
                                domain_spanned_callback_t callback,
                                void *callback_arg);
+errval_t domain_new_dispatcher_setup_only(coreid_t core_id,
+                                          struct span_domain_state **ret_state);
 errval_t domain_thread_create_on(coreid_t core_id, thread_func_t start_func,
                                  void *arg, struct thread **newthread);
 errval_t domain_thread_create_on_varstack(coreid_t core_id,