diff options
author | Zoltan Kiss <zoltan.kiss@linaro.org> | 2015-07-01 18:06:15 +0100 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-07-06 15:14:55 +0300 |
commit | b7170aaabba07dbc12e4c776e9f4e463efadd3cb (patch) | |
tree | c0be7df97b989530d3dab92d795358ba16a0fc83 /platform/linux-generic/odp_event.c | |
parent | f85a31f6b17250f7a6ff2f4e264b452d53a445c4 (diff) |
event: implement odp_event_free()
Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/odp_event.c')
-rw-r--r-- | platform/linux-generic/odp_event.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index d9e86a9bd..c50103cfb 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -6,11 +6,35 @@ #include <odp/event.h> #include <odp/buffer.h> +#include <odp/crypto.h> +#include <odp/packet.h> +#include <odp/timer.h> #include <odp/pool.h> #include <odp_buffer_internal.h> #include <odp_buffer_inlines.h> +#include <odp_debug_internal.h> int odp_event_type(odp_event_t event) { return _odp_buffer_event_type(odp_buffer_from_event(event)); } + +void odp_event_free(odp_event_t event) +{ + switch (odp_event_type(event)) { + case ODP_EVENT_BUFFER: + odp_buffer_free(odp_buffer_from_event(event)); + break; + case ODP_EVENT_PACKET: + odp_packet_free(odp_packet_from_event(event)); + break; + case ODP_EVENT_TIMEOUT: + odp_timeout_free(odp_timeout_from_event(event)); + break; + case ODP_EVENT_CRYPTO_COMPL: + odp_crypto_compl_free(odp_crypto_compl_from_event(event)); + break; + default: + ODP_ABORT("Invalid event type: %d\n", odp_event_type(event)); + } +} |