[BOOTMGFW]

- Fix a bunch of bugs

svn path=/trunk/; revision=69149
This commit is contained in:
Alex Ionescu 2015-09-09 14:59:29 +00:00
parent 56e0c5f897
commit f3ff195d8f
3 changed files with 11 additions and 11 deletions

View file

@ -201,17 +201,17 @@ BlTblFindEntry (
) )
{ {
PVOID Entry = NULL; PVOID Entry = NULL;
ULONG Index = 0; ULONG Index;
BOOLEAN Result; BOOLEAN Result;
/* Check for invalid parameters */ /* Check for invalid parameters */
if (!(Table) || !(EntryIndex) || !(Count)) if (!(Table) || !(EntryIndex))
{ {
return Entry; return Entry;
} }
/* Loop each entry in the table */ /* Loop each entry in the table */
while (Index < Count) for (Index = 0; Index < Count; Index++)
{ {
/* Check if this entry is filled out */ /* Check if this entry is filled out */
if (Table[Index]) if (Table[Index])

View file

@ -751,7 +751,7 @@ MmMdFindSatisfyingRegion (
/* Bail out if the type doesn't match */ /* Bail out if the type doesn't match */
if (Descriptor->Type != MemoryType) if (Descriptor->Type != MemoryType)
{ {
//EarlyPrint(L"Incorrect descriptor type\r\n"); //EfiPrintf(L"Incorrect descriptor type: %lx %lx\r\n", Descriptor->Type, MemoryType);
return FALSE; return FALSE;
} }
@ -761,7 +761,7 @@ MmMdFindSatisfyingRegion (
NewDescriptor->Type = Descriptor->Type; NewDescriptor->Type = Descriptor->Type;
NewDescriptor->VirtualPage = VirtualPage; NewDescriptor->VirtualPage = VirtualPage;
NewDescriptor->Flags = Descriptor->Flags; NewDescriptor->Flags = Descriptor->Flags;
//EarlyPrint(L"Found a matching descriptor: %08I64X with %08I64X pages\r\n", BasePage, Pages); //EfiPrintf(L"Found a matching descriptor: %08I64X with %08I64X pages\r\n", BasePage, Pages);
return TRUE; return TRUE;
} }
@ -795,8 +795,8 @@ MmMdFreeGlobalDescriptors (
} }
/* Save the links */ /* Save the links */
OldFlink = OldDescriptor->ListEntry.Blink; OldBlink = OldDescriptor->ListEntry.Blink;
OldBlink = OldDescriptor->ListEntry.Flink; OldFlink = OldDescriptor->ListEntry.Flink;
/* Make the copy */ /* Make the copy */
*Descriptor = *OldDescriptor; *Descriptor = *OldDescriptor;

View file

@ -84,13 +84,13 @@ MmPapAllocateRegionFromMdl (
ListHead = CurrentList->First; ListHead = CurrentList->First;
if (Request->Type & BL_MM_REQUEST_TOP_DOWN_TYPE) if (Request->Type & BL_MM_REQUEST_TOP_DOWN_TYPE)
{ {
NextEntry = ListHead->Flink; NextEntry = ListHead->Blink;
TopDown = FALSE; TopDown = TRUE;
} }
else else
{ {
NextEntry = ListHead->Blink; NextEntry = ListHead->Flink;
TopDown = TRUE; TopDown = FALSE;
} }
/* Loop through the list */ /* Loop through the list */