diff mbox

[PATCHv3,2/2] linux-generic: drop odp_ prefix for internal cpuinfo

Message ID 1462971770-16409-3-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov May 11, 2016, 1:02 p.m. UTC
A little bit code clean up to drop odp_ prefix from internal things
and rename huge_pages to default_huge_pages internal struct.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/arch/default/odp_sysinfo_parse.c |  2 +-
 platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  |  2 +-
 platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c |  2 +-
 platform/linux-generic/arch/x86/odp_sysinfo_parse.c     |  2 +-
 platform/linux-generic/include/odp_internal.h           |  8 ++++----
 platform/linux-generic/odp_system_info.c                | 10 +++++-----
 6 files changed, 13 insertions(+), 13 deletions(-)

Comments

Bill Fischofer May 12, 2016, 8:21 p.m. UTC | #1
Compiling this on a 32-bit system I get:

  CC       odp_system_info.lo
odp_system_info.c: In function ‘default_huge_page_size’:
odp_system_info.c:86:19: error: format ‘%lu’ expects argument of type ‘long
unsigned int *’, but argument 3 has type ‘uint64_t * {aka long long
unsigned int *}’ [-Werror=format=]
   if (sscanf(str, "Hugepagesize: %8lu kB", &sz) == 1) {
                   ^
cc1: all warnings being treated as errors


On Wed, May 11, 2016 at 8:02 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> A little bit code clean up to drop odp_ prefix from internal things

> and rename huge_pages to default_huge_pages internal struct.

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

> ---

>  platform/linux-generic/arch/default/odp_sysinfo_parse.c |  2 +-

>  platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  |  2 +-

>  platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c |  2 +-

>  platform/linux-generic/arch/x86/odp_sysinfo_parse.c     |  2 +-

>  platform/linux-generic/include/odp_internal.h           |  8 ++++----

>  platform/linux-generic/odp_system_info.c                | 10 +++++-----

>  6 files changed, 13 insertions(+), 13 deletions(-)

>

> diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c

> b/platform/linux-generic/arch/default/odp_sysinfo_parse.c

> index 4dcd6d1..53e2aae 100644

> --- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c

> +++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c

> @@ -8,7 +8,7 @@

>  #include <odp_debug_internal.h>

>  #include <string.h>

>

> -int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t *sysinfo)

> +int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo)

>  {

>         int i;

>

> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> index d45b420..407264b 100644

> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> @@ -7,7 +7,7 @@

>  #include <odp_internal.h>

>  #include <string.h>

>

> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)

> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)

>  {

>         char str[1024];

>         char *pos;

> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> index 95200ee..3b88d55 100644

> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> @@ -7,7 +7,7 @@

>  #include <odp_internal.h>

>  #include <string.h>

>

> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)

> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)

>  {

>         char str[1024];

>         char *pos;

> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> index c1e05c0..96127ec 100644

> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> @@ -7,7 +7,7 @@

>  #include <odp_internal.h>

>  #include <string.h>

>

> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)

> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)

>  {

>         char str[1024];

>         char *pos;

> diff --git a/platform/linux-generic/include/odp_internal.h

> b/platform/linux-generic/include/odp_internal.h

> index 28a4fc4..19ab40a 100644

> --- a/platform/linux-generic/include/odp_internal.h

> +++ b/platform/linux-generic/include/odp_internal.h

> @@ -30,19 +30,19 @@ extern __thread int __odp_errno;

>

>  typedef struct {

>         uint64_t cpu_hz_max[MAX_CPU_NUMBER];

> -       uint64_t huge_page_size;

> +       uint64_t default_huge_page_size;

>         uint64_t page_size;

>         int      cache_line_size;

>         int      cpu_count;

>         char     cpu_arch_str[128];

>         char     model_str[MAX_CPU_NUMBER][128];

> -} odp_system_info_t;

> +} system_info_t;

>

>  struct odp_global_data_s {

>         pid_t main_pid;

>         odp_log_func_t log_fn;

>         odp_abort_func_t abort_fn;

> -       odp_system_info_t system_info;

> +       system_info_t system_info;

>         odp_cpumask_t control_cpus;

>         odp_cpumask_t worker_cpus;

>         int num_cpus_installed;

> @@ -126,7 +126,7 @@ int _odp_int_name_tbl_term_global(void);

>

>  void _odp_flush_caches(void);

>

> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo);

> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo);

>  uint64_t odp_cpu_hz_current(int id);

>

>  #ifdef __cplusplus

> diff --git a/platform/linux-generic/odp_system_info.c

> b/platform/linux-generic/odp_system_info.c

> index ff422f6..4801b7d 100644

> --- a/platform/linux-generic/odp_system_info.c

> +++ b/platform/linux-generic/odp_system_info.c

> @@ -98,7 +98,7 @@ static uint64_t default_huge_page_size(void)

>  /*

>   * Analysis of /sys/devices/system/cpu/ files

>   */

> -static int systemcpu(odp_system_info_t *sysinfo)

> +static int systemcpu(system_info_t *sysinfo)

>  {

>         int ret;

>

> @@ -124,7 +124,7 @@ static int systemcpu(odp_system_info_t *sysinfo)

>                 return -1;

>         }

>

> -       sysinfo->huge_page_size = default_huge_page_size();

> +       sysinfo->default_huge_page_size = default_huge_page_size();

>

>         return 0;

>  }

> @@ -137,7 +137,7 @@ int odp_system_info_init(void)

>  {

>         FILE  *file;

>

> -       memset(&odp_global_data.system_info, 0, sizeof(odp_system_info_t));

> +       memset(&odp_global_data.system_info, 0, sizeof(system_info_t));

>

>         odp_global_data.system_info.page_size = ODP_PAGE_SIZE;

>

> @@ -147,7 +147,7 @@ int odp_system_info_init(void)

>                 return -1;

>         }

>

> -       odp_cpuinfo_parser(file, &odp_global_data.system_info);

> +       cpuinfo_parser(file, &odp_global_data.system_info);

>

>         fclose(file);

>

> @@ -199,7 +199,7 @@ uint64_t odp_cpu_hz_max_id(int id)

>

>  uint64_t odp_sys_huge_page_size(void)

>  {

> -       return odp_global_data.system_info.huge_page_size;

> +       return odp_global_data.system_info.default_huge_page_size;

>  }

>

>  uint64_t odp_sys_page_size(void)

> --

> 2.7.1.250.gff4ea60

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>
Mike Holmes May 16, 2016, 3:49 p.m. UTC | #2
Bill,

Were you able to get the instructions / patch together to do a true 32bit
check in check-odp ?

If we are going to reject things that fail for 32bits we should describe
how to recreate the test if you only have a 64 bit system.

Mike

On 12 May 2016 at 16:21, Bill Fischofer <bill.fischofer@linaro.org> wrote:

> Compiling this on a 32-bit system I get:
>
>   CC       odp_system_info.lo
> odp_system_info.c: In function ‘default_huge_page_size’:
> odp_system_info.c:86:19: error: format ‘%lu’ expects argument of type
> ‘long unsigned int *’, but argument 3 has type ‘uint64_t * {aka long long
> unsigned int *}’ [-Werror=format=]
>    if (sscanf(str, "Hugepagesize: %8lu kB", &sz) == 1) {
>                    ^
> cc1: all warnings being treated as errors
>
>
> On Wed, May 11, 2016 at 8:02 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
> wrote:
>
>> A little bit code clean up to drop odp_ prefix from internal things
>> and rename huge_pages to default_huge_pages internal struct.
>>
>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>> ---
>>  platform/linux-generic/arch/default/odp_sysinfo_parse.c |  2 +-
>>  platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  |  2 +-
>>  platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c |  2 +-
>>  platform/linux-generic/arch/x86/odp_sysinfo_parse.c     |  2 +-
>>  platform/linux-generic/include/odp_internal.h           |  8 ++++----
>>  platform/linux-generic/odp_system_info.c                | 10 +++++-----
>>  6 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>> index 4dcd6d1..53e2aae 100644
>> --- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>> @@ -8,7 +8,7 @@
>>  #include <odp_debug_internal.h>
>>  #include <string.h>
>>
>> -int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t *sysinfo)
>> +int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo)
>>  {
>>         int i;
>>
>> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> index d45b420..407264b 100644
>> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> @@ -7,7 +7,7 @@
>>  #include <odp_internal.h>
>>  #include <string.h>
>>
>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
>>  {
>>         char str[1024];
>>         char *pos;
>> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> index 95200ee..3b88d55 100644
>> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> @@ -7,7 +7,7 @@
>>  #include <odp_internal.h>
>>  #include <string.h>
>>
>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
>>  {
>>         char str[1024];
>>         char *pos;
>> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> index c1e05c0..96127ec 100644
>> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> @@ -7,7 +7,7 @@
>>  #include <odp_internal.h>
>>  #include <string.h>
>>
>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
>>  {
>>         char str[1024];
>>         char *pos;
>> diff --git a/platform/linux-generic/include/odp_internal.h
>> b/platform/linux-generic/include/odp_internal.h
>> index 28a4fc4..19ab40a 100644
>> --- a/platform/linux-generic/include/odp_internal.h
>> +++ b/platform/linux-generic/include/odp_internal.h
>> @@ -30,19 +30,19 @@ extern __thread int __odp_errno;
>>
>>  typedef struct {
>>         uint64_t cpu_hz_max[MAX_CPU_NUMBER];
>> -       uint64_t huge_page_size;
>> +       uint64_t default_huge_page_size;
>>         uint64_t page_size;
>>         int      cache_line_size;
>>         int      cpu_count;
>>         char     cpu_arch_str[128];
>>         char     model_str[MAX_CPU_NUMBER][128];
>> -} odp_system_info_t;
>> +} system_info_t;
>>
>>  struct odp_global_data_s {
>>         pid_t main_pid;
>>         odp_log_func_t log_fn;
>>         odp_abort_func_t abort_fn;
>> -       odp_system_info_t system_info;
>> +       system_info_t system_info;
>>         odp_cpumask_t control_cpus;
>>         odp_cpumask_t worker_cpus;
>>         int num_cpus_installed;
>> @@ -126,7 +126,7 @@ int _odp_int_name_tbl_term_global(void);
>>
>>  void _odp_flush_caches(void);
>>
>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo);
>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo);
>>  uint64_t odp_cpu_hz_current(int id);
>>
>>  #ifdef __cplusplus
>> diff --git a/platform/linux-generic/odp_system_info.c
>> b/platform/linux-generic/odp_system_info.c
>> index ff422f6..4801b7d 100644
>> --- a/platform/linux-generic/odp_system_info.c
>> +++ b/platform/linux-generic/odp_system_info.c
>> @@ -98,7 +98,7 @@ static uint64_t default_huge_page_size(void)
>>  /*
>>   * Analysis of /sys/devices/system/cpu/ files
>>   */
>> -static int systemcpu(odp_system_info_t *sysinfo)
>> +static int systemcpu(system_info_t *sysinfo)
>>  {
>>         int ret;
>>
>> @@ -124,7 +124,7 @@ static int systemcpu(odp_system_info_t *sysinfo)
>>                 return -1;
>>         }
>>
>> -       sysinfo->huge_page_size = default_huge_page_size();
>> +       sysinfo->default_huge_page_size = default_huge_page_size();
>>
>>         return 0;
>>  }
>> @@ -137,7 +137,7 @@ int odp_system_info_init(void)
>>  {
>>         FILE  *file;
>>
>> -       memset(&odp_global_data.system_info, 0,
>> sizeof(odp_system_info_t));
>> +       memset(&odp_global_data.system_info, 0, sizeof(system_info_t));
>>
>>         odp_global_data.system_info.page_size = ODP_PAGE_SIZE;
>>
>> @@ -147,7 +147,7 @@ int odp_system_info_init(void)
>>                 return -1;
>>         }
>>
>> -       odp_cpuinfo_parser(file, &odp_global_data.system_info);
>> +       cpuinfo_parser(file, &odp_global_data.system_info);
>>
>>         fclose(file);
>>
>> @@ -199,7 +199,7 @@ uint64_t odp_cpu_hz_max_id(int id)
>>
>>  uint64_t odp_sys_huge_page_size(void)
>>  {
>> -       return odp_global_data.system_info.huge_page_size;
>> +       return odp_global_data.system_info.default_huge_page_size;
>>  }
>>
>>  uint64_t odp_sys_page_size(void)
>> --
>> 2.7.1.250.gff4ea60
>>
>> _______________________________________________
>> 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
>
>
Bill Fischofer May 16, 2016, 9:44 p.m. UTC | #3
I just did what Matias did and built myself a 32-bit Ubuntu VM to test
32-bit stuff with.  The -m32 compile option isn't quite the same and
obviously missed some cases.  I'm not sure how to incorporate that into
check-odp.

On Mon, May 16, 2016 at 10:49 AM, Mike Holmes <mike.holmes@linaro.org>
wrote:

> Bill,
>
> Were you able to get the instructions / patch together to do a true 32bit
> check in check-odp ?
>
> If we are going to reject things that fail for 32bits we should describe
> how to recreate the test if you only have a 64 bit system.
>
> Mike
>
> On 12 May 2016 at 16:21, Bill Fischofer <bill.fischofer@linaro.org> wrote:
>
>> Compiling this on a 32-bit system I get:
>>
>>   CC       odp_system_info.lo
>> odp_system_info.c: In function ‘default_huge_page_size’:
>> odp_system_info.c:86:19: error: format ‘%lu’ expects argument of type
>> ‘long unsigned int *’, but argument 3 has type ‘uint64_t * {aka long long
>> unsigned int *}’ [-Werror=format=]
>>    if (sscanf(str, "Hugepagesize: %8lu kB", &sz) == 1) {
>>                    ^
>> cc1: all warnings being treated as errors
>>
>>
>> On Wed, May 11, 2016 at 8:02 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
>> wrote:
>>
>>> A little bit code clean up to drop odp_ prefix from internal things
>>> and rename huge_pages to default_huge_pages internal struct.
>>>
>>> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>>> ---
>>>  platform/linux-generic/arch/default/odp_sysinfo_parse.c |  2 +-
>>>  platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  |  2 +-
>>>  platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c |  2 +-
>>>  platform/linux-generic/arch/x86/odp_sysinfo_parse.c     |  2 +-
>>>  platform/linux-generic/include/odp_internal.h           |  8 ++++----
>>>  platform/linux-generic/odp_system_info.c                | 10 +++++-----
>>>  6 files changed, 13 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>>> index 4dcd6d1..53e2aae 100644
>>> --- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
>>> @@ -8,7 +8,7 @@
>>>  #include <odp_debug_internal.h>
>>>  #include <string.h>
>>>
>>> -int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t
>>> *sysinfo)
>>> +int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo)
>>>  {
>>>         int i;
>>>
>>> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> index d45b420..407264b 100644
>>> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> @@ -7,7 +7,7 @@
>>>  #include <odp_internal.h>
>>>  #include <string.h>
>>>
>>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
>>>  {
>>>         char str[1024];
>>>         char *pos;
>>> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> index 95200ee..3b88d55 100644
>>> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> @@ -7,7 +7,7 @@
>>>  #include <odp_internal.h>
>>>  #include <string.h>
>>>
>>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
>>>  {
>>>         char str[1024];
>>>         char *pos;
>>> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> index c1e05c0..96127ec 100644
>>> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> @@ -7,7 +7,7 @@
>>>  #include <odp_internal.h>
>>>  #include <string.h>
>>>
>>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
>>>  {
>>>         char str[1024];
>>>         char *pos;
>>> diff --git a/platform/linux-generic/include/odp_internal.h
>>> b/platform/linux-generic/include/odp_internal.h
>>> index 28a4fc4..19ab40a 100644
>>> --- a/platform/linux-generic/include/odp_internal.h
>>> +++ b/platform/linux-generic/include/odp_internal.h
>>> @@ -30,19 +30,19 @@ extern __thread int __odp_errno;
>>>
>>>  typedef struct {
>>>         uint64_t cpu_hz_max[MAX_CPU_NUMBER];
>>> -       uint64_t huge_page_size;
>>> +       uint64_t default_huge_page_size;
>>>         uint64_t page_size;
>>>         int      cache_line_size;
>>>         int      cpu_count;
>>>         char     cpu_arch_str[128];
>>>         char     model_str[MAX_CPU_NUMBER][128];
>>> -} odp_system_info_t;
>>> +} system_info_t;
>>>
>>>  struct odp_global_data_s {
>>>         pid_t main_pid;
>>>         odp_log_func_t log_fn;
>>>         odp_abort_func_t abort_fn;
>>> -       odp_system_info_t system_info;
>>> +       system_info_t system_info;
>>>         odp_cpumask_t control_cpus;
>>>         odp_cpumask_t worker_cpus;
>>>         int num_cpus_installed;
>>> @@ -126,7 +126,7 @@ int _odp_int_name_tbl_term_global(void);
>>>
>>>  void _odp_flush_caches(void);
>>>
>>> -int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo);
>>> +int cpuinfo_parser(FILE *file, system_info_t *sysinfo);
>>>  uint64_t odp_cpu_hz_current(int id);
>>>
>>>  #ifdef __cplusplus
>>> diff --git a/platform/linux-generic/odp_system_info.c
>>> b/platform/linux-generic/odp_system_info.c
>>> index ff422f6..4801b7d 100644
>>> --- a/platform/linux-generic/odp_system_info.c
>>> +++ b/platform/linux-generic/odp_system_info.c
>>> @@ -98,7 +98,7 @@ static uint64_t default_huge_page_size(void)
>>>  /*
>>>   * Analysis of /sys/devices/system/cpu/ files
>>>   */
>>> -static int systemcpu(odp_system_info_t *sysinfo)
>>> +static int systemcpu(system_info_t *sysinfo)
>>>  {
>>>         int ret;
>>>
>>> @@ -124,7 +124,7 @@ static int systemcpu(odp_system_info_t *sysinfo)
>>>                 return -1;
>>>         }
>>>
>>> -       sysinfo->huge_page_size = default_huge_page_size();
>>> +       sysinfo->default_huge_page_size = default_huge_page_size();
>>>
>>>         return 0;
>>>  }
>>> @@ -137,7 +137,7 @@ int odp_system_info_init(void)
>>>  {
>>>         FILE  *file;
>>>
>>> -       memset(&odp_global_data.system_info, 0,
>>> sizeof(odp_system_info_t));
>>> +       memset(&odp_global_data.system_info, 0, sizeof(system_info_t));
>>>
>>>         odp_global_data.system_info.page_size = ODP_PAGE_SIZE;
>>>
>>> @@ -147,7 +147,7 @@ int odp_system_info_init(void)
>>>                 return -1;
>>>         }
>>>
>>> -       odp_cpuinfo_parser(file, &odp_global_data.system_info);
>>> +       cpuinfo_parser(file, &odp_global_data.system_info);
>>>
>>>         fclose(file);
>>>
>>> @@ -199,7 +199,7 @@ uint64_t odp_cpu_hz_max_id(int id)
>>>
>>>  uint64_t odp_sys_huge_page_size(void)
>>>  {
>>> -       return odp_global_data.system_info.huge_page_size;
>>> +       return odp_global_data.system_info.default_huge_page_size;
>>>  }
>>>
>>>  uint64_t odp_sys_page_size(void)
>>> --
>>> 2.7.1.250.gff4ea60
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
> "Work should be fun and collaborative, the rest follows"
>
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/arch/default/odp_sysinfo_parse.c b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
index 4dcd6d1..53e2aae 100644
--- a/platform/linux-generic/arch/default/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/default/odp_sysinfo_parse.c
@@ -8,7 +8,7 @@ 
 #include <odp_debug_internal.h>
 #include <string.h>
 
-int odp_cpuinfo_parser(FILE *file ODP_UNUSED, odp_system_info_t *sysinfo)
+int cpuinfo_parser(FILE *file ODP_UNUSED, system_info_t *sysinfo)
 {
 	int i;
 
diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
index d45b420..407264b 100644
--- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
@@ -7,7 +7,7 @@ 
 #include <odp_internal.h>
 #include <string.h>
 
-int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
+int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
 {
 	char str[1024];
 	char *pos;
diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
index 95200ee..3b88d55 100644
--- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
@@ -7,7 +7,7 @@ 
 #include <odp_internal.h>
 #include <string.h>
 
-int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
+int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
 {
 	char str[1024];
 	char *pos;
diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
index c1e05c0..96127ec 100644
--- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
@@ -7,7 +7,7 @@ 
 #include <odp_internal.h>
 #include <string.h>
 
-int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
+int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
 {
 	char str[1024];
 	char *pos;
diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h
index 28a4fc4..19ab40a 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -30,19 +30,19 @@  extern __thread int __odp_errno;
 
 typedef struct {
 	uint64_t cpu_hz_max[MAX_CPU_NUMBER];
-	uint64_t huge_page_size;
+	uint64_t default_huge_page_size;
 	uint64_t page_size;
 	int      cache_line_size;
 	int      cpu_count;
 	char     cpu_arch_str[128];
 	char     model_str[MAX_CPU_NUMBER][128];
-} odp_system_info_t;
+} system_info_t;
 
 struct odp_global_data_s {
 	pid_t main_pid;
 	odp_log_func_t log_fn;
 	odp_abort_func_t abort_fn;
-	odp_system_info_t system_info;
+	system_info_t system_info;
 	odp_cpumask_t control_cpus;
 	odp_cpumask_t worker_cpus;
 	int num_cpus_installed;
@@ -126,7 +126,7 @@  int _odp_int_name_tbl_term_global(void);
 
 void _odp_flush_caches(void);
 
-int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo);
+int cpuinfo_parser(FILE *file, system_info_t *sysinfo);
 uint64_t odp_cpu_hz_current(int id);
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index ff422f6..4801b7d 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -98,7 +98,7 @@  static uint64_t default_huge_page_size(void)
 /*
  * Analysis of /sys/devices/system/cpu/ files
  */
-static int systemcpu(odp_system_info_t *sysinfo)
+static int systemcpu(system_info_t *sysinfo)
 {
 	int ret;
 
@@ -124,7 +124,7 @@  static int systemcpu(odp_system_info_t *sysinfo)
 		return -1;
 	}
 
-	sysinfo->huge_page_size = default_huge_page_size();
+	sysinfo->default_huge_page_size = default_huge_page_size();
 
 	return 0;
 }
@@ -137,7 +137,7 @@  int odp_system_info_init(void)
 {
 	FILE  *file;
 
-	memset(&odp_global_data.system_info, 0, sizeof(odp_system_info_t));
+	memset(&odp_global_data.system_info, 0, sizeof(system_info_t));
 
 	odp_global_data.system_info.page_size = ODP_PAGE_SIZE;
 
@@ -147,7 +147,7 @@  int odp_system_info_init(void)
 		return -1;
 	}
 
-	odp_cpuinfo_parser(file, &odp_global_data.system_info);
+	cpuinfo_parser(file, &odp_global_data.system_info);
 
 	fclose(file);
 
@@ -199,7 +199,7 @@  uint64_t odp_cpu_hz_max_id(int id)
 
 uint64_t odp_sys_huge_page_size(void)
 {
-	return odp_global_data.system_info.huge_page_size;
+	return odp_global_data.system_info.default_huge_page_size;
 }
 
 uint64_t odp_sys_page_size(void)