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.
This commit is contained in:
Justin Hibbits 2018-04-22 03:58:04 +00:00
parent 4e16c227ac
commit 38c32a140b
2 changed files with 8 additions and 8 deletions

View File

@ -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 */

View File

@ -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);
/*