Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Feb 2010 00:01:32 +0100 (CET)
From:      Alexander Best <alexbestms@wwu.de>
To:        Ed Schouten <ed@80386.nl>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: [patch] extending {amd64|i386} cpu info
Message-ID:  <permail-20100227230132f0889e8400005cd0-a_best01@message-id.uni-muenster.de>
In-Reply-To: <20100227223524.GU8200@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20100227230132f0889e8400005cd0-a_best01>