+ if (FvHeader->Signature == EFI_FVH_SIGNATURE) { \r
+ //\r
+ // Adjust Fv Base Address Alignment based on Align Attributes in Fv Header\r
+ //\r
+ \r
+ //\r
+ // When FvImage support Alignment, we need to check whether \r
+ // its alignment is correct. \r
+ //\r
+ if (FvHeader->Attributes | EFI_FVB_ALIGNMENT_CAP) {\r
+ \r
+ //\r
+ // Calculate the mini alignment for this FvImage\r
+ //\r
+ FvAlignment = 1 << (LowBitSet32 (FvHeader->Attributes >> 16) + 1);\r
+ \r
+ //\r
+ // If current FvImage base address doesn't meet the its alignment,\r
+ // we need to reload this FvImage to another correct memory address.\r
+ //\r
+ if (((UINTN) FvHeader % FvAlignment) != 0) {\r
+ DstBuffer = AllocateAlignedPages (EFI_SIZE_TO_PAGES ((UINTN) FvHeader->FvLength), FvAlignment);\r
+ if (DstBuffer == NULL) {\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
+ CopyMem (DstBuffer, FvHeader, (UINTN) FvHeader->FvLength);\r
+ FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) DstBuffer; \r
+ }\r