\r
Depex - Dependency Expresion.\r
\r
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials are licensed and made available \r
under the terms and conditions of the BSD License which accompanies this \r
distribution. The full text of the license may be found at \r
EFI_DEVICE_PATH_PROTOCOL *HandleFilePath;\r
EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;\r
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;\r
+ UINT64 Tick;\r
+\r
+ Tick = 0;\r
+ PERF_CODE (\r
+ Tick = GetPerformanceCounter ();\r
+ );\r
\r
Buffer = NULL;\r
Size = 0;\r
\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
return Status;\r
}\r
Status = PeCoffLoaderGetImageInfo (&ImageContext);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
return Status;\r
}\r
//\r
// allocate the memory to load the SMM driver\r
//\r
- PageCount = (UINTN)EFI_SIZE_TO_PAGES(ImageContext.ImageSize + ImageContext.SectionAlignment);\r
+ PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);\r
DstBuffer = (UINTN)(-1);\r
\r
Status = SmmAllocatePages (\r
);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
} \r
return Status;\r
} \r
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)DstBuffer;\r
}\r
} else {\r
- PageCount = (UINTN)EFI_SIZE_TO_PAGES(ImageContext.ImageSize + ImageContext.SectionAlignment);\r
+ PageCount = (UINTN)EFI_SIZE_TO_PAGES((UINTN)ImageContext.ImageSize + ImageContext.SectionAlignment);\r
DstBuffer = (UINTN)(-1);\r
\r
Status = SmmAllocatePages (\r
);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
return Status;\r
}\r
Status = PeCoffLoaderLoadImage (&ImageContext);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
SmmFreePages (DstBuffer, PageCount);\r
return Status;\r
Status = PeCoffLoaderRelocateImage (&ImageContext);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
SmmFreePages (DstBuffer, PageCount);\r
return Status;\r
Status = gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_LOADED_IMAGE_PROTOCOL), (VOID **)&DriverEntry->LoadedImage);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
SmmFreePages (DstBuffer, PageCount);\r
return Status;\r
Status = gBS->AllocatePool (EfiBootServicesData, GetDevicePathSize (FilePath), (VOID **)&DriverEntry->LoadedImage->FilePath);\r
if (EFI_ERROR (Status)) {\r
if (Buffer != NULL) {\r
- Status = gBS->FreePool (Buffer);\r
+ gBS->FreePool (Buffer);\r
}\r
SmmFreePages (DstBuffer, PageCount);\r
return Status;\r
NULL\r
);\r
\r
+ PERF_START (DriverEntry->ImageHandle, "LoadImage:", NULL, Tick);\r
+ PERF_END (DriverEntry->ImageHandle, "LoadImage:", NULL, 0);\r
+\r
//\r
// Print the load address and the PDB file name if it is available\r
//\r
//\r
// For each SMM driver, pass NULL as ImageHandle\r
//\r
+ PERF_START (DriverEntry->ImageHandle, "StartImage:", NULL, 0);\r
Status = ((EFI_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPoint)(DriverEntry->ImageHandle, gST);\r
+ PERF_END (DriverEntry->ImageHandle, "StartImage:", NULL, 0);\r
if (EFI_ERROR(Status)){\r
SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage);\r
}\r