aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_event.h
diff options
context:
space:
mode:
authorKeith Burns (alagalah) <alagalah@gmail.com>2018-03-23 13:42:49 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-04-12 20:33:02 +0000
commit410bcca41c1a3e7c3d4b4c2940120f9b21732d49 (patch)
treee79249ffbad91f744d15261b2003eea64bff9e2c /src/vcl/vcl_event.h
parentba1e158082048640686ec0b7791126c9e5c4e0fc (diff)
VCL IOEvent external API callback
Change-Id: I417357b00c43b27872aa3f681335bdc1ef574eca Signed-off-by: Keith Burns (alagalah) <alagalah@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/vcl/vcl_event.h')
-rw-r--r--src/vcl/vcl_event.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/vcl/vcl_event.h b/src/vcl/vcl_event.h
index f2a85a0f1d2..21884665075 100644
--- a/src/vcl/vcl_event.h
+++ b/src/vcl/vcl_event.h
@@ -39,8 +39,8 @@ typedef union vce_event_key_
typedef struct vce_event_
{
vce_event_key_t evk;
- u32 refcnt;
- void *data;
+ u32 recycle;
+ u64 data[2]; // Hard code size to avoid allocator thrashing.
} vce_event_t;
typedef void (*vce_event_callback_t) (void *reg /*vce_event_handler_reg_t* */);
@@ -87,9 +87,9 @@ int vce_generate_event (vce_event_thread_t *evt, u32 ev_idx);
* - removes event from event_pool
*
* @param evt - vce_event_thread_t - event system state
- * @param ev - vce_event_t - event to remove
+ * @param ev_idx - u32 - index of event to remove
*/
-void vce_clear_event (vce_event_thread_t *evt, vce_event_t *ev);
+void vce_clear_event (vce_event_thread_t *evt, u32 ev_idx);
/**
* @brief vce_get_event_from_index()
@@ -102,6 +102,20 @@ void vce_clear_event (vce_event_thread_t *evt, vce_event_t *ev);
vce_event_t * vce_get_event_from_index(vce_event_thread_t *evt, u32 ev_idx);
/**
+ * @brief vce_get_event_data()
+ *
+ * @param ev - vce_event_t * - event
+ * @param data_size - u32 - required size of data
+ *
+ * @return vce_event_t *
+ */
+always_inline void * vce_get_event_data(vce_event_t *ev, u32 data_size)
+{
+ ASSERT(sizeof(ev->data) >= data_size);
+ return (&ev->data);
+}
+
+/**
* @brief vce_get_event_handler()
* - returns handler if exists or 0
* @param evt - vce_event_thread_t - event system state