diff mbox

api: align: move macros to internal

Message ID 1421088237-10014-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 191e4eb6e53a168ca9486a6419bbbbb4106686c5
Headers show

Commit Message

Mike Holmes Jan. 12, 2015, 6:43 p.m. UTC
These macros were in the pubic API but labeled internal.

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 platform/linux-generic/include/api/odp_align.h     | 44 ----------------------
 .../linux-generic/include/odp_align_internal.h     | 28 ++++++++++++++
 2 files changed, 28 insertions(+), 44 deletions(-)

Comments

Bill Fischofer Jan. 12, 2015, 6:50 p.m. UTC | #1
On Mon, Jan 12, 2015 at 12:43 PM, Mike Holmes <mike.holmes@linaro.org>
wrote:

> These macros were in the pubic API but labeled internal.
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  platform/linux-generic/include/api/odp_align.h     | 44
> ----------------------
>  .../linux-generic/include/odp_align_internal.h     | 28 ++++++++++++++
>  2 files changed, 28 insertions(+), 44 deletions(-)
>
> diff --git a/platform/linux-generic/include/api/odp_align.h
> b/platform/linux-generic/include/api/odp_align.h
> index 6ec5a0a..741f9fd 100644
> --- a/platform/linux-generic/include/api/odp_align.h
> +++ b/platform/linux-generic/include/api/odp_align.h
> @@ -79,50 +79,6 @@ extern "C" {
>  /** Page size */
>  #define ODP_PAGE_SIZE       4096
>
> -
> -/*
> - * Round up
> - */
> -
> -
> -/**
> - * @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 pointer 'x' to cache line size alignment
> - */
> -#define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
> -       ((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))
> -
> -
> -
> -/*
> - * Round down
> - */
> -
> -
> -/**
> - * @internal
> - * Round down pointer 'x' to 'align' alignment, which is a power of two
> - */
> -#define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
> -((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x), (uintptr_t)(align)))
> -
> -
> -/**
> - * @internal
> - * Round down pointer 'x' to cache line size alignment
> - */
> -#define ODP_CACHE_LINE_SIZE_ROUNDDOWN_PTR(x)\
> -       ((void *)ODP_CACHE_LINE_SIZE_ROUNDDOWN((uintptr_t)(x)))
> -
> -
>  /** Defines type/struct/variable to be cache line size aligned */
>  #define ODP_ALIGNED_CACHE   ODP_ALIGNED(ODP_CACHE_LINE_SIZE)
>
> diff --git a/platform/linux-generic/include/odp_align_internal.h
> b/platform/linux-generic/include/odp_align_internal.h
> index 498a7a9..b734cc5 100644
> --- a/platform/linux-generic/include/odp_align_internal.h
> +++ b/platform/linux-generic/include/odp_align_internal.h
> @@ -29,6 +29,20 @@ extern "C" {
>
>  /**
>   * @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 pointer 'x' to cache line size alignment
> + */
> +#define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
> +       ((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))
> +
> +/**
> + * @internal
>   * Round up 'x' to alignment 'align'
>   */
>  #define ODP_ALIGN_ROUNDUP(x, align)\
> @@ -61,6 +75,20 @@ extern "C" {
>
>  /**
>   * @internal
> + * Round down pointer 'x' to 'align' alignment, which is a power of two
> + */
> +#define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
> +((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x), (uintptr_t)(align)))
> +
> +/**
> + * @internal
> + * Round down pointer 'x' to cache line size alignment
> + */
> +#define ODP_CACHE_LINE_SIZE_ROUNDDOWN_PTR(x)\
> +       ((void *)ODP_CACHE_LINE_SIZE_ROUNDDOWN((uintptr_t)(x)))
> +
> +/**
> + * @internal
>   * Round down 'x' to 'align' alignment, which is a power of two
>   */
>  #define ODP_ALIGN_ROUNDDOWN_POWER_2(x, align)\
> --
> 2.1.0
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Jan. 14, 2015, 2:39 p.m. UTC | #2
Merged,
Thanks,
Maxim.

On 01/12/2015 09:43 PM, Mike Holmes wrote:
> These macros were in the pubic API but labeled internal.
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>   platform/linux-generic/include/api/odp_align.h     | 44 ----------------------
>   .../linux-generic/include/odp_align_internal.h     | 28 ++++++++++++++
>   2 files changed, 28 insertions(+), 44 deletions(-)
>
> diff --git a/platform/linux-generic/include/api/odp_align.h b/platform/linux-generic/include/api/odp_align.h
> index 6ec5a0a..741f9fd 100644
> --- a/platform/linux-generic/include/api/odp_align.h
> +++ b/platform/linux-generic/include/api/odp_align.h
> @@ -79,50 +79,6 @@ extern "C" {
>   /** Page size */
>   #define ODP_PAGE_SIZE       4096
>   
> -
> -/*
> - * Round up
> - */
> -
> -
> -/**
> - * @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 pointer 'x' to cache line size alignment
> - */
> -#define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
> -	((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))
> -
> -
> -
> -/*
> - * Round down
> - */
> -
> -
> -/**
> - * @internal
> - * Round down pointer 'x' to 'align' alignment, which is a power of two
> - */
> -#define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
> -((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x), (uintptr_t)(align)))
> -
> -
> -/**
> - * @internal
> - * Round down pointer 'x' to cache line size alignment
> - */
> -#define ODP_CACHE_LINE_SIZE_ROUNDDOWN_PTR(x)\
> -	((void *)ODP_CACHE_LINE_SIZE_ROUNDDOWN((uintptr_t)(x)))
> -
> -
>   /** Defines type/struct/variable to be cache line size aligned */
>   #define ODP_ALIGNED_CACHE   ODP_ALIGNED(ODP_CACHE_LINE_SIZE)
>   
> diff --git a/platform/linux-generic/include/odp_align_internal.h b/platform/linux-generic/include/odp_align_internal.h
> index 498a7a9..b734cc5 100644
> --- a/platform/linux-generic/include/odp_align_internal.h
> +++ b/platform/linux-generic/include/odp_align_internal.h
> @@ -29,6 +29,20 @@ extern "C" {
>   
>   /**
>    * @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 pointer 'x' to cache line size alignment
> + */
> +#define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
> +	((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))
> +
> +/**
> + * @internal
>    * Round up 'x' to alignment 'align'
>    */
>   #define ODP_ALIGN_ROUNDUP(x, align)\
> @@ -61,6 +75,20 @@ extern "C" {
>   
>   /**
>    * @internal
> + * Round down pointer 'x' to 'align' alignment, which is a power of two
> + */
> +#define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
> +((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x), (uintptr_t)(align)))
> +
> +/**
> + * @internal
> + * Round down pointer 'x' to cache line size alignment
> + */
> +#define ODP_CACHE_LINE_SIZE_ROUNDDOWN_PTR(x)\
> +	((void *)ODP_CACHE_LINE_SIZE_ROUNDDOWN((uintptr_t)(x)))
> +
> +/**
> + * @internal
>    * Round down 'x' to 'align' alignment, which is a power of two
>    */
>   #define ODP_ALIGN_ROUNDDOWN_POWER_2(x, align)\
diff mbox

Patch

diff --git a/platform/linux-generic/include/api/odp_align.h b/platform/linux-generic/include/api/odp_align.h
index 6ec5a0a..741f9fd 100644
--- a/platform/linux-generic/include/api/odp_align.h
+++ b/platform/linux-generic/include/api/odp_align.h
@@ -79,50 +79,6 @@  extern "C" {
 /** Page size */
 #define ODP_PAGE_SIZE       4096
 
-
-/*
- * Round up
- */
-
-
-/**
- * @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 pointer 'x' to cache line size alignment
- */
-#define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
-	((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))
-
-
-
-/*
- * Round down
- */
-
-
-/**
- * @internal
- * Round down pointer 'x' to 'align' alignment, which is a power of two
- */
-#define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
-((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x), (uintptr_t)(align)))
-
-
-/**
- * @internal
- * Round down pointer 'x' to cache line size alignment
- */
-#define ODP_CACHE_LINE_SIZE_ROUNDDOWN_PTR(x)\
-	((void *)ODP_CACHE_LINE_SIZE_ROUNDDOWN((uintptr_t)(x)))
-
-
 /** Defines type/struct/variable to be cache line size aligned */
 #define ODP_ALIGNED_CACHE   ODP_ALIGNED(ODP_CACHE_LINE_SIZE)
 
diff --git a/platform/linux-generic/include/odp_align_internal.h b/platform/linux-generic/include/odp_align_internal.h
index 498a7a9..b734cc5 100644
--- a/platform/linux-generic/include/odp_align_internal.h
+++ b/platform/linux-generic/include/odp_align_internal.h
@@ -29,6 +29,20 @@  extern "C" {
 
 /**
  * @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 pointer 'x' to cache line size alignment
+ */
+#define ODP_CACHE_LINE_SIZE_ROUNDUP_PTR(x)\
+	((void *)ODP_CACHE_LINE_SIZE_ROUNDUP((uintptr_t)(x)))
+
+/**
+ * @internal
  * Round up 'x' to alignment 'align'
  */
 #define ODP_ALIGN_ROUNDUP(x, align)\
@@ -61,6 +75,20 @@  extern "C" {
 
 /**
  * @internal
+ * Round down pointer 'x' to 'align' alignment, which is a power of two
+ */
+#define ODP_ALIGN_ROUNDDOWN_PTR_POWER_2(x, align)\
+((void *)ODP_ALIGN_ROUNDDOWN_POWER_2((uintptr_t)(x), (uintptr_t)(align)))
+
+/**
+ * @internal
+ * Round down pointer 'x' to cache line size alignment
+ */
+#define ODP_CACHE_LINE_SIZE_ROUNDDOWN_PTR(x)\
+	((void *)ODP_CACHE_LINE_SIZE_ROUNDDOWN((uintptr_t)(x)))
+
+/**
+ * @internal
  * Round down 'x' to 'align' alignment, which is a power of two
  */
 #define ODP_ALIGN_ROUNDDOWN_POWER_2(x, align)\