diff options
author | Petri Savolainen <petri.savolainen@linaro.org> | 2015-01-26 15:05:35 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-01-27 15:27:03 +0300 |
commit | d9a7f99587b0f498c78383a2c60d8515d1b3d444 (patch) | |
tree | 44b7bdec71c1dfa6964a76145fe81a240b130475 /platform/linux-generic/odp_event.c | |
parent | ac2ed396a463cb5c7fd0ec06bb42c4bb49015b94 (diff) |
api: event: Add odp_event_t
* Added odp_event.h and odp_event.c
* Added odp_event_t type and type conversion functions
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
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 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c new file mode 100644 index 000000000..c646f4219 --- /dev/null +++ b/platform/linux-generic/odp_event.c @@ -0,0 +1,26 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <odp_event.h> +#include <odp_buffer.h> + +int odp_event_type(odp_event_t event) +{ + odp_buffer_t buf; + + buf = odp_buffer_from_event(event); + + switch (odp_buffer_type(buf)) { + case ODP_BUFFER_TYPE_RAW: + return ODP_EVENT_BUFFER; + case ODP_BUFFER_TYPE_PACKET: + return ODP_EVENT_PACKET; + case ODP_BUFFER_TYPE_TIMEOUT: + return ODP_EVENT_TIMEOUT; + default: + return ODP_EVENT_TYPE_INVALID; + } +} |