X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FFv.py;h=45f6696a5fd74a8be1c42b41dc3063996705ae2e;hp=4b03adc1c83a88063c4e3b11af0cf6d8af30b96c;hb=9425b34925d0cf1b96aaf2c316d3299df9780252;hpb=c46bced224b42d5a03bc8b207167829aa4e7bc5b diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py index 4b03adc1c8..45f6696a5f 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -51,6 +51,7 @@ class FV (FvClassObject): self.FvBaseAddress = None self.FvForceRebase = None self.FvRegionInFD = None + self.UsedSizeEnable = False ## AddToBuffer() # @@ -307,6 +308,10 @@ class FV (FvClassObject): T_CHAR_LF) if not (self.FvAttributeDict == None): for FvAttribute in self.FvAttributeDict.keys() : + if FvAttribute == "FvUsedSizeEnable": + if self.FvAttributeDict[FvAttribute].upper() in ('TRUE', '1') : + self.UsedSizeEnable = True + continue self.FvInfFile.writelines("EFI_" + \ FvAttribute + \ ' = ' + \ @@ -322,12 +327,22 @@ class FV (FvClassObject): # Generate FV extension header file # if self.FvNameGuid == None or self.FvNameGuid == '': - if len(self.FvExtEntryType) > 0: + if len(self.FvExtEntryType) > 0 or self.UsedSizeEnable: GenFdsGlobalVariable.ErrorLogger("FV Extension Header Entries declared for %s with no FvNameGuid declaration." % (self.UiFvName)) if self.FvNameGuid <> None and self.FvNameGuid <> '': TotalSize = 16 + 4 Buffer = '' + if self.UsedSizeEnable: + TotalSize += (4 + 4) + ## define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03 + #typedef struct + # { + # EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; + # UINT32 UsedSize; + # } EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE; + Buffer += pack('HHL', 8, 3, 0) + if self.FvNameString == 'TRUE': # # Create EXT entry for FV UI name