diff mbox

[v3,API-NEXT,1/4] linux-generic: separate x86 ODP_CACHE_LINE_SIZE to its arch file

Message ID 1454662607-28792-2-git-send-email-hongbo.zhang@linaro.org
State New
Headers show

Commit Message

Hongbo Zhang Feb. 5, 2016, 8:56 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@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.zhang@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(-)

Comments

Anders Roxell Feb. 9, 2016, 10:41 a.m. UTC | #1
On 2016-02-05 16:56, hongbo.zhang@linaro.org wrote:
> From: Hongbo Zhang <hongbo.zhang@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.zhang@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/ \
>  	$(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
> - */
> -
> -/**

I'm not convinced that we should move the documentation away from the
"generic" header file.

Cheers,
Anders
Maxim Uvarov Feb. 12, 2016, 8:16 a.m. UTC | #2
On 02/09/16 18:48, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>
>> -----Original Message-----
>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT
>> Anders Roxell
>> Sent: Tuesday, February 09, 2016 12:42 PM
>> To: hongbo.zhang@linaro.org
>> Cc: lng-odp@lists.linaro.org
>> Subject: Re: [lng-odp] [PATCH v3 API-NEXT 1/4] linux-generic: separate x86
>> ODP_CACHE_LINE_SIZE to its arch file
>>
>> On 2016-02-05 16:56, hongbo.zhang@linaro.org wrote:
>>> From: Hongbo Zhang <hongbo.zhang@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.zhang@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/ \
>>>   	$(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
>>> - */
>>> -
>>> -/**
>> I'm not convinced that we should move the documentation away from the
>> "generic" header file.
>>
>> Cheers,
>> Anders
> Yes, the doxygen documentation (API spec) of this API definition must stay in the main API header file. Arch specific files are for implementation and must not doxygen document API definitions.
>
> -Petri
>
waiting for v4 then.
Maxim.

> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Christophe Milard Feb. 12, 2016, 8:32 a.m. UTC | #3
On 5 February 2016 at 09:56, <hongbo.zhang@linaro.org> wrote:

> From: Hongbo Zhang <hongbo.zhang@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.zhang@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/ \

>         $(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

>


This is moving things that belongs to the Application Programming Interface
(prefixed by ODP and in the "api" directory) to arch, which is not attached
to any interface. This is a problem. As we now have other interfaces (e.g.
driver interface), where would you define DRV_CACHE_LINE_SIZE?
As the choice has been made to separate these two interfaces into two
directories, I assume a arch directory should be created for each interface.
Maybe that issue should be brought to the next ARCH call...

Hope that make sense to you as well.
Thanks
Christophe.

+
> +/**

> + * @}

> + */

> +

>  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

>
Hongbo Zhang Feb. 17, 2016, 10:08 a.m. UTC | #4
Thanks all for the review.

When patch finished, which branch should I base on, api-next or master?

I think it is master because what I need are all in master now, and
this isn't an api changing, agree?

On 12 February 2016 at 16:16, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 02/09/16 18:48, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>
>>
>>> -----Original Message-----
>>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT
>>> Anders Roxell
>>> Sent: Tuesday, February 09, 2016 12:42 PM
>>> To: hongbo.zhang@linaro.org
>>> Cc: lng-odp@lists.linaro.org
>>> Subject: Re: [lng-odp] [PATCH v3 API-NEXT 1/4] linux-generic: separate
>>> x86
>>> ODP_CACHE_LINE_SIZE to its arch file
>>>
>>> On 2016-02-05 16:56, hongbo.zhang@linaro.org wrote:
>>>>
>>>> From: Hongbo Zhang <hongbo.zhang@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.zhang@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/ \
>>>>         $(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
>>>> - */
>>>> -
>>>> -/**
>>>
>>> I'm not convinced that we should move the documentation away from the
>>> "generic" header file.
>>>
>>> Cheers,
>>> Anders
>>
>> Yes, the doxygen documentation (API spec) of this API definition must stay
>> in the main API header file. Arch specific files are for implementation and
>> must not doxygen document API definitions.
>>
>> -Petri
>>
> waiting for v4 then.
> Maxim.
>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Feb. 17, 2016, 1:14 p.m. UTC | #5
On 02/17/16 13:08, Hongbo Zhang wrote:
> Thanks all for the review.
>
> When patch finished, which branch should I base on, api-next or master?
>
> I think it is master because what I need are all in master now, and
> this isn't an api changing, agree?

yes, these patches are for master branch.

Maxim.

>
> On 12 February 2016 at 16:16, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> On 02/09/16 18:48, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>>>
>>>> -----Original Message-----
>>>> From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of EXT
>>>> Anders Roxell
>>>> Sent: Tuesday, February 09, 2016 12:42 PM
>>>> To: hongbo.zhang@linaro.org
>>>> Cc: lng-odp@lists.linaro.org
>>>> Subject: Re: [lng-odp] [PATCH v3 API-NEXT 1/4] linux-generic: separate
>>>> x86
>>>> ODP_CACHE_LINE_SIZE to its arch file
>>>>
>>>> On 2016-02-05 16:56, hongbo.zhang@linaro.org wrote:
>>>>> From: Hongbo Zhang <hongbo.zhang@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.zhang@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/ \
>>>>>          $(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
>>>>> - */
>>>>> -
>>>>> -/**
>>>> I'm not convinced that we should move the documentation away from the
>>>> "generic" header file.
>>>>
>>>> Cheers,
>>>> Anders
>>> Yes, the doxygen documentation (API spec) of this API definition must stay
>>> in the main API header file. Arch specific files are for implementation and
>>> must not doxygen document API definitions.
>>>
>>> -Petri
>>>
>> waiting for v4 then.
>> Maxim.
>>
>>> _______________________________________________
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
Hongbo Zhang Feb. 18, 2016, 10:08 a.m. UTC | #6
On 9 February 2016 at 18:41, Anders Roxell <anders.roxell@linaro.org> wrote:
> On 2016-02-05 16:56, hongbo.zhang@linaro.org wrote:
>> From: Hongbo Zhang <hongbo.zhang@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.zhang@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/ \
>>       $(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
>> - */
>> -
>> -/**
>
> I'm not convinced that we should move the documentation away from the
> "generic" header file.
>

Well, after tried, if I leave this documentation still in
include/odp/api/align.h, I cannot 'make doxygen-html' correctly, there
is either compiling or the macro missing in html files.

Anybody who is familiar with this doxygen grammar has any suggestions?

Thanks.

> Cheers,
> Anders
Hongbo Zhang Feb. 19, 2016, 2:02 p.m. UTC | #7
On 5 February 2016 at 16:56,  <hongbo.zhang@linaro.org> wrote:
> From: Hongbo Zhang <hongbo.zhang@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.zhang@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
>
diff mbox

Patch

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/ \
 	$(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