Fix several code review minor comments:

1.Line 1520, 1525, 1530:Use goto to save Release Lock
2.Line 224: Do not use DEBUG_ERROR, since it is not an error case
3.Scrub the DEBUG () print statement to add DEBUG_PAGE
4.Line 20: Typo of "help cooalese"


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5915 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2008-09-17 13:28:05 +00:00
parent 04b9f76313
commit d45fd26026
1 changed files with 13 additions and 12 deletions

View File

@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE) #define EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT (EFI_PAGE_SIZE)
// //
// Entry for tracking the memory regions for each memory type to help cooalese like memory types // Entry for tracking the memory regions for each memory type to coalesce similar memory types
// //
typedef struct { typedef struct {
EFI_PHYSICAL_ADDRESS BaseAddress; EFI_PHYSICAL_ADDRESS BaseAddress;
@ -221,7 +221,7 @@ PromoteMemoryResource (
LIST_ENTRY *Link; LIST_ENTRY *Link;
EFI_GCD_MAP_ENTRY *Entry; EFI_GCD_MAP_ENTRY *Entry;
DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "Promote the memory resource\n")); DEBUG ((DEBUG_PAGE, "Promote the memory resource\n"));
CoreAcquireGcdMemoryLock (); CoreAcquireGcdMemoryLock ();
@ -754,7 +754,7 @@ CoreConvertPages (
// Debug code - verify conversion is allowed // Debug code - verify conversion is allowed
// //
if (!(NewType == EfiConventionalMemory ? 1 : 0) ^ (Entry->Type == EfiConventionalMemory ? 1 : 0)) { if (!(NewType == EfiConventionalMemory ? 1 : 0) ^ (Entry->Type == EfiConventionalMemory ? 1 : 0)) {
DEBUG ((DEBUG_ERROR , "ConvertPages: Incompatible memory types\n")); DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "ConvertPages: Incompatible memory types\n"));
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
@ -1516,19 +1516,19 @@ CoreTerminateMemoryMap (
Entry = CR(Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE); Entry = CR(Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
if (Entry->Attribute & EFI_MEMORY_RUNTIME) { if (Entry->Attribute & EFI_MEMORY_RUNTIME) {
if (Entry->Type == EfiACPIReclaimMemory || Entry->Type == EfiACPIMemoryNVS) { if (Entry->Type == EfiACPIReclaimMemory || Entry->Type == EfiACPIMemoryNVS) {
DEBUG((DEBUG_ERROR, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n")); DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));
CoreReleaseMemoryLock (); Status = EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER; goto Done;
} }
if (Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) { if (Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {
DEBUG((DEBUG_ERROR, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n")); DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
CoreReleaseMemoryLock (); Status = EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER; goto Done;
} }
if ((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) { if ((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {
DEBUG((DEBUG_ERROR, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n")); DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
CoreReleaseMemoryLock (); Status = EFI_INVALID_PARAMETER;
return EFI_INVALID_PARAMETER; goto Done;
} }
} }
} }
@ -1544,6 +1544,7 @@ CoreTerminateMemoryMap (
Status = EFI_INVALID_PARAMETER; Status = EFI_INVALID_PARAMETER;
} }
Done:
CoreReleaseMemoryLock (); CoreReleaseMemoryLock ();
return Status; return Status;