[patch] extending {amd64|i386} cpu info

Alexander Best alexbestms at wwu.de
Sat Feb 27 23:01:35 UTC 2010


hmm...i guess the person who added the CPUID_TO_* macros to
/usr/include/machine/specialreg.h thought a CPUID_TO_STEPPING macro wasn't
necessary since getting the stepping from cpu_id can be done fairly easy
without any shifting and such.

a CPUID_TO_STEPPING macro would look something like this:

#define CPUID_TO_STEPPING(id) \
    ((id) & CPUID_STEPPING)

getting the model and family however is more complicated since you have to
combine CPUID_{MODEL|FAMILY} and CPUID_EXT_{MODEL|FAMILY}.

cheers.
alex

Ed Schouten schrieb am 2010-02-27:
> Hello Alexander,

> * Alexander Best <alexbestms at wwu.de> wrote:
> > +             printf("  Stepping = %u"
> > +                    "  Model = %u"
> > +                    "  Family = %u",
> > +                    cpu_id & CPUID_STEPPING,
> > +                    CPUID_TO_MODEL(cpu_id),
> > +                    CPUID_TO_FAMILY(cpu_id));

> So is there some reason why we don't have a CPUID_TO_STEPPING()?

> Greetings,


More information about the freebsd-hackers mailing list