+ self.FunctionLayoutCheckDeprecated()\r
+ \r
+ # To check if the deprecated functions are used\r
+ def FunctionLayoutCheckDeprecated(self):\r
+ if EccGlobalData.gConfig.CFunctionLayoutCheckNoDeprecated == '1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
+ EdkLogger.quiet("Checking function no deprecated one being used ...")\r
+\r
+ DeprecatedFunctionSet = ('UnicodeValueToString',\r
+ 'AsciiValueToString',\r
+ 'StrCpy',\r
+ 'StrnCpy',\r
+ 'StrCat',\r
+ 'StrnCat',\r
+ 'UnicodeStrToAsciiStr',\r
+ 'AsciiStrCpy',\r
+ 'AsciiStrnCpy',\r
+ 'AsciiStrCat',\r
+ 'AsciiStrnCat',\r
+ 'AsciiStrToUnicodeStr',\r
+ 'PcdSet8',\r
+ 'PcdSet16',\r
+ 'PcdSet32',\r
+ 'PcdSet64',\r
+ 'PcdSetPtr',\r
+ 'PcdSetBool',\r
+ 'PcdSetEx8',\r
+ 'PcdSetEx16',\r
+ 'PcdSetEx32',\r
+ 'PcdSetEx64',\r
+ 'PcdSetExPtr',\r
+ 'PcdSetExBool',\r
+ 'LibPcdSet8',\r
+ 'LibPcdSet16',\r
+ 'LibPcdSet32',\r
+ 'LibPcdSet64',\r
+ 'LibPcdSetPtr',\r
+ 'LibPcdSetBool',\r
+ 'LibPcdSetEx8',\r
+ 'LibPcdSetEx16',\r
+ 'LibPcdSetEx32',\r
+ 'LibPcdSetEx64',\r
+ 'LibPcdSetExPtr',\r
+ 'LibPcdSetExBool',\r
+ 'GetVariable',\r
+ 'GetEfiGlobalVariable',\r
+ )\r
+\r
+ for IdentifierTable in EccGlobalData.gIdentifierTableList:\r
+ SqlCommand = """select ID, Name, BelongsToFile from %s\r
+ where Model = %s """ % (IdentifierTable, MODEL_IDENTIFIER_FUNCTION_CALLING)\r
+ RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
+ for Record in RecordSet:\r
+ for Key in DeprecatedFunctionSet:\r
+ if Key == Record[1]:\r
+ if not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_DEPRECATE, Key):\r
+ OtherMsg = 'The function [%s] is deprecated which should NOT be used' % Key\r
+ EccGlobalData.gDb.TblReport.Insert(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_DEPRECATE,\r
+ OtherMsg=OtherMsg,\r
+ BelongsToTable=IdentifierTable,\r
+ BelongsToItem=Record[0])\r