From 59eed332a52ccf37dfb7ce288df68d3f4671e646 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 11 May 2010 12:59:56 -0700 Subject: [PATCH] sysdump: use Use where it makes sense. Signed-off-by: H. Peter Anvin --- com32/sysdump/cpuid.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/com32/sysdump/cpuid.c b/com32/sysdump/cpuid.c index ac80f22..372a70d 100644 --- a/com32/sysdump/cpuid.c +++ b/com32/sysdump/cpuid.c @@ -19,26 +19,6 @@ struct cpuid_info { struct cpuid_data data; }; -static bool has_eflag(uint32_t flag) -{ - uint32_t f0, f1; - - asm("pushfl ; " - "pushfl ; " - "popl %0 ; " - "movl %0,%1 ; " - "xorl %2,%1 ; " - "pushl %1 ; " - "popfl ; " - "pushfl ; " - "popl %1 ; " - "popfl" - : "=&r" (f0), "=&r" (f1) - : "ri" (flag)); - - return !!((f0^f1) & flag); -} - static void get_cpuid(uint32_t eax, uint32_t ecx, struct cpuid_data *data) { asm("pushl %%ebx ; cpuid ; movl %%ebx,%1 ; popl %%ebx" @@ -59,7 +39,7 @@ void dump_cpuid(struct backend *be) struct cpuid_data invalid_leaf; struct cpuid_data data; - if (!has_eflag(EFLAGS_ID)) + if (!cpu_has_eflag(EFLAGS_ID)) return; printf("Dumping CPUID... "); -- 2.7.4