{\r
PHYSICAL_ADDRESS PhysicalAddress4K;\r
UINTN IndexOfPageTableEntries;\r
- PAGE_TABLE_4K_ENTRY *PageTableEntry, *PageTableEntry1;\r
+ PAGE_TABLE_4K_ENTRY *PageTableEntry;\r
+ PAGE_TABLE_4K_ENTRY *PageTableEntry1;\r
UINT64 AddressEncMask;\r
\r
PageTableEntry = AllocatePageTableMemory(1);\r
/**\r
Set or Clear the memory encryption bit\r
\r
- @param[in] PagetablePoint Page table entry pointer (PTE).\r
+ @param[in, out] PageTablePointer Page table entry pointer (PTE).\r
@param[in] Mode Set or Clear encryption bit\r
\r
**/\r
@retval RETURN_UNSUPPORTED Setting the memory encyrption attribute\r
is not supported\r
**/\r
-\r
STATIC\r
RETURN_STATUS\r
EFIAPI\r
\r
Status = EFI_SUCCESS;\r
\r
- while (Length)\r
+ while (Length != 0)\r
{\r
//\r
// If Cr3BaseAddress is not specified then read the current CR3\r
// Valid 1GB page\r
// If we have at least 1GB to go, we can just update this entry\r
//\r
- if (!(PhysicalAddress & (BIT30 - 1)) && Length >= BIT30) {\r
+ if ((PhysicalAddress & (BIT30 - 1)) == 0 && Length >= BIT30) {\r
SetOrClearCBit(&PageDirectory1GEntry->Uint64, Mode);\r
DEBUG ((\r
DEBUG_VERBOSE,\r
// Valid 2MB page\r
// If we have at least 2MB left to go, we can just update this entry\r
//\r
- if (!(PhysicalAddress & (BIT21-1)) && Length >= BIT21) {\r
+ if ((PhysicalAddress & (BIT21-1)) == 0 && Length >= BIT21) {\r
SetOrClearCBit (&PageDirectory2MEntry->Uint64, Mode);\r
PhysicalAddress += BIT21;\r
Length -= BIT21;\r