Skip to content

Commit

Permalink
cpuid is in a,b,c,d order
Browse files Browse the repository at this point in the history
and not a,b,d,c as read on wikipedia

Signed-off-by: Jorgen Lundman <[email protected]>
  • Loading branch information
lundman committed Mar 15, 2024
1 parent 55f9718 commit 63f438a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions module/os/windows/spl/spl-processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ spl_cpuid_features(void)

if (first_time == 1) {
first_time = 0;
// Wikipedia: stored in EAX, EBX, EDX, ECX (in that order).
_spl_cpuid(0, a, b, d, c);

_spl_cpuid(0, a, b, c, d);
if (a >= 1) {
_spl_cpuid(1, a, b, d, c);
_spl_cpuid(1, a, b, c, d);
_spl_cpuid_features = d | (c << 32);

// GETBV is bit 26 in ECX. Apple defines it as:
Expand All @@ -101,7 +101,7 @@ spl_cpuid_features(void)
}
if (a >= 7) {
c = 0;
_spl_cpuid(7, a, b, d, c);
_spl_cpuid(7, a, b, c, d);
_spl_cpuid_features_leaf7 = b | (c << 32);
}
xprintf("SPL: CPUID 0x%08llx and leaf7 0x%08llx\n",
Expand Down

0 comments on commit 63f438a

Please sign in to comment.