[syslinux:pathbased] sysdump: use <sys/cpu.h>

syslinux-bot for H. Peter Anvin hpa at zytor.com
Tue May 11 13:03:17 PDT 2010


Commit-ID:  59eed332a52ccf37dfb7ce288df68d3f4671e646
Gitweb:     http://syslinux.zytor.com/commit/59eed332a52ccf37dfb7ce288df68d3f4671e646
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Tue, 11 May 2010 12:59:56 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Tue, 11 May 2010 12:59:56 -0700

sysdump: use <sys/cpu.h>

Use <sys/cpu.h> where it makes sense.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 com32/sysdump/cpuid.c |   22 +---------------------
 1 files changed, 1 insertions(+), 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... ");



More information about the Syslinux-commits mailing list