svn commit: r332868 - in head/sys/powerpc: include powerpc

Justin Hibbits jhibbits at FreeBSD.org
Sun Apr 22 03:58:06 UTC 2018


Author: jhibbits
Date: Sun Apr 22 03:58:04 2018
New Revision: 332868
URL: https://svnweb.freebsd.org/changeset/base/332868

Log:
  Fix the build post r332859
  
  sysentvec::sv_hwcap/sv_hwcap2 are pointers to  u_long, so cpu_features* need
  to be u_long to use the pointers.  This also requires a temporary cast in
  printing the bitfields, which is fine because the feature flag fields are
  only 32 bits anyway.

Modified:
  head/sys/powerpc/include/cpu.h
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/include/cpu.h
==============================================================================
--- head/sys/powerpc/include/cpu.h	Sun Apr 22 02:40:21 2018	(r332867)
+++ head/sys/powerpc/include/cpu.h	Sun Apr 22 03:58:04 2018	(r332868)
@@ -49,8 +49,8 @@
  * sysctl.
  */
 
-extern int cpu_features;
-extern int cpu_features2;
+extern u_long cpu_features;
+extern u_long cpu_features2;
 
 #define	PPC_FEATURE_32		0x80000000	/* Always true */
 #define	PPC_FEATURE_64		0x40000000	/* Defined on a 64-bit CPU */

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Sun Apr 22 02:40:21 2018	(r332867)
+++ head/sys/powerpc/powerpc/cpu.c	Sun Apr 22 03:58:04 2018	(r332868)
@@ -231,12 +231,12 @@ static int	cpu_feature_bit(SYSCTL_HANDLER_ARGS);
 static char model[64];
 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, "");
 
-int cpu_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU;
-int cpu_features2 = 0;
+u_long cpu_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU;
+u_long cpu_features2 = 0;
 SYSCTL_OPAQUE(_hw, OID_AUTO, cpu_features, CTLFLAG_RD,
-    &cpu_features, sizeof(cpu_features), "IX", "PowerPC CPU features");
+    &cpu_features, sizeof(cpu_features), "LX", "PowerPC CPU features");
 SYSCTL_OPAQUE(_hw, OID_AUTO, cpu_features2, CTLFLAG_RD,
-    &cpu_features2, sizeof(cpu_features2), "IX", "PowerPC CPU features 2");
+    &cpu_features2, sizeof(cpu_features2), "LX", "PowerPC CPU features 2");
 
 /* Provide some user-friendly aliases for bits in cpu_features */
 SYSCTL_PROC(_hw, OID_AUTO, floatingpoint, CTLTYPE_INT | CTLFLAG_RD,
@@ -307,10 +307,10 @@ cpu_setup(u_int cpuid)
 
 	cpu_features |= cp->features;
 	cpu_features2 |= cp->features2;
-	printf("cpu%d: Features %b\n", cpuid, cpu_features,
+	printf("cpu%d: Features %b\n", cpuid, (int)cpu_features,
 	    PPC_FEATURE_BITMASK);
 	if (cpu_features2 != 0)
-		printf("cpu%d: Features2 %b\n", cpuid, cpu_features2,
+		printf("cpu%d: Features2 %b\n", cpuid, (int)cpu_features2,
 		    PPC_FEATURE2_BITMASK);
 
 	/*


More information about the svn-src-all mailing list