From cfaaa463574ae6abe0a3a75e261722fe4ad53c7d Mon Sep 17 00:00:00 2001 From: Janne Peltonen Date: Thu, 22 Aug 2024 08:47:50 +0300 Subject: [PATCH] linux-gen: x86: sysinfo: fix cpu_isa_sw.x86 in 32-bit x86 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jere Leppänen --- platform/linux-generic/arch/x86/odp_sysinfo_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c index 5d4c47a4cb..c4bd2de454 100644 --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c @@ -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