1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17static inline unsigned long
18__unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
19 unsigned long reg_ecx)
20{
21 unsigned long result = 0;
22
23 unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
24 cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
25 if (cpuid_ecx & 0x80000000) {
26 __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
27 "a"(tuple), "b"(reg_ebx), "c"(reg_ecx)
28 );
29 } else {
30 result = -1;
31 }
32 return result;
33}
34
35static inline unsigned long
36__unisys_extended_vmcall_gnuc(unsigned long long tuple,
37 unsigned long long reg_ebx,
38 unsigned long long reg_ecx,
39 unsigned long long reg_edx)
40{
41 unsigned long result = 0;
42
43 unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
44 cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
45 if (cpuid_ecx & 0x80000000) {
46 __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
47 "a"(tuple), "b"(reg_ebx), "c"(reg_ecx),
48 "d"(reg_edx));
49 } else {
50 result = -1;
51 }
52 return result;
53 }
54