diff mbox

[API,NEXT,v5,03/17] api: sysinfo: move CPU model API to cpu.h

Message ID 1442325342-13806-4-git-send-email-hongbo.zhang@freescale.com
State New
Headers show

Commit Message

hongbo.zhang@freescale.com Sept. 15, 2015, 1:55 p.m. UTC
From: Hongbo Zhang <hongbo.zhang@linaro.org>

This patch moves odp_sys_cpu_model_str() to cpu.h, all the calling
functions will be updated in later separate patch.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 include/odp/api/cpu.h                    | 9 +++++++++
 include/odp/api/system_info.h            | 7 -------
 platform/linux-generic/odp_system_info.c | 2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)

Comments

Ivan Khoronzhuk Sept. 15, 2015, 2:18 p.m. UTC | #1
Hi, Hongbo

Can it be built after this change? Should it be build-able at least?

On 15.09.15 16:55, hongbo.zhang@freescale.com wrote:
> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>
> This patch moves odp_sys_cpu_model_str() to cpu.h, all the calling
> functions will be updated in later separate patch.
>
> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
> ---
>   include/odp/api/cpu.h                    | 9 +++++++++
>   include/odp/api/system_info.h            | 7 -------
>   platform/linux-generic/odp_system_info.c | 2 +-
>   3 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
> index c389093..78c3ffc 100644
> --- a/include/odp/api/cpu.h
> +++ b/include/odp/api/cpu.h
> @@ -44,6 +44,15 @@ int odp_cpu_id(void);
>   int odp_cpu_count(void);
>
>   /**
> + * CPU model name of this CPU
> + *
> + * Returns the CPU model name of this CPU.
> + *
> + * @return Pointer to CPU model name string
> + */
> +const char *odp_cpu_model_str(void);
> +
> +/**
>    * @}
>    */
>
> diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h
> index e55ff6d..1cd883f 100644
> --- a/include/odp/api/system_info.h
> +++ b/include/odp/api/system_info.h
> @@ -45,13 +45,6 @@ uint64_t odp_sys_huge_page_size(void);
>   uint64_t odp_sys_page_size(void);
>
>   /**
> - * CPU model name
> - *
> - * @return Pointer to CPU model name string
> - */
> -const char *odp_sys_cpu_model_str(void);
> -
> -/**
>    * Cache line size in bytes
>    *
>    * @return CPU cache line size in bytes
> diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
> index 83226f8..ed6b515 100644
> --- a/platform/linux-generic/odp_system_info.c
> +++ b/platform/linux-generic/odp_system_info.c
> @@ -389,7 +389,7 @@ uint64_t odp_sys_page_size(void)
>   	return odp_global_data.system_info.page_size;
>   }
>
> -const char *odp_sys_cpu_model_str(void)
> +const char *odp_cpu_model_str(void)
>   {
>   	return odp_global_data.system_info.model_str[0];
>   }
>
Mike Holmes Sept. 15, 2015, 2:30 p.m. UTC | #2
On 15 September 2015 at 10:18, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
wrote:

> Hi, Hongbo
>
> Can it be built after this change? Should it be build-able at least?


All series should be build-able - if the check-odp  apply-and-build script
does not pass it cannot be committed.


>
>
> On 15.09.15 16:55, hongbo.zhang@freescale.com wrote:
>
>> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>>
>> This patch moves odp_sys_cpu_model_str() to cpu.h, all the calling
>> functions will be updated in later separate patch.
>>
>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>> ---
>>   include/odp/api/cpu.h                    | 9 +++++++++
>>   include/odp/api/system_info.h            | 7 -------
>>   platform/linux-generic/odp_system_info.c | 2 +-
>>   3 files changed, 10 insertions(+), 8 deletions(-)
>>
>> diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
>> index c389093..78c3ffc 100644
>> --- a/include/odp/api/cpu.h
>> +++ b/include/odp/api/cpu.h
>> @@ -44,6 +44,15 @@ int odp_cpu_id(void);
>>   int odp_cpu_count(void);
>>
>>   /**
>> + * CPU model name of this CPU
>> + *
>> + * Returns the CPU model name of this CPU.
>> + *
>> + * @return Pointer to CPU model name string
>> + */
>> +const char *odp_cpu_model_str(void);
>> +
>> +/**
>>    * @}
>>    */
>>
>> diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h
>> index e55ff6d..1cd883f 100644
>> --- a/include/odp/api/system_info.h
>> +++ b/include/odp/api/system_info.h
>> @@ -45,13 +45,6 @@ uint64_t odp_sys_huge_page_size(void);
>>   uint64_t odp_sys_page_size(void);
>>
>>   /**
>> - * CPU model name
>> - *
>> - * @return Pointer to CPU model name string
>> - */
>> -const char *odp_sys_cpu_model_str(void);
>> -
>> -/**
>>    * Cache line size in bytes
>>    *
>>    * @return CPU cache line size in bytes
>> diff --git a/platform/linux-generic/odp_system_info.c
>> b/platform/linux-generic/odp_system_info.c
>> index 83226f8..ed6b515 100644
>> --- a/platform/linux-generic/odp_system_info.c
>> +++ b/platform/linux-generic/odp_system_info.c
>> @@ -389,7 +389,7 @@ uint64_t odp_sys_page_size(void)
>>         return odp_global_data.system_info.page_size;
>>   }
>>
>> -const char *odp_sys_cpu_model_str(void)
>> +const char *odp_cpu_model_str(void)
>>   {
>>         return odp_global_data.system_info.model_str[0];
>>   }
>>
>>
> --
> Regards,
> Ivan Khoronzhuk
>
Hongbo Zhang Sept. 16, 2015, 9:48 a.m. UTC | #3
Ivan,
Which kind of built error?
In fact, when validation codes are enabled, there was already an build
error exist in the test/validation/crypto code, this error isn't
introduced by my patches, if you compile validation without my
patches, you'll see this error again. I didn't spend time to research
why, just simply disable the crypto codes in Mikefile.
Another error may be default compiling treat warnings as errors, so I
use this command to config:
./configure  --enable-test-vald  CFLAGS="-O0 -g -Wno-error"

Are these the errors you met?


On 15 September 2015 at 22:30, Mike Holmes <mike.holmes@linaro.org> wrote:
>
>
> On 15 September 2015 at 10:18, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> wrote:
>>
>> Hi, Hongbo
>>
>> Can it be built after this change? Should it be build-able at least?
>
>
> All series should be build-able - if the check-odp  apply-and-build script
> does not pass it cannot be committed.
>
>>
>>
>>
>> On 15.09.15 16:55, hongbo.zhang@freescale.com wrote:
>>>
>>> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>
>>> This patch moves odp_sys_cpu_model_str() to cpu.h, all the calling
>>> functions will be updated in later separate patch.
>>>
>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>> ---
>>>   include/odp/api/cpu.h                    | 9 +++++++++
>>>   include/odp/api/system_info.h            | 7 -------
>>>   platform/linux-generic/odp_system_info.c | 2 +-
>>>   3 files changed, 10 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
>>> index c389093..78c3ffc 100644
>>> --- a/include/odp/api/cpu.h
>>> +++ b/include/odp/api/cpu.h
>>> @@ -44,6 +44,15 @@ int odp_cpu_id(void);
>>>   int odp_cpu_count(void);
>>>
>>>   /**
>>> + * CPU model name of this CPU
>>> + *
>>> + * Returns the CPU model name of this CPU.
>>> + *
>>> + * @return Pointer to CPU model name string
>>> + */
>>> +const char *odp_cpu_model_str(void);
>>> +
>>> +/**
>>>    * @}
>>>    */
>>>
>>> diff --git a/include/odp/api/system_info.h
>>> b/include/odp/api/system_info.h
>>> index e55ff6d..1cd883f 100644
>>> --- a/include/odp/api/system_info.h
>>> +++ b/include/odp/api/system_info.h
>>> @@ -45,13 +45,6 @@ uint64_t odp_sys_huge_page_size(void);
>>>   uint64_t odp_sys_page_size(void);
>>>
>>>   /**
>>> - * CPU model name
>>> - *
>>> - * @return Pointer to CPU model name string
>>> - */
>>> -const char *odp_sys_cpu_model_str(void);
>>> -
>>> -/**
>>>    * Cache line size in bytes
>>>    *
>>>    * @return CPU cache line size in bytes
>>> diff --git a/platform/linux-generic/odp_system_info.c
>>> b/platform/linux-generic/odp_system_info.c
>>> index 83226f8..ed6b515 100644
>>> --- a/platform/linux-generic/odp_system_info.c
>>> +++ b/platform/linux-generic/odp_system_info.c
>>> @@ -389,7 +389,7 @@ uint64_t odp_sys_page_size(void)
>>>         return odp_global_data.system_info.page_size;
>>>   }
>>>
>>> -const char *odp_sys_cpu_model_str(void)
>>> +const char *odp_cpu_model_str(void)
>>>   {
>>>         return odp_global_data.system_info.model_str[0];
>>>   }
>>>
>>
>> --
>> Regards,
>> Ivan Khoronzhuk
>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org │ Open source software for ARM SoCs
>
>
Hongbo Zhang Sept. 16, 2015, 9:56 a.m. UTC | #4
Ivan,
or did you mean another thing that, I changed api name in this patch,
but update all the calling functions in later separate patches, so
after applying this patch while the following patches are not applied,
there must be build error at this stage, but this has to happen for
convenience of patch review.


On 16 September 2015 at 17:48, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
> Ivan,
> Which kind of built error?
> In fact, when validation codes are enabled, there was already an build
> error exist in the test/validation/crypto code, this error isn't
> introduced by my patches, if you compile validation without my
> patches, you'll see this error again. I didn't spend time to research
> why, just simply disable the crypto codes in Mikefile.
> Another error may be default compiling treat warnings as errors, so I
> use this command to config:
> ./configure  --enable-test-vald  CFLAGS="-O0 -g -Wno-error"
>
> Are these the errors you met?
>
>
> On 15 September 2015 at 22:30, Mike Holmes <mike.holmes@linaro.org> wrote:
>>
>>
>> On 15 September 2015 at 10:18, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>> wrote:
>>>
>>> Hi, Hongbo
>>>
>>> Can it be built after this change? Should it be build-able at least?
>>
>>
>> All series should be build-able - if the check-odp  apply-and-build script
>> does not pass it cannot be committed.
>>
>>>
>>>
>>>
>>> On 15.09.15 16:55, hongbo.zhang@freescale.com wrote:
>>>>
>>>> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>>
>>>> This patch moves odp_sys_cpu_model_str() to cpu.h, all the calling
>>>> functions will be updated in later separate patch.
>>>>
>>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>> ---
>>>>   include/odp/api/cpu.h                    | 9 +++++++++
>>>>   include/odp/api/system_info.h            | 7 -------
>>>>   platform/linux-generic/odp_system_info.c | 2 +-
>>>>   3 files changed, 10 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
>>>> index c389093..78c3ffc 100644
>>>> --- a/include/odp/api/cpu.h
>>>> +++ b/include/odp/api/cpu.h
>>>> @@ -44,6 +44,15 @@ int odp_cpu_id(void);
>>>>   int odp_cpu_count(void);
>>>>
>>>>   /**
>>>> + * CPU model name of this CPU
>>>> + *
>>>> + * Returns the CPU model name of this CPU.
>>>> + *
>>>> + * @return Pointer to CPU model name string
>>>> + */
>>>> +const char *odp_cpu_model_str(void);
>>>> +
>>>> +/**
>>>>    * @}
>>>>    */
>>>>
>>>> diff --git a/include/odp/api/system_info.h
>>>> b/include/odp/api/system_info.h
>>>> index e55ff6d..1cd883f 100644
>>>> --- a/include/odp/api/system_info.h
>>>> +++ b/include/odp/api/system_info.h
>>>> @@ -45,13 +45,6 @@ uint64_t odp_sys_huge_page_size(void);
>>>>   uint64_t odp_sys_page_size(void);
>>>>
>>>>   /**
>>>> - * CPU model name
>>>> - *
>>>> - * @return Pointer to CPU model name string
>>>> - */
>>>> -const char *odp_sys_cpu_model_str(void);
>>>> -
>>>> -/**
>>>>    * Cache line size in bytes
>>>>    *
>>>>    * @return CPU cache line size in bytes
>>>> diff --git a/platform/linux-generic/odp_system_info.c
>>>> b/platform/linux-generic/odp_system_info.c
>>>> index 83226f8..ed6b515 100644
>>>> --- a/platform/linux-generic/odp_system_info.c
>>>> +++ b/platform/linux-generic/odp_system_info.c
>>>> @@ -389,7 +389,7 @@ uint64_t odp_sys_page_size(void)
>>>>         return odp_global_data.system_info.page_size;
>>>>   }
>>>>
>>>> -const char *odp_sys_cpu_model_str(void)
>>>> +const char *odp_cpu_model_str(void)
>>>>   {
>>>>         return odp_global_data.system_info.model_str[0];
>>>>   }
>>>>
>>>
>>> --
>>> Regards,
>>> Ivan Khoronzhuk
>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org │ Open source software for ARM SoCs
>>
>>
diff mbox

Patch

diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index c389093..78c3ffc 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -44,6 +44,15 @@  int odp_cpu_id(void);
 int odp_cpu_count(void);
 
 /**
+ * CPU model name of this CPU
+ *
+ * Returns the CPU model name of this CPU.
+ *
+ * @return Pointer to CPU model name string
+ */
+const char *odp_cpu_model_str(void);
+
+/**
  * @}
  */
 
diff --git a/include/odp/api/system_info.h b/include/odp/api/system_info.h
index e55ff6d..1cd883f 100644
--- a/include/odp/api/system_info.h
+++ b/include/odp/api/system_info.h
@@ -45,13 +45,6 @@  uint64_t odp_sys_huge_page_size(void);
 uint64_t odp_sys_page_size(void);
 
 /**
- * CPU model name
- *
- * @return Pointer to CPU model name string
- */
-const char *odp_sys_cpu_model_str(void);
-
-/**
  * Cache line size in bytes
  *
  * @return CPU cache line size in bytes
diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index 83226f8..ed6b515 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -389,7 +389,7 @@  uint64_t odp_sys_page_size(void)
 	return odp_global_data.system_info.page_size;
 }
 
-const char *odp_sys_cpu_model_str(void)
+const char *odp_cpu_model_str(void)
 {
 	return odp_global_data.system_info.model_str[0];
 }