svn commit: r198109 - projects/ppc64/sys/powerpc/powerpc
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Thu Oct 15 01:54:32 UTC 2009
Author: nwhitehorn
Date: Thu Oct 15 01:54:32 2009
New Revision: 198109
URL: http://svn.freebsd.org/changeset/base/198109
Log:
Fix CPU speed detection on PPC 970 for 64-bit machines. HID0 is a 64-bit
register, and truncating it to int unsets high bits like the external
timebase enable setting.
This only ever worked on 32-bit by accident, because GCC thought it was
always 32-bit and didn't feel like explicitly truncating it, so a fix
should be propagated back there eventually as well.
Modified:
projects/ppc64/sys/powerpc/powerpc/cpu.c
Modified: projects/ppc64/sys/powerpc/powerpc/cpu.c
==============================================================================
--- projects/ppc64/sys/powerpc/powerpc/cpu.c Thu Oct 15 01:50:50 2009 (r198108)
+++ projects/ppc64/sys/powerpc/powerpc/cpu.c Thu Oct 15 01:54:32 2009 (r198109)
@@ -122,8 +122,9 @@ static void cpu_print_cacheinfo(u_int, u
void
cpu_setup(u_int cpuid)
{
- u_int pvr, maj, min, hid0;
+ u_int pvr, maj, min;
uint16_t vers, rev, revfmt;
+ register_t hid0;
const struct cputab *cp;
const char *name;
char *bitmask;
@@ -289,7 +290,7 @@ cpu_setup(u_int cpuid)
break;
}
- printf("cpu%d: HID0 %b\n", cpuid, hid0, bitmask);
+ printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, bitmask);
}
void
More information about the svn-src-projects
mailing list