diff options
-rw-r--r-- | include/odp/api/event.h | 23 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/plat/event_types.h | 13 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_buffer_inlines.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_buffer_internal.h | 2 | ||||
-rw-r--r-- | platform/linux-generic/odp_event.c | 2 |
5 files changed, 17 insertions, 25 deletions
diff --git a/include/odp/api/event.h b/include/odp/api/event.h index cefad1259..29547f335 100644 --- a/include/odp/api/event.h +++ b/include/odp/api/event.h @@ -36,23 +36,10 @@ extern "C" { */ /** - * @def ODP_EVENT_BUFFER - * Buffer event - */ - -/** - * @def ODP_EVENT_PACKET - * Packet event - */ - -/** - * @def ODP_EVENT_TIMEOUT - * Timeout event - */ - -/** - * @def ODP_EVENT_CRYPTO_COMPL - * Crypto completion event + * @typedef odp_event_type_t + * ODP event types: + * ODP_EVENT_BUFFER, ODP_EVENT_PACKET, ODP_EVENT_TIMEOUT, + * ODP_EVENT_CRYPTO_COMPL */ /** @@ -62,7 +49,7 @@ extern "C" { * * @return Event type */ -int odp_event_type(odp_event_t event); +odp_event_type_t odp_event_type(odp_event_t event); /** * Get printable value for an odp_event_t diff --git a/platform/linux-generic/include/odp/plat/event_types.h b/platform/linux-generic/include/odp/plat/event_types.h index d91937d2e..06b15cdfe 100644 --- a/platform/linux-generic/include/odp/plat/event_types.h +++ b/platform/linux-generic/include/odp/plat/event_types.h @@ -30,10 +30,15 @@ typedef ODP_HANDLE_T(odp_event_t); #define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0xffffffff) -#define ODP_EVENT_BUFFER 1 -#define ODP_EVENT_PACKET 2 -#define ODP_EVENT_TIMEOUT 3 -#define ODP_EVENT_CRYPTO_COMPL 4 +/** + * Event types + */ +typedef enum odp_event_type_t { + ODP_EVENT_BUFFER = 1, + ODP_EVENT_PACKET = 2, + ODP_EVENT_TIMEOUT = 3, + ODP_EVENT_CRYPTO_COMPL = 4, +} odp_event_type_t; /** Get printable format of odp_event_t */ static inline uint64_t odp_event_to_u64(odp_event_t hdl) diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index 74af38b9c..18d1a2ea5 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -190,7 +190,7 @@ static inline void *segment_map(odp_buffer_hdr_t *buf, return (void *)seg_addr; } -static inline int _odp_buffer_event_type(odp_buffer_t buf) +static inline odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf) { return odp_buf_to_hdr(buf)->event_type; } diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index ef116c3de..d9ffc0678 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -117,7 +117,7 @@ typedef struct odp_buffer_hdr_t { } flags; int16_t allocator; /* allocating thread id */ int8_t type; /* buffer type */ - int8_t event_type; /* for reuse as event */ + odp_event_type_t event_type; /* for reuse as event */ uint32_t size; /* max data size */ odp_atomic_u32_t ref_count; /* reference count */ odp_pool_t pool_hdl; /* buffer pool handle */ diff --git a/platform/linux-generic/odp_event.c b/platform/linux-generic/odp_event.c index c50103cfb..30dde56a3 100644 --- a/platform/linux-generic/odp_event.c +++ b/platform/linux-generic/odp_event.c @@ -14,7 +14,7 @@ #include <odp_buffer_inlines.h> #include <odp_debug_internal.h> -int odp_event_type(odp_event_t event) +odp_event_type_t odp_event_type(odp_event_t event) { return _odp_buffer_event_type(odp_buffer_from_event(event)); } |