diff mbox

[PATCHv3] Factor ODP types into a common include file

Message ID 1415990436-10926-3-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit 111e333bc608333042b5fb3939dcfad9105dad86
Headers show

Commit Message

Bill Fischofer Nov. 14, 2014, 6:40 p.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 platform/linux-generic/Makefile.am                 |  1 +
 platform/linux-generic/include/api/odp_buffer.h    |  9 +--
 .../linux-generic/include/api/odp_buffer_pool.h    |  5 +-
 platform/linux-generic/include/api/odp_packet.h    | 30 ---------
 platform/linux-generic/include/api/odp_packet_io.h | 12 +---
 .../linux-generic/include/api/odp_platform_types.h | 71 ++++++++++++++++++++++
 6 files changed, 75 insertions(+), 53 deletions(-)
 create mode 100644 platform/linux-generic/include/api/odp_platform_types.h

Comments

Anders Roxell Nov. 14, 2014, 9:08 p.m. UTC | #1
On 2014-11-14 12:40, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

Reviewed-by: Anders Roxell <anders.roxell@linaro.org>

> ---
>  platform/linux-generic/Makefile.am                 |  1 +
>  platform/linux-generic/include/api/odp_buffer.h    |  9 +--
>  .../linux-generic/include/api/odp_buffer_pool.h    |  5 +-
>  platform/linux-generic/include/api/odp_packet.h    | 30 ---------
>  platform/linux-generic/include/api/odp_packet_io.h | 12 +---
>  .../linux-generic/include/api/odp_platform_types.h | 71 ++++++++++++++++++++++
>  6 files changed, 75 insertions(+), 53 deletions(-)
>  create mode 100644 platform/linux-generic/include/api/odp_platform_types.h
> 
> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
> index 0153a22..ea77521 100644
> --- a/platform/linux-generic/Makefile.am
> +++ b/platform/linux-generic/Makefile.am
> @@ -36,6 +36,7 @@ include_HEADERS = \
>  		  $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \
>  		  $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \
>  		  $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \
> +		  $(top_srcdir)/platform/linux-generic/include/api/odp_platform_types.h \
>  		  $(top_srcdir)/platform/linux-generic/include/api/odp_version.h
>  
>  subdirheadersdir = $(includedir)
> diff --git a/platform/linux-generic/include/api/odp_buffer.h b/platform/linux-generic/include/api/odp_buffer.h
> index 289e0eb..da23120 100644
> --- a/platform/linux-generic/include/api/odp_buffer.h
> +++ b/platform/linux-generic/include/api/odp_buffer.h
> @@ -20,20 +20,13 @@ extern "C" {
>  
>  
>  #include <odp_std_types.h>
> -
> +#include <odp_platform_types.h>
>  
>  /** @defgroup odp_buffer ODP BUFFER
>   *  Operations on a buffer.
>   *  @{
>   */
>  
> -/**
> - * ODP buffer
> - */
> -typedef uint32_t odp_buffer_t;
> -
> -#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */
> -
>  
>  /**
>   * Buffer start address
> diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h b/platform/linux-generic/include/api/odp_buffer_pool.h
> index d04abf0..30b83e0 100644
> --- a/platform/linux-generic/include/api/odp_buffer_pool.h
> +++ b/platform/linux-generic/include/api/odp_buffer_pool.h
> @@ -21,6 +21,7 @@ extern "C" {
>  
>  
>  #include <odp_std_types.h>
> +#include <odp_platform_types.h>
>  #include <odp_buffer.h>
>  
>  /** @addtogroup odp_buffer
> @@ -34,10 +35,6 @@ extern "C" {
>  /** Invalid buffer pool */
>  #define ODP_BUFFER_POOL_INVALID   0
>  
> -/** ODP buffer pool */
> -typedef uint32_t odp_buffer_pool_t;
> -
> -
>  /**
>   * Create a buffer pool
>   *
> diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h
> index 688e047..5298fa0 100644
> --- a/platform/linux-generic/include/api/odp_packet.h
> +++ b/platform/linux-generic/include/api/odp_packet.h
> @@ -25,36 +25,6 @@ extern "C" {
>   *  @{
>   */
>  
> -/**
> - * ODP packet descriptor
> - */
> -typedef odp_buffer_t odp_packet_t;
> -
> -/** Invalid packet */
> -#define ODP_PACKET_INVALID ODP_BUFFER_INVALID
> -
> -/** Invalid offset */
> -#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1)
> -
> -
> -/**
> - * ODP packet segment handle
> - */
> -typedef int odp_packet_seg_t;
> -
> -/** Invalid packet segment */
> -#define ODP_PACKET_SEG_INVALID -1
> -
> -/**
> - * ODP packet segment info
> - */
> -typedef struct odp_packet_seg_info_t {
> -	void   *addr;      /**< Segment start address */
> -	size_t  size;      /**< Segment maximum data size */
> -	void   *data;      /**< Segment data address */
> -	size_t  data_len;  /**< Segment data length */
> -} odp_packet_seg_info_t;
> -
>  
>  /**
>   * Initialize the packet
> diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h
> index 360636d..47daeda 100644
> --- a/platform/linux-generic/include/api/odp_packet_io.h
> +++ b/platform/linux-generic/include/api/odp_packet_io.h
> @@ -19,6 +19,7 @@ extern "C" {
>  #endif
>  
>  #include <odp_std_types.h>
> +#include <odp_platform_types.h>
>  #include <odp_buffer_pool.h>
>  #include <odp_packet.h>
>  #include <odp_queue.h>
> @@ -28,17 +29,6 @@ extern "C" {
>   *  @{
>   */
>  
> -/** ODP packet IO handle */
> -typedef uint32_t odp_pktio_t;
> -
> -/** Invalid packet IO handle */
> -#define ODP_PKTIO_INVALID 0
> -
> -/**
> - * odp_pktio_t value to indicate any port
> - */
> -#define ODP_PKTIO_ANY ((odp_pktio_t)~0)
> -
>  /**
>   * Open an ODP packet IO instance
>   *
> diff --git a/platform/linux-generic/include/api/odp_platform_types.h b/platform/linux-generic/include/api/odp_platform_types.h
> new file mode 100644
> index 0000000..4db47d3
> --- /dev/null
> +++ b/platform/linux-generic/include/api/odp_platform_types.h
> @@ -0,0 +1,71 @@
> +/* Copyright (c) 2014, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier:     BSD-3-Clause
> + */
> +
> +
> +/**
> + * @file
> + * ODP implementation types
> + * This file contains all of the implementation-defined types for ODP abstract
> + * definitions. Having this in one file means that other ODP API files are
> + * implementation-independent and avoids circular dependencies for files that
> + * refer to types managed by other components. Included here are typedefs and
> + * related typed constants that are referenced by other ODP API files.
> + */
> +
> +#ifndef ODP_IMPL_TYPES_H_
> +#define ODP_IMPL_TYPES_H_
> +
> +/** @defgroup odp_platform_types ODP PLATFORM TYPES
> + *  Implementation specific definitions for ODP abstract types.
> + *  @{
> + */
> +
> +/** ODP Buffer pool */
> +typedef uint32_t odp_buffer_pool_t;
> +
> +/** ODP buffer */
> +typedef uint32_t odp_buffer_t;
> +
> +/** Invalid buffer */
> +#define ODP_BUFFER_INVALID (0xffffffff)
> +
> +/** ODP packet */
> +typedef odp_buffer_t odp_packet_t;
> +
> +/** Invalid packet */
> +#define ODP_PACKET_INVALID ODP_BUFFER_INVALID
> +
> +/** Invalid offset */
> +#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1)
> +
> +/** ODP packet segment */
> +typedef int odp_packet_seg_t;
> +
> +/** Invalid packet segment */
> +#define ODP_PACKET_SEG_INVALID -1
> +
> +/** ODP packet segment info */
> +typedef struct odp_packet_seg_info_t {
> +	void   *addr;      /**< Segment start address */
> +	size_t  size;      /**< Segment maximum data size */
> +	void   *data;      /**< Segment data address */
> +	size_t  data_len;  /**< Segment data length */
> +} odp_packet_seg_info_t;
> +
> +/** ODP packet IO handle */
> +typedef uint32_t odp_pktio_t;
> +
> +/** Invalid packet IO handle */
> +#define ODP_PKTIO_INVALID 0
> +
> +/** odp_pktio_t value to indicate any port */
> +#define ODP_PKTIO_ANY ((odp_pktio_t)~0)
> +
> +/**
> + * @}
> + */
> +
> +#endif
> -- 
> 1.8.3.2
> 
> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Nov. 15, 2014, 10:01 a.m. UTC | #2
Merged!

Thanks,
Maxim.

On 11/14/2014 09:40 PM, Bill Fischofer wrote:
> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
> ---
>   platform/linux-generic/Makefile.am                 |  1 +
>   platform/linux-generic/include/api/odp_buffer.h    |  9 +--
>   .../linux-generic/include/api/odp_buffer_pool.h    |  5 +-
>   platform/linux-generic/include/api/odp_packet.h    | 30 ---------
>   platform/linux-generic/include/api/odp_packet_io.h | 12 +---
>   .../linux-generic/include/api/odp_platform_types.h | 71 ++++++++++++++++++++++
>   6 files changed, 75 insertions(+), 53 deletions(-)
>   create mode 100644 platform/linux-generic/include/api/odp_platform_types.h
>
> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
> index 0153a22..ea77521 100644
> --- a/platform/linux-generic/Makefile.am
> +++ b/platform/linux-generic/Makefile.am
> @@ -36,6 +36,7 @@ include_HEADERS = \
>   		  $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \
>   		  $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \
>   		  $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \
> +		  $(top_srcdir)/platform/linux-generic/include/api/odp_platform_types.h \
>   		  $(top_srcdir)/platform/linux-generic/include/api/odp_version.h
>   
>   subdirheadersdir = $(includedir)
> diff --git a/platform/linux-generic/include/api/odp_buffer.h b/platform/linux-generic/include/api/odp_buffer.h
> index 289e0eb..da23120 100644
> --- a/platform/linux-generic/include/api/odp_buffer.h
> +++ b/platform/linux-generic/include/api/odp_buffer.h
> @@ -20,20 +20,13 @@ extern "C" {
>   
>   
>   #include <odp_std_types.h>
> -
> +#include <odp_platform_types.h>
>   
>   /** @defgroup odp_buffer ODP BUFFER
>    *  Operations on a buffer.
>    *  @{
>    */
>   
> -/**
> - * ODP buffer
> - */
> -typedef uint32_t odp_buffer_t;
> -
> -#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */
> -
>   
>   /**
>    * Buffer start address
> diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h b/platform/linux-generic/include/api/odp_buffer_pool.h
> index d04abf0..30b83e0 100644
> --- a/platform/linux-generic/include/api/odp_buffer_pool.h
> +++ b/platform/linux-generic/include/api/odp_buffer_pool.h
> @@ -21,6 +21,7 @@ extern "C" {
>   
>   
>   #include <odp_std_types.h>
> +#include <odp_platform_types.h>
>   #include <odp_buffer.h>
>   
>   /** @addtogroup odp_buffer
> @@ -34,10 +35,6 @@ extern "C" {
>   /** Invalid buffer pool */
>   #define ODP_BUFFER_POOL_INVALID   0
>   
> -/** ODP buffer pool */
> -typedef uint32_t odp_buffer_pool_t;
> -
> -
>   /**
>    * Create a buffer pool
>    *
> diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h
> index 688e047..5298fa0 100644
> --- a/platform/linux-generic/include/api/odp_packet.h
> +++ b/platform/linux-generic/include/api/odp_packet.h
> @@ -25,36 +25,6 @@ extern "C" {
>    *  @{
>    */
>   
> -/**
> - * ODP packet descriptor
> - */
> -typedef odp_buffer_t odp_packet_t;
> -
> -/** Invalid packet */
> -#define ODP_PACKET_INVALID ODP_BUFFER_INVALID
> -
> -/** Invalid offset */
> -#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1)
> -
> -
> -/**
> - * ODP packet segment handle
> - */
> -typedef int odp_packet_seg_t;
> -
> -/** Invalid packet segment */
> -#define ODP_PACKET_SEG_INVALID -1
> -
> -/**
> - * ODP packet segment info
> - */
> -typedef struct odp_packet_seg_info_t {
> -	void   *addr;      /**< Segment start address */
> -	size_t  size;      /**< Segment maximum data size */
> -	void   *data;      /**< Segment data address */
> -	size_t  data_len;  /**< Segment data length */
> -} odp_packet_seg_info_t;
> -
>   
>   /**
>    * Initialize the packet
> diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h
> index 360636d..47daeda 100644
> --- a/platform/linux-generic/include/api/odp_packet_io.h
> +++ b/platform/linux-generic/include/api/odp_packet_io.h
> @@ -19,6 +19,7 @@ extern "C" {
>   #endif
>   
>   #include <odp_std_types.h>
> +#include <odp_platform_types.h>
>   #include <odp_buffer_pool.h>
>   #include <odp_packet.h>
>   #include <odp_queue.h>
> @@ -28,17 +29,6 @@ extern "C" {
>    *  @{
>    */
>   
> -/** ODP packet IO handle */
> -typedef uint32_t odp_pktio_t;
> -
> -/** Invalid packet IO handle */
> -#define ODP_PKTIO_INVALID 0
> -
> -/**
> - * odp_pktio_t value to indicate any port
> - */
> -#define ODP_PKTIO_ANY ((odp_pktio_t)~0)
> -
>   /**
>    * Open an ODP packet IO instance
>    *
> diff --git a/platform/linux-generic/include/api/odp_platform_types.h b/platform/linux-generic/include/api/odp_platform_types.h
> new file mode 100644
> index 0000000..4db47d3
> --- /dev/null
> +++ b/platform/linux-generic/include/api/odp_platform_types.h
> @@ -0,0 +1,71 @@
> +/* Copyright (c) 2014, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier:     BSD-3-Clause
> + */
> +
> +
> +/**
> + * @file
> + * ODP implementation types
> + * This file contains all of the implementation-defined types for ODP abstract
> + * definitions. Having this in one file means that other ODP API files are
> + * implementation-independent and avoids circular dependencies for files that
> + * refer to types managed by other components. Included here are typedefs and
> + * related typed constants that are referenced by other ODP API files.
> + */
> +
> +#ifndef ODP_IMPL_TYPES_H_
> +#define ODP_IMPL_TYPES_H_
> +
> +/** @defgroup odp_platform_types ODP PLATFORM TYPES
> + *  Implementation specific definitions for ODP abstract types.
> + *  @{
> + */
> +
> +/** ODP Buffer pool */
> +typedef uint32_t odp_buffer_pool_t;
> +
> +/** ODP buffer */
> +typedef uint32_t odp_buffer_t;
> +
> +/** Invalid buffer */
> +#define ODP_BUFFER_INVALID (0xffffffff)
> +
> +/** ODP packet */
> +typedef odp_buffer_t odp_packet_t;
> +
> +/** Invalid packet */
> +#define ODP_PACKET_INVALID ODP_BUFFER_INVALID
> +
> +/** Invalid offset */
> +#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1)
> +
> +/** ODP packet segment */
> +typedef int odp_packet_seg_t;
> +
> +/** Invalid packet segment */
> +#define ODP_PACKET_SEG_INVALID -1
> +
> +/** ODP packet segment info */
> +typedef struct odp_packet_seg_info_t {
> +	void   *addr;      /**< Segment start address */
> +	size_t  size;      /**< Segment maximum data size */
> +	void   *data;      /**< Segment data address */
> +	size_t  data_len;  /**< Segment data length */
> +} odp_packet_seg_info_t;
> +
> +/** ODP packet IO handle */
> +typedef uint32_t odp_pktio_t;
> +
> +/** Invalid packet IO handle */
> +#define ODP_PKTIO_INVALID 0
> +
> +/** odp_pktio_t value to indicate any port */
> +#define ODP_PKTIO_ANY ((odp_pktio_t)~0)
> +
> +/**
> + * @}
> + */
> +
> +#endif
Taras Kondratiuk Nov. 17, 2014, 9:01 a.m. UTC | #3
On 11/15/2014 12:01 PM, Maxim Uvarov wrote:
> Merged!

Guys, what about commit message? How one should understand what was the
reason for this patch by looking into git log?

Also it would be nice to have 'linux-generic:' prefix in the subject.
So browsing via git log one could easily determine what was touched by 
the patch.

Bill, for a one patch series a cover letter is usually redundant.
Normally text from you cover letter should be here in the commit
message. If there are something you want to mention, but don't want it
to go into the git history, then put that after '---' delimiter a few
lines below (just below the Signed-off-by tag).

>
> Thanks,
> Maxim.
>
> On 11/14/2014 09:40 PM, Bill Fischofer wrote:
>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>> ---
>>   platform/linux-generic/Makefile.am                 |  1 +
>>   platform/linux-generic/include/api/odp_buffer.h    |  9 +--
>>   .../linux-generic/include/api/odp_buffer_pool.h    |  5 +-
>>   platform/linux-generic/include/api/odp_packet.h    | 30 ---------
>>   platform/linux-generic/include/api/odp_packet_io.h | 12 +---
>>   .../linux-generic/include/api/odp_platform_types.h | 71
>> ++++++++++++++++++++++
>>   6 files changed, 75 insertions(+), 53 deletions(-)
>>   create mode 100644
Maxim Uvarov Nov. 17, 2014, 10 a.m. UTC | #4
On 11/17/2014 12:01 PM, Taras Kondratiuk wrote:
> On 11/15/2014 12:01 PM, Maxim Uvarov wrote:
>> Merged!
>
> Guys, what about commit message? How one should understand what was the
> reason for this patch by looking into git log?
>

yes, agree maybe we need some more clear message for that. But I think 
short description says what was done.

> Also it would be nice to have 'linux-generic:' prefix in the subject.
> So browsing via git log one could easily determine what was touched by 
> the patch.
>

No prefix by default means it's for linux-generic.

Maxim.

> Bill, for a one patch series a cover letter is usually redundant.
> Normally text from you cover letter should be here in the commit
> message. If there are something you want to mention, but don't want it
> to go into the git history, then put that after '---' delimiter a few
> lines below (just below the Signed-off-by tag).
>
>>
>> Thanks,
>> Maxim.
>>
>> On 11/14/2014 09:40 PM, Bill Fischofer wrote:
>>> Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
>>> ---
>>>   platform/linux-generic/Makefile.am                 |  1 +
>>>   platform/linux-generic/include/api/odp_buffer.h    |  9 +--
>>>   .../linux-generic/include/api/odp_buffer_pool.h    |  5 +-
>>>   platform/linux-generic/include/api/odp_packet.h    | 30 ---------
>>>   platform/linux-generic/include/api/odp_packet_io.h | 12 +---
>>>   .../linux-generic/include/api/odp_platform_types.h | 71
>>> ++++++++++++++++++++++
>>>   6 files changed, 75 insertions(+), 53 deletions(-)
>>>   create mode 100644
Taras Kondratiuk Nov. 17, 2014, 11:17 a.m. UTC | #5
On 11/17/2014 12:00 PM, Maxim Uvarov wrote:
> On 11/17/2014 12:01 PM, Taras Kondratiuk wrote:
>> On 11/15/2014 12:01 PM, Maxim Uvarov wrote:
>>> Merged!
>>
>> Guys, what about commit message? How one should understand what was the
>> reason for this patch by looking into git log?
>>
>
> yes, agree maybe we need some more clear message for that. But I think
> short description says what was done.
>
>> Also it would be nice to have 'linux-generic:' prefix in the subject.
>> So browsing via git log one could easily determine what was touched by
>> the patch.
>>
>
> No prefix by default means it's for linux-generic.

That is not clear for a new user.
Right prefixes make browsing through git log much more pleasant.
Prefixes can be hierarchical:

- "linux-generic: crypto: ..." or "platform: crypto:"
- "cunit: crypto: ..." or "validation: crypto:"
- "example: ipsec: ..."
Anders Roxell Nov. 17, 2014, 11:21 a.m. UTC | #6
On 17 November 2014 12:17, Taras Kondratiuk <taras.kondratiuk@linaro.org> wrote:
> On 11/17/2014 12:00 PM, Maxim Uvarov wrote:
>>
>> On 11/17/2014 12:01 PM, Taras Kondratiuk wrote:
>>>
>>> On 11/15/2014 12:01 PM, Maxim Uvarov wrote:
>>>>
>>>> Merged!
>>>
>>>
>>> Guys, what about commit message? How one should understand what was the
>>> reason for this patch by looking into git log?
>>>
>>
>> yes, agree maybe we need some more clear message for that. But I think
>> short description says what was done.
>>
>>> Also it would be nice to have 'linux-generic:' prefix in the subject.
>>> So browsing via git log one could easily determine what was touched by
>>> the patch.
>>>
>>
>> No prefix by default means it's for linux-generic.
>
>
> That is not clear for a new user.
> Right prefixes make browsing through git log much more pleasant.

I agree with you Taras!

> Prefixes can be hierarchical:
>
> - "linux-generic: crypto: ..." or "platform: crypto:"

I like "platform: crypto:"

> - "cunit: crypto: ..." or "validation: crypto:"

we should stick to "cunit: crypto:" until we change the directory to
validation right?

Cheers,
Anders

> - "example: ipsec: ..."
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes Nov. 17, 2014, 3:05 p.m. UTC | #7
On 17 November 2014 06:21, Anders Roxell <anders.roxell@linaro.org> wrote:

> On 17 November 2014 12:17, Taras Kondratiuk <taras.kondratiuk@linaro.org>
> wrote:
> > On 11/17/2014 12:00 PM, Maxim Uvarov wrote:
> >>
> >> On 11/17/2014 12:01 PM, Taras Kondratiuk wrote:
> >>>
> >>> On 11/15/2014 12:01 PM, Maxim Uvarov wrote:
> >>>>
> >>>> Merged!
> >>>
> >>>
> >>> Guys, what about commit message? How one should understand what was the
> >>> reason for this patch by looking into git log?
> >>>
> >>
> >> yes, agree maybe we need some more clear message for that. But I think
> >> short description says what was done.
> >>
> >>> Also it would be nice to have 'linux-generic:' prefix in the subject.
> >>> So browsing via git log one could easily determine what was touched by
> >>> the patch.
> >>>
> >>
> >> No prefix by default means it's for linux-generic.
> >
> >
> > That is not clear for a new user.
> > Right prefixes make browsing through git log much more pleasant.
>
> I agree with you Taras!
>
> > Prefixes can be hierarchical:
> >
> > - "linux-generic: crypto: ..." or "platform: crypto:"
>
> I like "platform: crypto:"
>
> > - "cunit: crypto: ..." or "validation: crypto:"
>
> we should stick to "cunit: crypto:" until we change the directory to
> validation right?
>

Yes, in progress.


>
> Cheers,
> Anders
>
> > - "example: ipsec: ..."
> >
> >
> > _______________________________________________
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 0153a22..ea77521 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -36,6 +36,7 @@  include_HEADERS = \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_ticketlock.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_time.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_timer.h \
+		  $(top_srcdir)/platform/linux-generic/include/api/odp_platform_types.h \
 		  $(top_srcdir)/platform/linux-generic/include/api/odp_version.h
 
 subdirheadersdir = $(includedir)
diff --git a/platform/linux-generic/include/api/odp_buffer.h b/platform/linux-generic/include/api/odp_buffer.h
index 289e0eb..da23120 100644
--- a/platform/linux-generic/include/api/odp_buffer.h
+++ b/platform/linux-generic/include/api/odp_buffer.h
@@ -20,20 +20,13 @@  extern "C" {
 
 
 #include <odp_std_types.h>
-
+#include <odp_platform_types.h>
 
 /** @defgroup odp_buffer ODP BUFFER
  *  Operations on a buffer.
  *  @{
  */
 
-/**
- * ODP buffer
- */
-typedef uint32_t odp_buffer_t;
-
-#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */
-
 
 /**
  * Buffer start address
diff --git a/platform/linux-generic/include/api/odp_buffer_pool.h b/platform/linux-generic/include/api/odp_buffer_pool.h
index d04abf0..30b83e0 100644
--- a/platform/linux-generic/include/api/odp_buffer_pool.h
+++ b/platform/linux-generic/include/api/odp_buffer_pool.h
@@ -21,6 +21,7 @@  extern "C" {
 
 
 #include <odp_std_types.h>
+#include <odp_platform_types.h>
 #include <odp_buffer.h>
 
 /** @addtogroup odp_buffer
@@ -34,10 +35,6 @@  extern "C" {
 /** Invalid buffer pool */
 #define ODP_BUFFER_POOL_INVALID   0
 
-/** ODP buffer pool */
-typedef uint32_t odp_buffer_pool_t;
-
-
 /**
  * Create a buffer pool
  *
diff --git a/platform/linux-generic/include/api/odp_packet.h b/platform/linux-generic/include/api/odp_packet.h
index 688e047..5298fa0 100644
--- a/platform/linux-generic/include/api/odp_packet.h
+++ b/platform/linux-generic/include/api/odp_packet.h
@@ -25,36 +25,6 @@  extern "C" {
  *  @{
  */
 
-/**
- * ODP packet descriptor
- */
-typedef odp_buffer_t odp_packet_t;
-
-/** Invalid packet */
-#define ODP_PACKET_INVALID ODP_BUFFER_INVALID
-
-/** Invalid offset */
-#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1)
-
-
-/**
- * ODP packet segment handle
- */
-typedef int odp_packet_seg_t;
-
-/** Invalid packet segment */
-#define ODP_PACKET_SEG_INVALID -1
-
-/**
- * ODP packet segment info
- */
-typedef struct odp_packet_seg_info_t {
-	void   *addr;      /**< Segment start address */
-	size_t  size;      /**< Segment maximum data size */
-	void   *data;      /**< Segment data address */
-	size_t  data_len;  /**< Segment data length */
-} odp_packet_seg_info_t;
-
 
 /**
  * Initialize the packet
diff --git a/platform/linux-generic/include/api/odp_packet_io.h b/platform/linux-generic/include/api/odp_packet_io.h
index 360636d..47daeda 100644
--- a/platform/linux-generic/include/api/odp_packet_io.h
+++ b/platform/linux-generic/include/api/odp_packet_io.h
@@ -19,6 +19,7 @@  extern "C" {
 #endif
 
 #include <odp_std_types.h>
+#include <odp_platform_types.h>
 #include <odp_buffer_pool.h>
 #include <odp_packet.h>
 #include <odp_queue.h>
@@ -28,17 +29,6 @@  extern "C" {
  *  @{
  */
 
-/** ODP packet IO handle */
-typedef uint32_t odp_pktio_t;
-
-/** Invalid packet IO handle */
-#define ODP_PKTIO_INVALID 0
-
-/**
- * odp_pktio_t value to indicate any port
- */
-#define ODP_PKTIO_ANY ((odp_pktio_t)~0)
-
 /**
  * Open an ODP packet IO instance
  *
diff --git a/platform/linux-generic/include/api/odp_platform_types.h b/platform/linux-generic/include/api/odp_platform_types.h
new file mode 100644
index 0000000..4db47d3
--- /dev/null
+++ b/platform/linux-generic/include/api/odp_platform_types.h
@@ -0,0 +1,71 @@ 
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ * ODP implementation types
+ * This file contains all of the implementation-defined types for ODP abstract
+ * definitions. Having this in one file means that other ODP API files are
+ * implementation-independent and avoids circular dependencies for files that
+ * refer to types managed by other components. Included here are typedefs and
+ * related typed constants that are referenced by other ODP API files.
+ */
+
+#ifndef ODP_IMPL_TYPES_H_
+#define ODP_IMPL_TYPES_H_
+
+/** @defgroup odp_platform_types ODP PLATFORM TYPES
+ *  Implementation specific definitions for ODP abstract types.
+ *  @{
+ */
+
+/** ODP Buffer pool */
+typedef uint32_t odp_buffer_pool_t;
+
+/** ODP buffer */
+typedef uint32_t odp_buffer_t;
+
+/** Invalid buffer */
+#define ODP_BUFFER_INVALID (0xffffffff)
+
+/** ODP packet */
+typedef odp_buffer_t odp_packet_t;
+
+/** Invalid packet */
+#define ODP_PACKET_INVALID ODP_BUFFER_INVALID
+
+/** Invalid offset */
+#define ODP_PACKET_OFFSET_INVALID ((uint32_t)-1)
+
+/** ODP packet segment */
+typedef int odp_packet_seg_t;
+
+/** Invalid packet segment */
+#define ODP_PACKET_SEG_INVALID -1
+
+/** ODP packet segment info */
+typedef struct odp_packet_seg_info_t {
+	void   *addr;      /**< Segment start address */
+	size_t  size;      /**< Segment maximum data size */
+	void   *data;      /**< Segment data address */
+	size_t  data_len;  /**< Segment data length */
+} odp_packet_seg_info_t;
+
+/** ODP packet IO handle */
+typedef uint32_t odp_pktio_t;
+
+/** Invalid packet IO handle */
+#define ODP_PKTIO_INVALID 0
+
+/** odp_pktio_t value to indicate any port */
+#define ODP_PKTIO_ANY ((odp_pktio_t)~0)
+
+/**
+ * @}
+ */
+
+#endif