aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h')
-rw-r--r--drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
index fe9598c941a6..57dd93e0cc83 100644
--- a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
+++ b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
@@ -19,16 +19,14 @@ __unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
unsigned long reg_ecx)
{
unsigned long result = 0;
-
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
+
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
- if (cpuid_ecx & 0x80000000) {
- __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
- "a"(tuple), "b"(reg_ebx), "c"(reg_ecx)
- );
- } else {
- result = -1;
- }
+ if (!(cpuid_ecx & 0x80000000))
+ return -1;
+
+ __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
+ "a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
return result;
}
@@ -39,15 +37,13 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple,
unsigned long long reg_edx)
{
unsigned long result = 0;
-
unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
+
cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
- if (cpuid_ecx & 0x80000000) {
- __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
- "a"(tuple), "b"(reg_ebx), "c"(reg_ecx),
- "d"(reg_edx));
- } else {
- result = -1;
- }
+ if (!(cpuid_ecx & 0x80000000))
+ return -1;
+
+ __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
+ "a"(tuple), "b"(reg_ebx), "c"(reg_ecx), "d"(reg_edx));
return result;
- }
+}