- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
- \r
- Status = EFI_NOT_FOUND;\r
- \r
- if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_CNT_CODE) == 0) {\r
- //\r
- // Build tool will save the address in PointerToRelocations & PointerToLineNumbers fields in the first section header \r
- // that doesn't point to code section in image header.So there is an assumption that when the feature is enabled,\r
- // if a module with a loading address assigned by tools, the PointerToRelocations & PointerToLineNumbers fields\r
- // should not be Zero, or else, these 2 fileds should be set to Zero\r
- //\r
- ValueInSectionHeader = ReadUnaligned64((UINT64*)&SectionHeader.PointerToRelocations);\r
- if (ValueInSectionHeader != 0) {\r
- //\r
- // Found first section header that doesn't point to code section in which uild tool saves the\r
- // offset to SMRAM base as image base in PointerToRelocations & PointerToLineNumbers fields\r
- // \r
- FixLoaddingAddress = (EFI_PHYSICAL_ADDRESS)(gLoadModuleAtFixAddressSmramBase + (INT64)ValueInSectionHeader);\r
- //\r
- // Check if the memory range is avaliable.\r
- //\r
- Status = CheckAndMarkFixLoadingMemoryUsageBitMap (FixLoaddingAddress, (UINTN)(ImageContext->ImageSize + ImageContext->SectionAlignment));\r
- if (!EFI_ERROR(Status)) {\r
- //\r
- // The assigned address is valid. Return the specified loadding address\r
- //\r
- ImageContext->ImageAddress = FixLoaddingAddress;\r
- }\r
- }\r
- break; \r
- }\r
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER); \r
- }\r
- DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address %x, Status = %r\n", FixLoaddingAddress, Status));\r
- return Status;\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ Status = EFI_NOT_FOUND;\r
+\r
+ if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_CNT_CODE) == 0) {\r
+ //\r
+ // Build tool will save the address in PointerToRelocations & PointerToLineNumbers fields in the first section header\r
+ // that doesn't point to code section in image header.So there is an assumption that when the feature is enabled,\r
+ // if a module with a loading address assigned by tools, the PointerToRelocations & PointerToLineNumbers fields\r
+ // should not be Zero, or else, these 2 fields should be set to Zero\r
+ //\r
+ ValueInSectionHeader = ReadUnaligned64((UINT64*)&SectionHeader.PointerToRelocations);\r
+ if (ValueInSectionHeader != 0) {\r
+ //\r
+ // Found first section header that doesn't point to code section in which build tool saves the\r
+ // offset to SMRAM base as image base in PointerToRelocations & PointerToLineNumbers fields\r
+ //\r
+ FixLoadingAddress = (EFI_PHYSICAL_ADDRESS)(gLoadModuleAtFixAddressSmramBase + (INT64)ValueInSectionHeader);\r
+ //\r
+ // Check if the memory range is available.\r
+ //\r
+ Status = CheckAndMarkFixLoadingMemoryUsageBitMap (FixLoadingAddress, (UINTN)(ImageContext->ImageSize + ImageContext->SectionAlignment));\r
+ if (!EFI_ERROR(Status)) {\r
+ //\r
+ // The assigned address is valid. Return the specified loading address\r
+ //\r
+ ImageContext->ImageAddress = FixLoadingAddress;\r
+ }\r
+ }\r
+ break;\r
+ }\r
+ SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);\r
+ }\r
+ DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address %x, Status = %r\n", FixLoadingAddress, Status));\r
+ return Status;\r