X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFsp2Pkg%2FTools%2FGenCfgOpt.py;h=c9b7bc5373fb77c3ac46cba54489f2a31f90dfbc;hp=d8038e98ce9e0f354f9aec114ccbdecb7ecf392b;hb=37431eb1fedbfbfd3b471d5f599aa90c77d97099;hpb=e4408576df907721e87a2b439087a54790dcad46
diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py
index d8038e98ce..c9b7bc5373 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -1,6 +1,6 @@
## @ GenCfgOpt.py
#
-# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
@@ -289,7 +289,6 @@ class CGenCfgOpt:
def __init__(self):
self.Debug = False
self.Error = ''
- self.ReleaseMode = True
self._GlobalDataDef = """
GlobalDataDef
@@ -318,13 +317,6 @@ EndList
self._FvDir = ''
self._MapVer = 0
- def ParseBuildMode (self, OutputStr):
- if "RELEASE_" in OutputStr:
- self.ReleaseMode = True
- if "DEBUG_" in OutputStr:
- self.ReleaseMode = False
- return
-
def ParseMacros (self, MacroDefStr):
# ['-DABC=1', '-D', 'CFG_DEBUG=1', '-D', 'CFG_OUTDIR=Build']
self._MacroDict = {}
@@ -815,9 +807,6 @@ EndList
TxtFd.write("%s.UnusedUpdSpace%d|%s0x%04X|0x%04X|{0}\n" % (Item['space'], SpaceIdx, Default, NextOffset - StartAddr, Offset - NextOffset))
SpaceIdx = SpaceIdx + 1
NextOffset = Offset + Item['length']
- if Item['cname'] == 'PcdSerialIoUartDebugEnable':
- if self.ReleaseMode == False:
- Item['value'] = 0x01
TxtFd.write("%s.%s|%s0x%04X|%s|%s\n" % (Item['space'],Item['cname'],Default,Item['offset'] - StartAddr,Item['length'],Item['value']))
TxtFd.close()
return 0
@@ -1239,6 +1228,7 @@ EndList
return 0
def WriteBsfStruct (self, BsfFd, Item):
+ LogExpr = CLogicalExpression()
if Item['type'] == "None":
Space = "gPlatformFspPkgTokenSpaceGuid"
else:
@@ -1260,6 +1250,9 @@ EndList
for Option in OptList:
Option = Option.strip()
(OpVal, OpStr) = Option.split(':')
+ test = LogExpr.getNumber (OpVal)
+ if test is None:
+ raise Exception("Selection Index '%s' is not a number" % OpVal)
TmpList.append((OpVal, OpStr))
return TmpList
@@ -1433,7 +1426,6 @@ def Main():
print "ERROR: Macro parsing failed !"
return 3
- GenCfgOpt.ParseBuildMode(sys.argv[3])
FvDir = sys.argv[3]
if not os.path.exists(FvDir):
os.makedirs(FvDir)