]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: change the Division Operator
authorZhijux Fan <zhijux.fan@intel.com>
Fri, 7 Dec 2018 04:34:44 +0000 (12:34 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Fri, 1 Feb 2019 03:09:21 +0000 (11:09 +0800)
PEP 238 -- Changing the Division Operator
x/y to return a reasonable approximation of the mathematical result
    of the division ("true division")
x//y to return the floor ("floor division")

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
14 files changed:
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/AutoGen/GenC.py
BaseTools/Source/Python/BPDG/GenVpd.py
BaseTools/Source/Python/Common/Expression.py
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/GenFds/DataSection.py
BaseTools/Source/Python/GenFds/EfiSection.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/Fv.py
BaseTools/Source/Python/GenFds/FvImageSection.py
BaseTools/Source/Python/GenFds/GenFds.py
BaseTools/Source/Python/GenFds/Region.py
BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
BaseTools/Source/Python/build/build.py

index f9ce17cf77b480a0c98c89826709e143b0a22e20..5f0da5a81537e752fafb62d5606ec7bb6d65c784 100644 (file)
@@ -3814,7 +3814,7 @@ class ModuleAutoGen(AutoGen):
                         Padding = '0x00, '\r
                         if Unicode:\r
                             Padding = Padding * 2\r
-                            ArraySize = ArraySize / 2\r
+                            ArraySize = ArraySize // 2\r
                         if ArraySize < (len(PcdValue) + 1):\r
                             if Pcd.MaxSizeUserSet:\r
                                 EdkLogger.error("build", AUTOGEN_ERROR,\r
index 915ba2e235b09f23c6e8258ed39cc8c861aba020..e46942a3e2662be9ebf89b0d485283f9923f0425 100644 (file)
@@ -1053,7 +1053,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
                     else:\r
                         NewValue = NewValue + str(ord(Value[Index]) % 0x100) + ', '\r
                 if Unicode:\r
-                    ArraySize = ArraySize / 2\r
+                    ArraySize = ArraySize // 2\r
                 Value = NewValue + '0 }'\r
             if ArraySize < ValueSize:\r
                 if Pcd.MaxSizeUserSet:\r
@@ -1063,7 +1063,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):
                 else:\r
                     ArraySize = Pcd.GetPcdSize()\r
                     if Unicode:\r
-                        ArraySize = ArraySize / 2\r
+                        ArraySize = ArraySize // 2\r
             Array = '[%d]' % ArraySize\r
         #\r
         # skip casting for fixed at build since it breaks ARM assembly.\r
@@ -1906,7 +1906,7 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, TransParent):
         else:\r
             ImageBuffer = pack('B', EFI_HII_IIBT_IMAGE_1BIT)\r
         ImageBuffer += pack('B', PaletteIndex)\r
-        Width = (BmpHeader.biWidth + 7)/8\r
+        Width = (BmpHeader.biWidth + 7)//8\r
         if BmpHeader.bfOffBits > BMP_IMAGE_HEADER_STRUCT.size + 2:\r
             PaletteBuffer = Buffer[BMP_IMAGE_HEADER_STRUCT.size + 2 : BmpHeader.bfOffBits]\r
     elif BmpHeader.biBitCount == 4:\r
@@ -1915,7 +1915,7 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, TransParent):
         else:\r
             ImageBuffer = pack('B', EFI_HII_IIBT_IMAGE_4BIT)\r
         ImageBuffer += pack('B', PaletteIndex)\r
-        Width = (BmpHeader.biWidth + 1)/2\r
+        Width = (BmpHeader.biWidth + 1)//2\r
         if BmpHeader.bfOffBits > BMP_IMAGE_HEADER_STRUCT.size + 2:\r
             PaletteBuffer = Buffer[BMP_IMAGE_HEADER_STRUCT.size + 2 : BmpHeader.bfOffBits]\r
     elif BmpHeader.biBitCount == 8:\r
index 71fcfc5ac31b0eb4a8e3a7356d63c01afa33eff3..b4a2dd25a260bbe4e57d64ce8b490c5f3c6ed511 100644 (file)
@@ -431,7 +431,7 @@ class GenVPD :
                             EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, 'The offset value of PCD %s should be %s-byte aligned.' % (PCD.PcdCName, Alignment))\r
                 else:\r
                     if PCD.PcdOccupySize % Alignment != 0:\r
-                        PCD.PcdOccupySize = (PCD.PcdOccupySize / Alignment + 1) * Alignment\r
+                        PCD.PcdOccupySize = (PCD.PcdOccupySize // Alignment + 1) * Alignment\r
 \r
                 PackSize = PCD.PcdOccupySize\r
                 if PCD._IsBoolean(PCD.PcdValue, PCD.PcdSize):\r
@@ -509,7 +509,7 @@ class GenVPD :
             NowOffset = 0\r
             for Pcd in self.PcdUnknownOffsetList :\r
                 if NowOffset % Pcd.Alignment != 0:\r
-                    NowOffset = (NowOffset/ Pcd.Alignment + 1) * Pcd.Alignment\r
+                    NowOffset = (NowOffset// Pcd.Alignment + 1) * Pcd.Alignment\r
                 Pcd.PcdBinOffset = NowOffset\r
                 Pcd.PcdOffset    = str(hex(Pcd.PcdBinOffset))\r
                 NowOffset       += Pcd.PcdOccupySize\r
@@ -573,7 +573,7 @@ class GenVPD :
                         # Not been fixed\r
                         if eachUnfixedPcd.PcdOffset == TAB_STAR :\r
                             if LastOffset % eachUnfixedPcd.Alignment != 0:\r
-                                LastOffset = (LastOffset / eachUnfixedPcd.Alignment + 1) * eachUnfixedPcd.Alignment\r
+                                LastOffset = (LastOffset // eachUnfixedPcd.Alignment + 1) * eachUnfixedPcd.Alignment\r
                             # The offset un-fixed pcd can write into this free space\r
                             if needFixPcdSize <= (NowOffset - LastOffset) :\r
                                 # Change the offset value of un-fixed pcd\r
@@ -627,7 +627,7 @@ class GenVPD :
 \r
             NeedFixPcd.PcdBinOffset = LastPcd.PcdBinOffset + LastPcd.PcdOccupySize\r
             if NeedFixPcd.PcdBinOffset % NeedFixPcd.Alignment != 0:\r
-                NeedFixPcd.PcdBinOffset = (NeedFixPcd.PcdBinOffset / NeedFixPcd.Alignment + 1) * NeedFixPcd.Alignment\r
+                NeedFixPcd.PcdBinOffset = (NeedFixPcd.PcdBinOffset // NeedFixPcd.Alignment + 1) * NeedFixPcd.Alignment\r
 \r
             NeedFixPcd.PcdOffset    = str(hex(NeedFixPcd.PcdBinOffset))\r
 \r
index 19ea13b7fb2d63a920c274391e2f2947cfa57356..0c7e25b445a68424af248d6ec93ea09d0c275ca4 100644 (file)
@@ -439,6 +439,13 @@ class ValueExpression(BaseExpression):
                 else:\r
                     Val = Val3\r
                 continue\r
+            #\r
+            # PEP 238 -- Changing the Division Operator\r
+            # x/y to return a reasonable approximation of the mathematical result of the division ("true division")\r
+            # x//y to return the floor ("floor division")\r
+            #\r
+            if Op == '/':\r
+                Op = '//'\r
             try:\r
                 Val = self.Eval(Op, Val, EvalFunc())\r
             except WrnExpression as Warn:\r
@@ -912,7 +919,7 @@ class ValueExpressionEx(ValueExpression):
                         if TmpValue.bit_length() == 0:\r
                             PcdValue = '{0x00}'\r
                         else:\r
-                            for I in range((TmpValue.bit_length() + 7) / 8):\r
+                            for I in range((TmpValue.bit_length() + 7) // 8):\r
                                 TmpList.append('0x%02x' % ((TmpValue >> I * 8) & 0xff))\r
                             PcdValue = '{' + ', '.join(TmpList) + '}'\r
                     except:\r
index d23a075f4354ad81a1dc14ff896ead17349aebff..bd7c2812e89f939ab3e36b0a38d5a7289a8ac0a4 100644 (file)
@@ -1025,7 +1025,7 @@ def ParseFieldValue (Value):
     if "{CODE(" in Value:\r
         return Value, len(Value.split(","))\r
     if isinstance(Value, type(0)):\r
-        return Value, (Value.bit_length() + 7) / 8\r
+        return Value, (Value.bit_length() + 7) // 8\r
     if not isinstance(Value, type('')):\r
         raise BadExpression('Type %s is %s' %(Value, type(Value)))\r
     Value = Value.strip()\r
@@ -1146,12 +1146,12 @@ def ParseFieldValue (Value):
             raise BadExpression("invalid hex value: %s" % Value)\r
         if Value == 0:\r
             return 0, 1\r
-        return Value, (Value.bit_length() + 7) / 8\r
+        return Value, (Value.bit_length() + 7) // 8\r
     if Value[0].isdigit():\r
         Value = int(Value, 10)\r
         if Value == 0:\r
             return 0, 1\r
-        return Value, (Value.bit_length() + 7) / 8\r
+        return Value, (Value.bit_length() + 7) // 8\r
     if Value.lower() == 'true':\r
         return 1, 1\r
     if Value.lower() == 'false':\r
index 28f9b931ca4b5b75f1c6e3c5b8768b0034dae2b0..989e33c43fff56234a60b5ad80c019f58454de42 100644 (file)
@@ -88,9 +88,9 @@ class DataSection (DataSectionClassObject):
             if ImageObj.SectionAlignment < 0x400:\r
                 self.Alignment = str (ImageObj.SectionAlignment)\r
             elif ImageObj.SectionAlignment < 0x100000:\r
-                self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+                self.Alignment = str (ImageObj.SectionAlignment // 0x400) + 'K'\r
             else:\r
-                self.Alignment = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r
+                self.Alignment = str (ImageObj.SectionAlignment // 0x100000) + 'M'\r
 \r
         NoStrip = True\r
         if self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):\r
index 0be176ec8ae19129511a8053508dcd0030cf663b..dfb2470874e66fe1838ef31d416066fd07c16692 100644 (file)
@@ -248,9 +248,9 @@ class EfiSection (EfiSectionClassObject):
                         if ImageObj.SectionAlignment < 0x400:\r
                             Align = str (ImageObj.SectionAlignment)\r
                         elif ImageObj.SectionAlignment < 0x100000:\r
-                            Align = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+                            Align = str (ImageObj.SectionAlignment // 0x400) + 'K'\r
                         else:\r
-                            Align = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r
+                            Align = str (ImageObj.SectionAlignment // 0x100000) + 'M'\r
 \r
                     if File[(len(File)-4):] == '.efi':\r
                         MapFile = File.replace('.efi', '.map')\r
index 4dda3cf787e13980537f377d90abbe2dd37f9bb0..a7298a6daf848d3307fdf83b857bac40396a055b 100644 (file)
@@ -772,9 +772,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
                     if ImageObj.SectionAlignment < 0x400:\r
                         self.Alignment = str (ImageObj.SectionAlignment)\r
                     elif ImageObj.SectionAlignment < 0x100000:\r
-                        self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+                        self.Alignment = str (ImageObj.SectionAlignment // 0x400) + 'K'\r
                     else:\r
-                        self.Alignment = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r
+                        self.Alignment = str (ImageObj.SectionAlignment // 0x100000) + 'M'\r
 \r
                 if not NoStrip:\r
                     FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
@@ -814,9 +814,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 if ImageObj.SectionAlignment < 0x400:\r
                     self.Alignment = str (ImageObj.SectionAlignment)\r
                 elif ImageObj.SectionAlignment < 0x100000:\r
-                    self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+                    self.Alignment = str (ImageObj.SectionAlignment // 0x400) + 'K'\r
                 else:\r
-                    self.Alignment = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r
+                    self.Alignment = str (ImageObj.SectionAlignment // 0x100000) + 'M'\r
 \r
             if not NoStrip:\r
                 FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
index bd5c2593481a1129d74001d1f3c96a8fa65bad93..b141d44dc48f7d898b0e20811d91d6fd23b47377 100644 (file)
@@ -222,9 +222,9 @@ class FV (object):
                             #The max alignment supported by FFS is 16M.\r
                                 self.FvAlignment = "16M"\r
                             else:\r
-                                self.FvAlignment = str(FvAlignmentValue / 0x100000) + "M"\r
+                                self.FvAlignment = str(FvAlignmentValue // 0x100000) + "M"\r
                         else:\r
-                            self.FvAlignment = str(FvAlignmentValue / 0x400) + "K"\r
+                            self.FvAlignment = str(FvAlignmentValue // 0x400) + "K"\r
                     else:\r
                         # FvAlignmentValue is less than 1K\r
                         self.FvAlignment = str (FvAlignmentValue)\r
index 7f277ddef242e9e760f29b71e9592f5465ea0528..535b86ab5ea902d5b8be51208957fd10b9529f52 100644 (file)
@@ -71,7 +71,7 @@ class FvImageSection(FvImageSectionClassObject):
                     # PI FvHeader is 0x48 byte\r
                     FvHeaderBuffer = FvFileObj.read(0x48)\r
                     # FV alignment position.\r
-                    FvAlignmentValue = 1 << (ord (FvHeaderBuffer[0x2E]) & 0x1F)\r
+                    FvAlignmentValue = 1 << (FvHeaderBuffer[0x2E] & 0x1F)\r
                     FvFileObj.close()\r
                 if FvAlignmentValue > MaxFvAlignment:\r
                     MaxFvAlignment = FvAlignmentValue\r
@@ -87,9 +87,9 @@ class FvImageSection(FvImageSectionClassObject):
                     if MaxFvAlignment >= 0x1000000:\r
                         self.Alignment = "16M"\r
                     else:\r
-                        self.Alignment = str(MaxFvAlignment / 0x100000) + "M"\r
+                        self.Alignment = str(MaxFvAlignment // 0x100000) + "M"\r
                 else:\r
-                    self.Alignment = str (MaxFvAlignment / 0x400) + "K"\r
+                    self.Alignment = str (MaxFvAlignment // 0x400) + "K"\r
             else:\r
                 # MaxFvAlignment is less than 1K\r
                 self.Alignment = str (MaxFvAlignment)\r
@@ -129,9 +129,9 @@ class FvImageSection(FvImageSectionClassObject):
                                 if FvAlignmentValue >= 0x1000000:\r
                                     self.Alignment = "16M"\r
                                 else:\r
-                                    self.Alignment = str(FvAlignmentValue / 0x100000) + "M"\r
+                                    self.Alignment = str(FvAlignmentValue // 0x100000) + "M"\r
                             else:\r
-                                self.Alignment = str (FvAlignmentValue / 0x400) + "K"\r
+                                self.Alignment = str (FvAlignmentValue // 0x400) + "K"\r
                         else:\r
                             # FvAlignmentValue is less than 1K\r
                             self.Alignment = str (FvAlignmentValue)\r
index f1ce527f88540c270a47cbd1c612513a58379dea..2efb2edd9ab1d9fda2f931379cb09832b0e7f376 100644 (file)
@@ -751,7 +751,7 @@ class GenFds(object):
                                     F.read()\r
                                     length = F.tell()\r
                                     F.seek(4)\r
-                                    TmpStr = unpack('%dh' % ((length - 4) / 2), F.read())\r
+                                    TmpStr = unpack('%dh' % ((length - 4) // 2), F.read())\r
                                     Name = ''.join(chr(c) for c in TmpStr[:-1])\r
                         else:\r
                             FileList = []\r
index acc9dea41349111d1d7e220c4ae4bd5a7455bdd5..83363276d2c40a255e0337c702542c0a80cf37d2 100644 (file)
@@ -300,7 +300,7 @@ class Region(object):
             else:\r
                 # region ended within current blocks\r
                 if self.Offset + self.Size <= End:\r
-                    ExpectedList.append((BlockSize, (RemindingSize + BlockSize - 1) / BlockSize))\r
+                    ExpectedList.append((BlockSize, (RemindingSize + BlockSize - 1) // BlockSize))\r
                     break\r
                 # region not ended yet\r
                 else:\r
@@ -309,7 +309,7 @@ class Region(object):
                         UsedBlockNum = BlockNum\r
                     # region started in middle of current blocks\r
                     else:\r
-                        UsedBlockNum = (End - self.Offset) / BlockSize\r
+                        UsedBlockNum = (End - self.Offset) // BlockSize\r
                     Start = End\r
                     ExpectedList.append((BlockSize, UsedBlockNum))\r
                     RemindingSize -= BlockSize * UsedBlockNum\r
index 8e243aea9603f474193eaea0192c1a3b07dc4575..0be5eba492e54a07993d1d9d0e57a3ab587075ae 100644 (file)
@@ -133,7 +133,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
         #\r
         for Index in range(ValueLength):\r
             ByteList[ValueOffset + Index] = ValueNumber % 0x100\r
-            ValueNumber = ValueNumber / 0x100\r
+            ValueNumber = ValueNumber // 0x100\r
     elif TypeName == TAB_VOID:\r
         ValueString = SavedStr\r
         if ValueString.startswith('L"'):\r
@@ -148,7 +148,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
                 if Index + 2 >= ValueLength:\r
                     break\r
                 #\r
-                # Set string value one by one\r
+                # Set string value one by one/ 0x100\r
                 #\r
                 ByteList[ValueOffset + Index] = ord(ByteString)\r
                 Index = Index + 2\r
index 94074b89b47df416a641bde5a8d4197b1e5d6f9d..139a1dfe2983fa2ff037689e3279bab012a54dab 100644 (file)
@@ -664,7 +664,7 @@ class PeImageInfo():
         self.OutputDir        = OutputDir\r
         self.DebugDir         = DebugDir\r
         self.Image            = ImageClass\r
-        self.Image.Size       = (self.Image.Size / 0x1000 + 1) * 0x1000\r
+        self.Image.Size       = (self.Image.Size // 0x1000 + 1) * 0x1000\r
 \r
 ## The class implementing the EDK2 build process\r
 #\r
@@ -1582,21 +1582,21 @@ class Build():
             for PcdInfo in PcdTable:\r
                 ReturnValue = 0\r
                 if PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE:\r
-                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, str (PeiSize / 0x1000))\r
+                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, str (PeiSize // 0x1000))\r
                 elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE:\r
-                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, str (BtSize / 0x1000))\r
+                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, str (BtSize // 0x1000))\r
                 elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE:\r
-                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE, str (RtSize / 0x1000))\r
+                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE, str (RtSize // 0x1000))\r
                 elif PcdInfo[0] == TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE and len (SmmModuleList) > 0:\r
-                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str (SmmSize / 0x1000))\r
+                    ReturnValue, ErrorInfo = PatchBinaryFile (EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str (SmmSize // 0x1000))\r
                 if ReturnValue != 0:\r
                     EdkLogger.error("build", PARAMETER_INVALID, "Patch PCD value failed", ExtraData=ErrorInfo)\r
 \r
-        MapBuffer.write('PEI_CODE_PAGE_NUMBER      = 0x%x\n' % (PeiSize / 0x1000))\r
-        MapBuffer.write('BOOT_CODE_PAGE_NUMBER     = 0x%x\n' % (BtSize / 0x1000))\r
-        MapBuffer.write('RUNTIME_CODE_PAGE_NUMBER  = 0x%x\n' % (RtSize / 0x1000))\r
+        MapBuffer.write('PEI_CODE_PAGE_NUMBER      = 0x%x\n' % (PeiSize // 0x1000))\r
+        MapBuffer.write('BOOT_CODE_PAGE_NUMBER     = 0x%x\n' % (BtSize // 0x1000))\r
+        MapBuffer.write('RUNTIME_CODE_PAGE_NUMBER  = 0x%x\n' % (RtSize // 0x1000))\r
         if len (SmmModuleList) > 0:\r
-            MapBuffer.write('SMM_CODE_PAGE_NUMBER      = 0x%x\n' % (SmmSize / 0x1000))\r
+            MapBuffer.write('SMM_CODE_PAGE_NUMBER      = 0x%x\n' % (SmmSize // 0x1000))\r
 \r
         PeiBaseAddr = TopMemoryAddress - RtSize - BtSize\r
         BtBaseAddr  = TopMemoryAddress - RtSize\r