Add the 'current_kthread' helper
[akaros.git] / kern / include / ros / ceq.h
index d7e3f27..4dce3de 100644 (file)
@@ -34,6 +34,7 @@
 
 #pragma once
 
+#include <ros/bits/event.h>
 #include <ros/atomic.h>
 #include <ros/ring_buffer.h>
 
@@ -66,11 +67,14 @@ struct ceq_event {
 
 struct ceq {
        struct ceq_event                        *events;                /* consumer pointer */
-       size_t                                          nr_events;
+       unsigned int                            nr_events;
+       unsigned int                            last_recovered;
+       atomic_t                                        max_event_ever;
        int32_t                                         *ring;                  /* consumer pointer */
        uint32_t                                        ring_sz;                /* size (power of 2) */
        uint8_t                                         operation;              /* e.g. CEQ_OR */
        bool                                            ring_overflowed;
+       bool                                            overflow_recovery;
        atomic_t                                        prod_idx;               /* next prod slot to fill */
        atomic_t                                        cons_pub_idx;   /* how far has been consumed */
        atomic_t                                        cons_pvt_idx;   /* next cons slot to get */