Merged,
Maxim.

On 12/05/2014 01:11 AM, Bill Fischofer wrote:
Looks good. Please get this merged soon as it will cause a number of other patches to need to be rebased, including my buffer pool stuff that I'm reworking for resubmission. Thanks.

On Thu, Dec 4, 2014 at 2:25 PM, Mike Holmes <[email protected] <mailto:[email protected]>> wrote:

    Signed-off-by: Mike Holmes <[email protected]
    <mailto:[email protected]>>


Reviewed-by: Bill Fischofer <[email protected] <mailto:[email protected]>>

    ---
     platform/linux-generic/include/api/odp_align.h     |  50 -----------
     .../linux-generic/include/odp_align_internal.h     | 100
    +++++++++++++++++++++
     .../linux-generic/include/odp_packet_io_internal.h |   1 +
     .../linux-generic/include/odp_queue_internal.h     |   1 +
     platform/linux-generic/odp_buffer_pool.c           |   1 +
     platform/linux-generic/odp_packet_socket.c         |   1 +
     platform/linux-generic/odp_ring.c                  |   1 +
     platform/linux-generic/odp_shared_memory.c         |   1 +
     8 files changed, 106 insertions(+), 50 deletions(-)
     create mode 100644
    platform/linux-generic/include/odp_align_internal.h

    diff --git a/platform/linux-generic/include/api/odp_align.h
    b/platform/linux-generic/include/api/odp_align.h
    index eb5f724..6ec5a0a 100644
    --- a/platform/linux-generic/include/api/odp_align.h
    +++ b/platform/linux-generic/include/api/odp_align.h
    @@ -84,12 +84,6 @@ extern "C" {
      * Round up
      */

    -/**
    - * @internal
    - * Round up 'x' to alignment 'align'
    - */
    -#define ODP_ALIGN_ROUNDUP(x, align)\
    -       ((align) * (((x) + align - 1) / (align)))

     /**
      * @internal
    @@ -98,12 +92,6 @@ extern "C" {
     #define ODP_ALIGN_ROUNDUP_PTR(x, align)\
            ((void *)ODP_ALIGN_ROUNDUP((uintptr_t)(x),
    (uintptr_t)(align)))

    -/**
    - * @internal
    - * Round up 'x' to cache line size alignment
    - */
    -#define ODP_CACHE_LINE_SIZE_ROUNDUP(x)\
    -       ODP_ALIGN_ROUNDUP(x, ODP_CACHE_LINE_SIZE)

     /**
      * @internal
    @@ -112,24 +100,12 @@ extern "C" {
     #define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
            ((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))

    -/**
    - * @internal
    - * Round up 'x' to page size alignment
    - */
    -#define ODP_PAGE_SIZE_ROUNDUP(x)\
    -       ODP_ALIGN_ROUNDUP(x, ODP_PAGE_SIZE)


     /*
      * Round down
      */

    -/**
    - * @internal
    - * Round down 'x' to 'align' alignment, which is a power of two
    - */
    -#define ODP_ALIGN_ROUNDDOWN_POWER_2(x, align)\
    -       ((x) & (~((align) - 1)))

     /**
      * @internal
    @@ -138,12 +114,6 @@ extern "C" {
     #define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
     ((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x),
    (uintptr_t)(align)))

    -/**
    - * @internal
    - * Round down 'x' to cache line size alignment
    - */
    -#define ODP_CACHE_LINE_SIZE_ROUNDDOWN(x)\
    -       ODP_ALIGN_ROUNDDOWN_POWER_2(x, ODP_CACHE_LINE_SIZE)

     /**
      * @internal
    @@ -159,26 +129,6 @@ extern "C" {
     /** Defines type/struct/variable to be page size aligned */
     #define ODP_ALIGNED_PAGE    ODP_ALIGNED(ODP_PAGE_SIZE)

    -
    -
    -/*
    - * Check align
    - */
    -
    -/**
    - * @internal
    - * Check if pointer 'x' is aligned to 'align', which is a power
    of two
    - */
    -#define ODP_ALIGNED_CHECK_POWER_2(x, align)\
    -       ((((uintptr_t)(x)) & (((uintptr_t)(align))-1)) == 0)
    -
    -/**
    - * @internal
    - * Check if value is a power of two
    - */
    -#define ODP_VAL_IS_POWER_2(x) ((((x)-1) & (x)) == 0)
    -
    -
     /**
      * @}
      */
    diff --git a/platform/linux-generic/include/odp_align_internal.h
    b/platform/linux-generic/include/odp_align_internal.h
    new file mode 100644
    index 0000000..498a7a9
    --- /dev/null
    +++ b/platform/linux-generic/include/odp_align_internal.h
    @@ -0,0 +1,100 @@
    +/* Copyright (c) 2014, Linaro Limited
    + * All rights reserved.
    + *
    + * SPDX-License-Identifier:    BSD-3-Clause
    + */
    +
    +/**
    + * @file
    + *
    + * ODP internal alignments
    + */
    +
    +#ifndef ODP_ALIGN_INTERNAL_H_
    +#define ODP_ALIGN_INTERNAL_H_
    +
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
    +#include <odp_align.h>
    +
    +/** @addtogroup odp_compiler_optim
    + *  @{
    + */
    +
    +/*
    + * Round up
    + */
    +
    +/**
    + * @internal
    + * Round up 'x' to alignment 'align'
    + */
    +#define ODP_ALIGN_ROUNDUP(x, align)\
    +       ((align) * (((x) + align - 1) / (align)))
    +
    +/**
    + * @internal
    + * Round up pointer 'x' to alignment 'align'
    + */
    +#define ODP_ALIGN_ROUNDUP_PTR(x, align)\
    +       ((void *)ODP_ALIGN_ROUNDUP((uintptr_t)(x),
    (uintptr_t)(align)))
    +
    +/**
    + * @internal
    + * Round up 'x' to cache line size alignment
    + */
    +#define ODP_CACHE_LINE_SIZE_ROUNDUP(x)\
    +       ODP_ALIGN_ROUNDUP(x, ODP_CACHE_LINE_SIZE)
    +
    +/**
    + * @internal
    + * Round up 'x' to page size alignment
    + */
    +#define ODP_PAGE_SIZE_ROUNDUP(x)\
    +       ODP_ALIGN_ROUNDUP(x, ODP_PAGE_SIZE)
    +
    +/*
    + * Round down
    + */
    +
    +/**
    + * @internal
    + * Round down 'x' to 'align' alignment, which is a power of two
    + */
    +#define ODP_ALIGN_ROUNDDOWN_POWER_2(x, align)\
    +       ((x) & (~((align) - 1)))
    +/**
    + * @internal
    + * Round down 'x' to cache line size alignment
    + */
    +#define ODP_CACHE_LINE_SIZE_ROUNDDOWN(x)\
    +       ODP_ALIGN_ROUNDDOWN_POWER_2(x, ODP_CACHE_LINE_SIZE)
    +
    +/*
    + * Check align
    + */
    +
    +/**
    + * @internal
    + * Check if pointer 'x' is aligned to 'align', which is a power
    of two
    + */
    +#define ODP_ALIGNED_CHECK_POWER_2(x, align)\
    +       ((((uintptr_t)(x)) & (((uintptr_t)(align))-1)) == 0)
    +
    +/**
    + * @internal
    + * Check if value is a power of two
    + */
    +#define ODP_VAL_IS_POWER_2(x) ((((x)-1) & (x)) == 0)
    +
    +/**
    + * @}
    + */
    +
    +#ifdef __cplusplus
    +}
    +#endif
    +
    +#endif
    diff --git
    a/platform/linux-generic/include/odp_packet_io_internal.h
    b/platform/linux-generic/include/odp_packet_io_internal.h
    index 0bc1e21..7819dc7 100644
    --- a/platform/linux-generic/include/odp_packet_io_internal.h
    +++ b/platform/linux-generic/include/odp_packet_io_internal.h
    @@ -20,6 +20,7 @@ extern "C" {

     #include <odp_spinlock.h>
     #include <odp_packet_socket.h>
    +#include <odp_align_internal.h>

     #include <linux/if.h>

    diff --git a/platform/linux-generic/include/odp_queue_internal.h
    b/platform/linux-generic/include/odp_queue_internal.h
    index 8b6c517..1254763 100644
    --- a/platform/linux-generic/include/odp_queue_internal.h
    +++ b/platform/linux-generic/include/odp_queue_internal.h
    @@ -20,6 +20,7 @@ extern "C" {

     #include <odp_queue.h>
     #include <odp_buffer_internal.h>
    +#include <odp_align_internal.h>
     #include <odp_packet_io.h>
     #include <odp_align.h>

    diff --git a/platform/linux-generic/odp_buffer_pool.c
    b/platform/linux-generic/odp_buffer_pool.c
    index 6a0a6b2..250da81 100644
    --- a/platform/linux-generic/odp_buffer_pool.c
    +++ b/platform/linux-generic/odp_buffer_pool.c
    @@ -10,6 +10,7 @@
     #include <odp_buffer_internal.h>
     #include <odp_packet_internal.h>
     #include <odp_timer_internal.h>
    +#include <odp_align_internal.h>
     #include <odp_shared_memory.h>
     #include <odp_align.h>
     #include <odp_internal.h>
    diff --git a/platform/linux-generic/odp_packet_socket.c
    b/platform/linux-generic/odp_packet_socket.c
    index 68983eb..1468340 100644
    --- a/platform/linux-generic/odp_packet_socket.c
    +++ b/platform/linux-generic/odp_packet_socket.c
    @@ -36,6 +36,7 @@

     #include <odp_packet_socket.h>
     #include <odp_packet_internal.h>
    +#include <odp_align_internal.h>
     #include <odp_hints.h>

     #include <odph_eth.h>
    diff --git a/platform/linux-generic/odp_ring.c
    b/platform/linux-generic/odp_ring.c
    index 1d3130a..2b4e0a6 100644
    --- a/platform/linux-generic/odp_ring.c
    +++ b/platform/linux-generic/odp_ring.c
    @@ -72,6 +72,7 @@
     #include <odp_shared_memory.h>
     #include <odp_internal.h>
     #include <odp_spin_internal.h>
    +#include <odp_align_internal.h>
     #include <odp_spinlock.h>
     #include <odp_align.h>
     #include <sys/mman.h>
    diff --git a/platform/linux-generic/odp_shared_memory.c
    b/platform/linux-generic/odp_shared_memory.c
    index 4bcf73e..abf6da3 100644
    --- a/platform/linux-generic/odp_shared_memory.c
    +++ b/platform/linux-generic/odp_shared_memory.c
    @@ -11,6 +11,7 @@
     #include <odp_system_info.h>
     #include <odp_debug.h>
     #include <odp_debug_internal.h>
    +#include <odp_align_internal.h>

     #include <unistd.h>
     #include <sys/mman.h>
    --
    2.1.0


    _______________________________________________
    lng-odp mailing list
    [email protected] <mailto:[email protected]>
    http://lists.linaro.org/mailman/listinfo/lng-odp




_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to