+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx,
+ int *edx)
+{
+ asm volatile(""::"c"(count));
+ vmi_cpuid(op, eax, ebx, ecx, edx);
+}
You can't assume those last two statements will stay together.
>From the gcc 4.0.2 info file:
<...> you can't expect a sequence of volatile `asm' instructions
to remain perfectly consecutive. If you want consecutive output, use a
single `asm'.
Maybe you could make vmi_cpuid always take a 'count' param, then just make cpuid
do:
vmi_cpuid(op, 0, eax, ebx, ecx, edx);
and cpuid_count do:
vmi_cpuid(op, count, eax, ebx, ecx, edx);
(And sorry about trimming the cc: but I'm reading from a digest and that list
is too long to enter manually.)