On 5 February 2016 at 16:56,  <hongbo.zh...@linaro.org> wrote:
> From: Hongbo Zhang <hongbo.zh...@linaro.org>
>
> Currently all ODP_CACHE_LINE_SIZE macros for different architectures are
> held in one header file, they should be moved to their own arch file.
> This patch moves ODP_CACHE_LINE_SIZE for x86.
>
> Signed-off-by: Hongbo Zhang <hongbo.zh...@linaro.org>
> ---
>  doc/application-api-guide/doxygen.cfg          |  1 +
>  include/odp/api/align.h                        |  5 -----
>  platform/linux-generic/arch/x86/odp/cpu_arch.h | 14 ++++++++++++++
>  platform/linux-generic/include/odp/align.h     |  9 ++-------
>  4 files changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/doc/application-api-guide/doxygen.cfg 
> b/doc/application-api-guide/doxygen.cfg
> index 7951e9e..c585108 100644
> --- a/doc/application-api-guide/doxygen.cfg
> +++ b/doc/application-api-guide/doxygen.cfg
> @@ -14,6 +14,7 @@ INPUT = $(SRCDIR)/doc \
>         $(SRCDIR)/doc/users-guide \
>         $(SRCDIR)/include \
>         $(SRCDIR)/platform/$(WITH_PLATFORM)/include/odp \
> +       $(SRCDIR)/platform/$(WITH_PLATFORM)/arch/ \

Plus one doubt, the above change isn't so good,
$(SRCDIR)/platform/$(WITH_PLATFORM)/arch/*/odp should be needed instead
but the wildcard * doesn't work here, $(ARCH) doesn't work either

what is the var 'ARCH' here should be?


>         $(SRCDIR)/helper/include
>  FILE_PATTERNS = *.h odp*.c *.dox
>  RECURSIVE = YES
> diff --git a/include/odp/api/align.h b/include/odp/api/align.h
> index 677ff12..f4b4be6 100644
> --- a/include/odp/api/align.h
> +++ b/include/odp/api/align.h
> @@ -47,11 +47,6 @@ extern "C" {
>   */
>
>  /**
> - * @def ODP_CACHE_LINE_SIZE
> - * Cache line size
> - */
> -
> -/**
>   * @def ODP_PAGE_SIZE
>   * Page size
>   */
> diff --git a/platform/linux-generic/arch/x86/odp/cpu_arch.h 
> b/platform/linux-generic/arch/x86/odp/cpu_arch.h
> index 997a954..58836c6 100644
> --- a/platform/linux-generic/arch/x86/odp/cpu_arch.h
> +++ b/platform/linux-generic/arch/x86/odp/cpu_arch.h
> @@ -11,6 +11,20 @@
>  extern "C" {
>  #endif
>
> +/** @ingroup odp_compiler_optim
> + *  @{
> + */
> +
> +/**
> + * @def ODP_CACHE_LINE_SIZE
> + * Cache line size
> + */
> +#define ODP_CACHE_LINE_SIZE 64
> +
> +/**
> + * @}
> + */
> +
>  static inline void odp_cpu_pause(void)
>  {
>  #ifdef __SSE2__
> diff --git a/platform/linux-generic/include/odp/align.h 
> b/platform/linux-generic/include/odp/align.h
> index be8c9ae..161a302 100644
> --- a/platform/linux-generic/include/odp/align.h
> +++ b/platform/linux-generic/include/odp/align.h
> @@ -31,11 +31,7 @@ extern "C" {
>
>  #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
>
> -#if defined __x86_64__ || defined __i386__
> -
> -#define ODP_CACHE_LINE_SIZE 64
> -
> -#elif defined __arm__ || defined __aarch64__
> +#if defined __arm__ || defined __aarch64__
>
>  #define ODP_CACHE_LINE_SIZE 64
>
> @@ -47,8 +43,6 @@ extern "C" {
>
>  #define ODP_CACHE_LINE_SIZE 64
>
> -#else
> -#error GCC target not found
>  #endif
>
>  #else
> @@ -65,6 +59,7 @@ extern "C" {
>   * @}
>   */
>
> +#include <odp/cpu_arch.h>
>  #include <odp/api/align.h>
>
>  #ifdef __cplusplus
> --
> 2.1.4
>
_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to