Change proc_mgmt/pending_clients.h to use reply queues instead of hashtables.
[barrelfish] / usr / proc_mgmt / spawnd_state.h
index ce5ae27..4d801ab 100644 (file)
 #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;
+    coreid_t core_id;
     struct spawn_binding *b;
 
-    // TODO(razvan): will need more state here.
+    struct msg_queue sendq;
+    struct msg_queue recvq;
 };
 
 errval_t spawnd_state_alloc(coreid_t core_id, struct spawn_binding *b);
@@ -29,4 +45,8 @@ void spawnd_state_free(coreid_t core_id);
 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