#include <if/spawn_defs.h>
#include <barrelfish/barrelfish.h>
+struct spawnd_state;
+struct msg_queue_elem;
+typedef bool (*msg_cont_handler_fn)(struct msg_queue_elem*);
+
+struct msg_queue_elem {
+ void *st;
+ msg_cont_handler_fn cont;
+
+ struct msg_queue_elem *next;
+};
+
+struct msg_queue {
+ struct msg_queue_elem *head, *tail;
+};
+
struct spawnd_state {
coreid_t core_id;
struct spawn_binding *b;
+
+ struct msg_queue sendq;
+ struct msg_queue recvq;
};
errval_t spawnd_state_alloc(coreid_t core_id, struct spawn_binding *b);
bool spawnd_state_exists(coreid_t core_id);
struct spawnd_state *spawnd_state_get(coreid_t core_id);
+errval_t spawnd_state_enqueue_send(struct spawnd_state *spawnd,
+ struct msg_queue_elem *msg);
+void *spawnd_state_dequeue_recv(struct spawnd_state *spawnd);
+
#endif // SPAWND_STATE