IntelFsp2Pkg: Align #Pragma in UPD header files to rest of EDK2 Pkgs
[mirror_edk2.git] / IntelFsp2Pkg / Tools / GenCfgOpt.py
index e8cec95..654cdfc 100644 (file)
@@ -875,6 +875,9 @@ EndList
         IsArray = False\r
         if Length in [1,2,4,8]:\r
             Type = "UINT%d" % (Length * 8)\r
+            if Name.startswith("UnusedUpdSpace") and Length != 1:\r
+                IsArray = True\r
+                Type = "UINT8"\r
         else:\r
             IsArray = True\r
             Type = "UINT8"\r
@@ -1129,7 +1132,7 @@ EndList
             HeaderFd.write("#ifndef __%s__\n"   % FileName)\r
             HeaderFd.write("#define __%s__\n\n" % FileName)\r
             HeaderFd.write("#include <%s>\n\n" % HeaderFileName)\r
-            HeaderFd.write("#pragma pack(push, 1)\n\n")\r
+            HeaderFd.write("#pragma pack(1)\n\n")\r
 \r
             Export = False\r
             for Line in IncLines:\r
@@ -1177,7 +1180,7 @@ EndList
                 for Item in range(len(StructStart)):\r
                     if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]:\r
                         HeaderFd.write (Line)\r
-            HeaderFd.write("#pragma pack(pop)\n\n")\r
+            HeaderFd.write("#pragma pack()\n\n")\r
             HeaderFd.write("#endif\n")\r
             HeaderFd.close()\r
 \r
@@ -1188,7 +1191,7 @@ EndList
         HeaderFd.write("#ifndef __%s__\n"   % FileName)\r
         HeaderFd.write("#define __%s__\n\n" % FileName)\r
         HeaderFd.write("#include <FspEas.h>\n\n")\r
-        HeaderFd.write("#pragma pack(push, 1)\n\n")\r
+        HeaderFd.write("#pragma pack(1)\n\n")\r
 \r
         for item in range(len(UpdRegionCheck)):\r
             Index = 0\r
@@ -1222,7 +1225,7 @@ EndList
                 for Item in range(len(StructStart)):\r
                     if Index >= StructStartWithComment[Item] and Index <= StructEnd[Item]:\r
                         HeaderFd.write (Line)\r
-        HeaderFd.write("#pragma pack(pop)\n\n")\r
+        HeaderFd.write("#pragma pack()\n\n")\r
         HeaderFd.write("#endif\n")\r
         HeaderFd.close()\r
 \r