summaryrefslogtreecommitdiffstats
path: root/IntelFspPkg/Tools/GenCfgOpt.py
diff options
context:
space:
mode:
authorMudusuru, Giri P <giri.p.mudusuru@intel.com>2015-05-01 23:09:53 +0000
committerjyao1 <jyao1@Edk2>2015-05-01 23:09:53 +0000
commit61267952828f81166a4ec0b4f9144799e95f7f3b (patch)
tree6c858d0823745a068f6c7cf34f810a70faf88fbd /IntelFspPkg/Tools/GenCfgOpt.py
parent12a92f51f0efaa0c4f7abdaf869984ae1c65f430 (diff)
downloadedk2-61267952828f81166a4ec0b4f9144799e95f7f3b.tar.gz
edk2-61267952828f81166a4ec0b4f9144799e95f7f3b.tar.bz2
edk2-61267952828f81166a4ec0b4f9144799e95f7f3b.zip
enhancement to tool to generate the comments along with offsets in the .h file.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Mudusuru, Giri P" <giri.p.mudusuru@intel.com> Reviewed-by: "Yao, Jiewen" <Jiewen.Yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17282 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFspPkg/Tools/GenCfgOpt.py')
-rw-r--r--IntelFspPkg/Tools/GenCfgOpt.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/IntelFspPkg/Tools/GenCfgOpt.py b/IntelFspPkg/Tools/GenCfgOpt.py
index 6b850f6601..caeb175b5b 100644
--- a/IntelFspPkg/Tools/GenCfgOpt.py
+++ b/IntelFspPkg/Tools/GenCfgOpt.py
@@ -774,9 +774,10 @@ EndList
TxtFd.close()
return 0
- def CreateField (self, Item, Name, Length, Offset, Struct):
+ def CreateField (self, Item, Name, Length, Offset, Struct, Help):
PosName = 28
PosComment = 30
+ HelpLine=''
IsArray = False
if Length in [1,2,4,8]:
@@ -810,8 +811,10 @@ EndList
Space2 = PosComment - len(Name)
else:
Space2 = 1
+ if Help != '':
+ HelpLine=" %s \n" % Help
- return " %s%s%s;%s/* Offset 0x%04X */\n" % (Type, ' ' * Space1, Name, ' ' * Space2, Offset)
+ return "/**Offset 0x%04X \n%s**/\n %s%s%s;%s\n" % (Offset, HelpLine, Type, ' ' * Space1, Name, ' ' * Space2)
def CreateHeaderFile (self, InputHeaderFile, IsInternal):
@@ -919,12 +922,12 @@ EndList
NextVisible = True
Name = "Reserved" + Region[0] + "pdSpace%d" % ResvIdx
ResvIdx = ResvIdx + 1
- HeaderFd.write(self.CreateField (Item, Name, Item["offset"] - ResvOffset, ResvOffset, ''))
+ HeaderFd.write(self.CreateField (Item, Name, Item["offset"] - ResvOffset, ResvOffset, '', ''))
if Offset < Item["offset"]:
if IsInternal or LastVisible:
Name = "Unused" + Region[0] + "pdSpace%d" % SpaceIdx
- LineBuffer.append(self.CreateField (Item, Name, Item["offset"] - Offset, Offset, ''))
+ LineBuffer.append(self.CreateField (Item, Name, Item["offset"] - Offset, Offset, '',''))
SpaceIdx = SpaceIdx + 1
Offset = Item["offset"]
@@ -940,7 +943,7 @@ EndList
for Each in LineBuffer:
HeaderFd.write (Each)
LineBuffer = []
- HeaderFd.write(self.CreateField (Item, Item["cname"], Item["length"], Item["offset"], Item['struct']))
+ HeaderFd.write(self.CreateField (Item, Item["cname"], Item["length"], Item["offset"], Item['struct'], Item['help']))
HeaderFd.write("} " + Region[0] + "PD_DATA_REGION;\n\n")
HeaderFd.write("#pragma pack()\n\n")