summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arch-x86-common.h17
-rw-r--r--crc/crc32c-intel.c2
2 files changed, 6 insertions, 13 deletions
diff --git a/arch/arch-x86-common.h b/arch/arch-x86-common.h
index 1e623544..d533d22d 100644
--- a/arch/arch-x86-common.h
+++ b/arch/arch-x86-common.h
@@ -4,24 +4,17 @@
static inline void do_cpuid(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
- unsigned int id = *eax;
-
- asm("movl %4, %%eax;"
- "cpuid;"
- "movl %%eax, %0;"
- "movl %%ebx, %1;"
- "movl %%ecx, %2;"
- "movl %%edx, %3;"
- : "=r" (*eax), "=r" (*ebx), "=r" (*ecx), "=r" (*edx)
- : "r" (id)
- : "eax", "ebx", "ecx", "edx");
+ asm volatile("cpuid"
+ : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+ : "0" (*eax), "2" (*ecx)
+ : "memory");
}
#define ARCH_HAVE_INIT
extern int tsc_reliable;
static inline int arch_init(char *envp[])
{
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx, ecx = 0, edx;
/*
* Check for TSC
diff --git a/crc/crc32c-intel.c b/crc/crc32c-intel.c
index 8e1cd587..0b0f193c 100644
--- a/crc/crc32c-intel.c
+++ b/crc/crc32c-intel.c
@@ -81,7 +81,7 @@ uint32_t crc32c_intel(unsigned char const *data, unsigned long length)
void crc32c_intel_probe(void)
{
if (!crc32c_probed) {
- unsigned int eax, ebx, ecx, edx;
+ unsigned int eax, ebx, ecx = 0, edx;
eax = 1;