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 <alexbes...@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,
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to