Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
John Baldwin schrieb am 2010-03-11: > On Thursday 11 March 2010 12:01:28 pm Alexander Best wrote: > > thanks for the commit. :) > > a few thoughts: > > 1) why does stepping remain to be printed in dec while family and > >model are in > > hex? is this the way amd/intel cpu docs refer to > > stepping/model/family? > I just left it the way it was. > > 2) the hex value for "Id" and "(AMD) Features(2)" gets printed with > >an "0x" > > prepended to indicate it's in hex. maybe this should also be the > > case here. > Because on a typical Intel system you overflow 80 cols if you do > that. :( > Otherwise I would have. We could maybe add an 'h' suffix as that is > what > the manuals and it would only add 2 chars rather than 4. ah i see. not an easy decision. i wouldn't use the 'h' suffix, because there should be only one way of relating to a hex value and i believe the overall convention in freebsd is '0x'.so better keep it the way it is. maybe using %X instead of %x in the printfs makes the output look a bit nicer, but that's just eyecandy. ;) cheers. alex ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
On Thursday 11 March 2010 12:01:28 pm Alexander Best wrote: > thanks for the commit. :) > > a few thoughts: > > 1) why does stepping remain to be printed in dec while family and model are in > hex? is this the way amd/intel cpu docs refer to stepping/model/family? I just left it the way it was. > 2) the hex value for "Id" and "(AMD) Features(2)" gets printed with an "0x" > prepended to indicate it's in hex. maybe this should also be the case here. Because on a typical Intel system you overflow 80 cols if you do that. :( Otherwise I would have. We could maybe add an 'h' suffix as that is what the manuals and it would only add 2 chars rather than 4. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
On Thursday 11 March 2010 12:01:28 pm Alexander Best wrote: > thanks for the commit. :) > > a few thoughts: > > 1) why does stepping remain to be printed in dec while family and model are in > hex? is this the way amd/intel cpu docs refer to stepping/model/family? > 2) the hex value for "Id" and "(AMD) Features(2)" gets printed with an "0x" > prepended to indicate it's in hex. maybe this should also be the case here. > > cheers. > alex > -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
thanks for the commit. :) a few thoughts: 1) why does stepping remain to be printed in dec while family and model are in hex? is this the way amd/intel cpu docs refer to stepping/model/family? 2) the hex value for "Id" and "(AMD) Features(2)" gets printed with an "0x" prepended to indicate it's in hex. maybe this should also be the case here. cheers. alex ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
Author: jhb Date: Thu Mar 11 14:17:37 2010 New Revision: 205013 URL: http://svn.freebsd.org/changeset/base/205013 Log: Print out the family and model from the cpu_id. This is especially useful given the advent of the extended family and extended model fields. The values are printed in hex to match their common usage in documentation. Submitted by: Alexander Best MFC after:1 week Modified: head/sys/amd64/amd64/identcpu.c head/sys/i386/i386/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c == --- head/sys/amd64/amd64/identcpu.c Thu Mar 11 13:16:06 2010 (r205012) +++ head/sys/amd64/amd64/identcpu.c Thu Mar 11 14:17:37 2010 (r205013) @@ -187,7 +187,9 @@ printcpuinfo(void) if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { - printf(" Stepping = %u", cpu_id & 0xf); + printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_high > 0) { /* Modified: head/sys/i386/i386/identcpu.c == --- head/sys/i386/i386/identcpu.c Thu Mar 11 13:16:06 2010 (r205012) +++ head/sys/i386/i386/identcpu.c Thu Mar 11 14:17:37 2010 (r205013) @@ -672,9 +672,11 @@ printcpuinfo(void) cpu_vendor_id == CPU_VENDOR_NSC || (cpu_vendor_id == CPU_VENDOR_CYRIX && ((cpu_id & 0xf00) > 0x500))) { - printf(" Stepping = %u", cpu_id & 0xf); + printf(" Family = %x", CPUID_TO_FAMILY(cpu_id)); + printf(" Model = %x", CPUID_TO_MODEL(cpu_id)); + printf(" Stepping = %u", cpu_id & CPUID_STEPPING); if (cpu_vendor_id == CPU_VENDOR_CYRIX) - printf(" DIR=0x%04x", cyrix_did); + printf("\n DIR=0x%04x", cyrix_did); if (cpu_high > 0) { /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"