diff mbox

[API-NEXT,PATCHv3,1/6] api: event: change to odp_event_type_t

Message ID 1436051526-15926-1-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer July 4, 2015, 11:12 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 include/odp/api/event.h                            | 23 +++++-----------------
 .../linux-generic/include/odp/plat/event_types.h   | 13 ++++++++----
 .../linux-generic/include/odp_buffer_inlines.h     |  2 +-
 .../linux-generic/include/odp_buffer_internal.h    |  2 +-
 platform/linux-generic/odp_event.c                 |  2 +-
 5 files changed, 17 insertions(+), 25 deletions(-)

Comments

Maxim Uvarov July 7, 2015, 9:44 a.m. UTC | #1
Looks like that is good to merge now, right?

Maxim.

On 07/05/15 02:12, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   include/odp/api/event.h                            | 23 +++++-----------------
>   .../linux-generic/include/odp/plat/event_types.h   | 13 ++++++++----
>   .../linux-generic/include/odp_buffer_inlines.h     |  2 +-
>   .../linux-generic/include/odp_buffer_internal.h    |  2 +-
>   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 63b476f..69d23b6 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 d91937d..06b15cd 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 74af38b..18d1a2e 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 ef116c3..d9ffc06 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 d9e86a9..f79fcc3 100644
> --- a/platform/linux-generic/odp_event.c
> +++ b/platform/linux-generic/odp_event.c
> @@ -10,7 +10,7 @@
>   #include <odp_buffer_internal.h>
>   #include <odp_buffer_inlines.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));
>   }
Bill Fischofer July 7, 2015, 11:32 a.m. UTC | #2
Yes, but we were going to go through all of the API-NEXT patches this
morning and sort/prioritize them.

On Tue, Jul 7, 2015 at 4:44 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Looks like that is good to merge now, right?
>
> Maxim.
>
>
> On 07/05/15 02:12, Bill Fischofer wrote:
>
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   include/odp/api/event.h                            | 23
>> +++++-----------------
>>   .../linux-generic/include/odp/plat/event_types.h   | 13 ++++++++----
>>   .../linux-generic/include/odp_buffer_inlines.h     |  2 +-
>>   .../linux-generic/include/odp_buffer_internal.h    |  2 +-
>>   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 63b476f..69d23b6 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 d91937d..06b15cd 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 74af38b..18d1a2e 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 ef116c3..d9ffc06 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 d9e86a9..f79fcc3 100644
>> --- a/platform/linux-generic/odp_event.c
>> +++ b/platform/linux-generic/odp_event.c
>> @@ -10,7 +10,7 @@
>>   #include <odp_buffer_internal.h>
>>   #include <odp_buffer_inlines.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));
>>   }
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov July 7, 2015, 3:40 p.m. UTC | #3
Merged,

Thanks,
Maxim.

On 07/05/15 02:12, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   include/odp/api/event.h                            | 23 +++++-----------------
>   .../linux-generic/include/odp/plat/event_types.h   | 13 ++++++++----
>   .../linux-generic/include/odp_buffer_inlines.h     |  2 +-
>   .../linux-generic/include/odp_buffer_internal.h    |  2 +-
>   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 63b476f..69d23b6 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 d91937d..06b15cd 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 74af38b..18d1a2e 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 ef116c3..d9ffc06 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 d9e86a9..f79fcc3 100644
> --- a/platform/linux-generic/odp_event.c
> +++ b/platform/linux-generic/odp_event.c
> @@ -10,7 +10,7 @@
>   #include <odp_buffer_internal.h>
>   #include <odp_buffer_inlines.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));
>   }
diff mbox

Patch

diff --git a/include/odp/api/event.h b/include/odp/api/event.h
index 63b476f..69d23b6 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 d91937d..06b15cd 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 74af38b..18d1a2e 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 ef116c3..d9ffc06 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 d9e86a9..f79fcc3 100644
--- a/platform/linux-generic/odp_event.c
+++ b/platform/linux-generic/odp_event.c
@@ -10,7 +10,7 @@ 
 #include <odp_buffer_internal.h>
 #include <odp_buffer_inlines.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));
 }