Skip to content

Commit

Permalink
linux-gen: x86: sysinfo: fix cpu_isa_sw.x86 in 32-bit x86
Browse files Browse the repository at this point in the history
The ODP_CPU_ARCH_X86_I686 value in odp_system_info_t::cpu_isa_sw.x86
indicates the IA32 ISA, but in the implementation the value is used
only when __i686 or __i686__ is defined. In many x86_32 systems this
causes sysinfo to return ODP_CPU_ARCH_X86_UNKNOWN in cpu_isa_sw.x86,
which in turn fails API validation test.

Fix the problem by recognizing IA32 ISA from the __i386 or __i386__ macro.

Signed-off-by: Janne Peltonen <[email protected]>
Reviewed-by: Jere Leppänen <[email protected]>
  • Loading branch information
JannePeltonen authored and MatiasElo committed Aug 26, 2024
1 parent d506c65 commit cfaaa46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/linux-generic/arch/x86/odp_sysinfo_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int _odp_cpuinfo_parser(FILE *file, system_info_t *sysinfo)

#if defined __x86_64 || defined __x86_64__
sysinfo->cpu_isa_sw.x86 = ODP_CPU_ARCH_X86_64;
#elif defined __i686 || defined __i686__
#elif defined __i386 || defined __i386__
sysinfo->cpu_isa_sw.x86 = ODP_CPU_ARCH_X86_I686;
#endif

Expand Down

0 comments on commit cfaaa46

Please sign in to comment.