From b4acef1ffe2e1ba6c608f31c1954a8100d3eabb0 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 12 Aug 2014 17:02:51 -0700 Subject: Replace cpuid asm statement with __cpuid_count The compiler doesn't know that the cpuid asm statement in intel_check_word will trash RBX. We are lucky that it doesn't cause any problems since RBX is also used by compiler for other purposes so that RBX is saved and restored. This patch replaces it with __cpuid_count. [BZ #17259] * sysdeps/x86_64/cacheinfo.c (intel_check_word): Replace cpuid asm statement with __cpuid_count. --- sysdeps/x86_64/cacheinfo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86_64/cacheinfo.c index 163af2acbc..ca13a53f25 100644 --- a/sysdeps/x86_64/cacheinfo.c +++ b/sysdeps/x86_64/cacheinfo.c @@ -191,9 +191,7 @@ intel_check_word (int name, unsigned int value, bool *has_level_2, unsigned int round = 0; while (1) { - asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" - : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) - : "0" (4), "2" (round)); + __cpuid_count (4, round, eax, ebx, ecx, edx); enum { null = 0, data = 1, inst = 2, uni = 3 } type = eax & 0x1f; if (type == null) -- cgit v1.2.3