## @file\r
# This file is used to define each component of INF file\r
#\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
##\r
# Import Modules\r
#\r
-import os\r
+import Common.LongFilePathOs as os\r
import re\r
import EdkLogger\r
from CommonDataClass.CommonClass import LibraryClassClass\r
from Table.TableInf import TableInf\r
import Database\r
from Parsing import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
\r
#\r
# Global variable\r
TAB_INF_DEFINES_VERSION_STRING : "VersionString",\r
TAB_INF_DEFINES_VERSION : "Version",\r
TAB_INF_DEFINES_PCD_IS_DRIVER : "PcdIsDriver",\r
- TAB_INF_DEFINES_TIANO_R8_FLASHMAP_H : "TianoR8FlashMap_h",\r
+ TAB_INF_DEFINES_TIANO_EDK_FLASHMAP_H : "TianoEdkFlashMap_h",\r
TAB_INF_DEFINES_SHADOW : "Shadow",\r
# TAB_INF_DEFINES_LIBRARY_CLASS : "LibraryClass",\r
# TAB_INF_DEFINES_ENTRY_POINT : "ExternImages",\r
# @var KeyList: To store value for KeyList, a list for all Keys used in Inf\r
#\r
class Inf(InfObject):\r
- def __init__(self, Filename = None, IsToDatabase = False, IsToModule = False, WorkspaceDir = None, Database = None, SupArchList = DataType.ARCH_LIST):\r
+ def __init__(self, Filename=None, IsToDatabase=False, IsToModule=False, WorkspaceDir=None, Database=None, SupArchList=DataType.ARCH_LIST):\r
self.Identification = Identification()\r
self.Module = ModuleClass()\r
self.UserExtensions = ''\r
#\r
# Remove comment block\r
#\r
- if Line.find(TAB_COMMENT_R8_START) > -1:\r
- ReservedLine = GetSplitValueList(Line, TAB_COMMENT_R8_START, 1)[0]\r
+ if Line.find(TAB_COMMENT_EDK_START) > -1:\r
+ ReservedLine = GetSplitList(Line, TAB_COMMENT_EDK_START, 1)[0]\r
IsFindBlockComment = True\r
- if Line.find(TAB_COMMENT_R8_END) > -1:\r
- Line = ReservedLine + GetSplitValueList(Line, TAB_COMMENT_R8_END, 1)[1]\r
+ if Line.find(TAB_COMMENT_EDK_END) > -1:\r
+ Line = ReservedLine + GetSplitList(Line, TAB_COMMENT_EDK_END, 1)[1]\r
ReservedLine = ''\r
IsFindBlockComment = False\r
if IsFindBlockComment:\r
CurrentSection = ItemList[0]\r
else:\r
if CurrentSection != ItemList[0]:\r
- EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, "Different section names '%s' and '%s' are found in one section definition, this is not allowed." % (CurrentSection, ItemList[0]), File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)\r
if CurrentSection.upper() not in self.KeyList:\r
RaiseParserError(Line, CurrentSection, Filename, '', LineNo)\r
CurrentSection = TAB_UNKNOWN\r
RaiseParserError(Line, CurrentSection, Filename, '', LineNo)\r
else:\r
if ItemList[1] != '' and ItemList[1].upper() not in ARCH_LIST_FULL:\r
- EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, "Invalid Arch definition '%s' found" % ItemList[1], File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)\r
ArchList.append(ItemList[1].upper())\r
ThirdList.append(ItemList[2])\r
\r
#\r
if CurrentSection == TAB_UNKNOWN:\r
ErrorMsg = "%s is not in any defined section" % Line\r
- EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=Filename, Line=LineNo, RaiseError=EdkLogger.IsRaiseError)\r
\r
#\r
# Add a section item\r
print 'FvExt =', M.Header[Arch].FvExt\r
print 'SourceFv =', M.Header[Arch].SourceFv\r
print 'PcdIsDriver =', M.Header[Arch].PcdIsDriver\r
- print 'TianoR8FlashMap_h =', M.Header[Arch].TianoR8FlashMap_h\r
+ print 'TianoEdkFlashMap_h =', M.Header[Arch].TianoEdkFlashMap_h\r
print 'Shadow =', M.Header[Arch].Shadow\r
print 'LibraryClass =', M.Header[Arch].LibraryClass\r
for Item in M.Header[Arch].LibraryClass:\r
print Item.Name, Item.Value, Item.SupArchList\r
print '\nPcds =', M.PcdCodes\r
for Item in M.PcdCodes:\r
- print '\tCName=',Item.CName, 'TokenSpaceGuidCName=', Item.TokenSpaceGuidCName, 'DefaultValue=', Item.DefaultValue, 'ItemType=', Item.ItemType, Item.SupArchList\r
+ print '\tCName=', Item.CName, 'TokenSpaceGuidCName=', Item.TokenSpaceGuidCName, 'DefaultValue=', Item.DefaultValue, 'ItemType=', Item.ItemType, Item.SupArchList\r
print '\nSources =', M.Sources\r
for Source in M.Sources:\r
print Source.SourceFile, 'Fam=', Source.ToolChainFamily, 'Pcd=', Source.FeatureFlag, 'Tag=', Source.TagName, 'ToolCode=', Source.ToolCode, Source.SupArchList\r
print '\nUserExtensions =', M.UserExtensions\r
for UserExtension in M.UserExtensions:\r
- print UserExtension.UserID, UserExtension.Identifier,UserExtension.Content\r
+ print UserExtension.UserID, UserExtension.Identifier, UserExtension.Content\r
print '\nGuids =', M.Guids\r
for Item in M.Guids:\r
print Item.CName, Item.SupArchList, Item.FeatureFlag\r
# Get version of INF\r
#\r
if ModuleHeader.InfVersion != "":\r
- # R9 inf\r
+ # EdkII inf\r
VersionNumber = ModuleHeader.VersionNumber\r
VersionString = ModuleHeader.VersionString\r
if len(VersionNumber) > 0 and len(VersionString) == 0:\r
EdkLogger.warn(2001, 'INF file %s defines both VERSION_NUMBER and VERSION_STRING, using VERSION_STRING' % self.Identification.FileFullPath)\r
ModuleHeader.Version = VersionString\r
else:\r
- # R8 inf\r
+ # Edk inf\r
ModuleHeader.InfVersion = "0x00010000"\r
if ModuleHeader.ComponentType in gComponentType2ModuleType:\r
ModuleHeader.ModuleType = gComponentType2ModuleType[ModuleHeader.ComponentType]\r
elif ModuleHeader.ComponentType != '':\r
- EdkLogger.error("Parser", PARSER_ERROR, "Unsupported R8 component type [%s]" % ModuleHeader.ComponentType, ExtraData=File, RaiseError = EdkLogger.IsRaiseError)\r
+ EdkLogger.error("Parser", PARSER_ERROR, "Unsupported Edk component type [%s]" % ModuleHeader.ComponentType, ExtraData=File, RaiseError=EdkLogger.IsRaiseError)\r
\r
self.Module.Header[Arch] = ModuleHeader\r
\r
Nmake.SupArchList = Nmakes[Key]\r
self.Module.Nmake.append(Nmake)\r
\r
- # convert R8 format to R9 format\r
+ # convert Edk format to EdkII format\r
if Nmake.Name == "IMAGE_ENTRY_POINT":\r
Image = ModuleExternImageClass()\r
Image.ModuleEntryPoint = Nmake.Value\r