Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 2009 01:54:32 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r198109 - projects/ppc64/sys/powerpc/powerpc
Message-ID:  <200910150154.n9F1sWOT055283@svn.freebsd.org>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910150154.n9F1sWOT055283>