Revision: 17416
          http://sourceforge.net/p/edk2/code/17416
Author:   bobfeng
Date:     2015-05-12 00:58:20 +0000 (Tue, 12 May 2015)
Log Message:
-----------
BaseTools/Build: The PCD value in uninitialized data range should be natural 
aligned.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Bob Feng" <[email protected]>
Reviewed-by: "Liu, Yingke D" <[email protected]>
Tested-by: Ard Biesheuvel <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/AutoGen/GenPcdDb.py

Modified: trunk/edk2/BaseTools/Source/Python/AutoGen/GenPcdDb.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/AutoGen/GenPcdDb.py      2015-05-11 
17:53:20 UTC (rev 17415)
+++ trunk/edk2/BaseTools/Source/Python/AutoGen/GenPcdDb.py      2015-05-12 
00:58:20 UTC (rev 17416)
@@ -836,6 +836,9 @@
                 DbOffset += DbItemTotal[DbIndex].GetInterOffset(Offset)
                 break
             DbOffset += DbItemTotal[DbIndex].GetListSize()
+            if DbIndex + 1 == InitTableNum:
+                if DbOffset % 8:
+                    DbOffset += (8 - DbOffset % 8)
         else:
             assert(False)
 
@@ -867,6 +870,9 @@
                     DbOffset += 
DbItemTotal[DbIndex].GetInterOffset(VariableOffset)
                     break
                 DbOffset += DbItemTotal[DbIndex].GetListSize()
+                if DbIndex + 1 == InitTableNum:
+                    if DbOffset % 8:
+                        DbOffset += (8 - DbOffset % 8)
             else:
                 assert(False)
             if isinstance(VariableRefTable[0],list):
@@ -908,6 +914,8 @@
     for Item in (DbUnInitValueUint64, DbUnInitValueUint32, 
DbUnInitValueUint16, DbUnInitValueUint8, DbUnInitValueBoolean):
         UninitDataBaseSize += Item.GetListSize()
     
+    if (DbTotalLength - UninitDataBaseSize) % 8:
+        DbTotalLength += (8 - (DbTotalLength - UninitDataBaseSize) % 8)
     # Construct the database buffer
     Guid = "{0x3c7d193c, 0x682c, 0x4c14, 0xa6, 0x8f, 0x55, 0x2d, 0xea, 0x4f, 
0x43, 0x7e}"
     Guid = StringArrayToList(Guid)
@@ -977,6 +985,10 @@
         b = Item.PackData()
         Buffer += b  
         if Index == InitTableNum:
+            if len(Buffer) % 8:
+                for num in range(8 - len(Buffer) % 8):
+                    b = pack('=B', Pad)
+                    Buffer += b
             break        
     return Buffer
 


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to