cpuid/x86: avoid coercing cpuid params from int to unsigned

This commit is contained in:
Danny Robson 2019-04-15 10:35:12 +10:00
parent 70a16c7d47
commit f4ef1dc9a0

View File

@ -20,7 +20,7 @@ using cruft::cpu::x86;
///////////////////////////////////////////////////////////////////////////////
auto cpuid (int query, int param = 0)
auto cpuid (u32 query, u32 param = 0)
{
struct {
uint32_t a, b, c, d;
@ -64,9 +64,9 @@ x86::x86 ()
}
{
const auto product0 = cpuid (0x8000'0002);
const auto product1 = cpuid (0x8000'0003);
const auto product2 = cpuid (0x8000'0004);
const auto product0 = cpuid (0x8000'0002u);
const auto product1 = cpuid (0x8000'0003u);
const auto product2 = cpuid (0x8000'0004u);
memcpy (&product_name[0x00], &product0, sizeof (product0));
memcpy (&product_name[0x10], &product1, sizeof (product1));