BaseTools: extend FFS alignment to 16M
Current FFS only supports 64KiB alignment for data, Per PI 1.6
requirement, we extend FFS alignment to 16M.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
(cherry picked from commit e921f58d44
)
This commit is contained in:
@ -2763,7 +2763,8 @@ class FdfParser:
|
||||
while True:
|
||||
AlignValue = None
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
#For FFS, Auto is default option same to ""
|
||||
if not self.__Token == "Auto":
|
||||
@ -2822,7 +2823,8 @@ class FdfParser:
|
||||
FfsFileObj.CheckSum = True
|
||||
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
#For FFS, Auto is default option same to ""
|
||||
if not self.__Token == "Auto":
|
||||
@ -2893,7 +2895,8 @@ class FdfParser:
|
||||
|
||||
AlignValue = None
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
AlignValue = self.__Token
|
||||
|
||||
@ -3182,7 +3185,8 @@ class FdfParser:
|
||||
|
||||
AlignValue = None
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
AlignValue = self.__Token
|
||||
|
||||
@ -3773,7 +3777,8 @@ class FdfParser:
|
||||
|
||||
AlignValue = ""
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
#For FFS, Auto is default option same to ""
|
||||
if not self.__Token == "Auto":
|
||||
@ -3822,7 +3827,8 @@ class FdfParser:
|
||||
|
||||
SectAlignment = ""
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
|
||||
raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
|
||||
@ -3901,7 +3907,8 @@ class FdfParser:
|
||||
FvImageSectionObj.FvFileType = self.__Token
|
||||
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
FvImageSectionObj.Alignment = self.__Token
|
||||
|
||||
@ -3968,7 +3975,8 @@ class FdfParser:
|
||||
EfiSectionObj.BuildNum = self.__Token
|
||||
|
||||
if self.__GetAlignment():
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"):
|
||||
if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K", "128K",
|
||||
"256K", "512K", "1M", "2M", "4M", "8M", "16M"):
|
||||
raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber)
|
||||
if self.__Token == 'Auto' and (not SectionName == 'PE32') and (not SectionName == 'TE'):
|
||||
raise Warning("Auto alignment can only be used in PE32 or TE section ", self.FileName, self.CurrentLineNumber)
|
||||
|
Reference in New Issue
Block a user