powerpc: change mfpvr return type to uint32_t

As the Processor Version Register (PVR) is a 32-bit PowerPC
register, change mfpvr() return type to match it and avoid
type casts on its callers.

Suggested by:		jhibbits
Reviewed by:		jhibbits, imp
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D31332
This commit is contained in:
Leandro Lupori 2021-07-28 14:03:53 -03:00
parent 7045b1603b
commit 7844e5a4fc
2 changed files with 3 additions and 3 deletions

View File

@ -604,7 +604,7 @@ pmc_md_initialize()
}
/* Set the value for kern.hwpmc.cpuid */
snprintf(pmc_cpuid, sizeof(pmc_cpuid), "%08jx", (uintmax_t)mfpvr());
snprintf(pmc_cpuid, sizeof(pmc_cpuid), "%08x", mfpvr());
return (pmc_mdep);
}

View File

@ -125,10 +125,10 @@ mfdec(void)
return (value);
}
static __inline register_t
static __inline uint32_t
mfpvr(void)
{
register_t value;
uint32_t value;
__asm __volatile ("mfpvr %0" : "=r"(value));