Skip to content

Commit

Permalink
phfirmware fix byte ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Jan 11, 2025
1 parent b46e154 commit 6060ef5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions phlib/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ typedef union _HV_PARTITION_PRIVILEGE_MASK
UINT64 Reserved9 : 10;
};

UINT32 High;
UINT32 Low;
UINT32 LowPart;
UINT32 HighPart;
} HV_PARTITION_PRIVILEGE_MASK, *PHV_PARTITION_PRIVILEGE_MASK;

#if defined(_M_IX86) || defined(_M_AMD64)
Expand All @@ -78,8 +78,8 @@ typedef union _PH_CPUID

struct
{
ULONG64 High;
ULONG64 Low;
ULONG64 LowPart;
ULONG64 HighPart;
};

INT32 Data[4];
Expand All @@ -91,8 +91,8 @@ VOID PhCpuId(
_In_ ULONG SubFunction
)
{
CpuId->High = 0;
CpuId->Low = 0;
CpuId->LowPart = 0;
CpuId->HighPart = 0;
CpuIdEx(CpuId->Data, Function, SubFunction);
}

Expand Down Expand Up @@ -167,8 +167,8 @@ VOID PhGetHvPartitionPrivilegeMask(
// https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/feature-discovery#hypervisor-feature-identification---0x40000003
PhCpuId(&cpuid, 0x40000003, 0);

Mask->Low = cpuid.EAX;
Mask->High = cpuid.EBX;
Mask->LowPart = cpuid.EAX;
Mask->HighPart = cpuid.EBX;
}
#endif

Expand Down

0 comments on commit 6060ef5

Please sign in to comment.