1## @file
2# This file is used to save global datas
3#
4# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
5# This program and the accompanying materials
6# are licensed and made available under the terms and conditions of the BSD License
7# which accompanies this distribution.  The full text of the license may be found at
8# http://opensource.org/licenses/bsd-license.php
9#
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12#
13
14from Common.Misc import sdict
15from Common.LongFilePathSupport import OpenLongFilePath as open
16
17gEFI_SOURCE = ''
18gEDK_SOURCE = ''
19gWORKSPACE = ''
20gSHELL_INF = 'Application\Shell'
21gMAKE_FILE = ''
22gDSC_FILE = ''
23gFV_FILE = []
24gFV = []
25gMAP_FILE = []
26gMap = {}
27
28
29gDb = ''
30gIdentifierTableList = []
31
32# Global macro
33gMACRO = {}
34gMACRO['EFI_SOURCE'] = gEFI_SOURCE
35gMACRO['EDK_SOURCE'] = gEDK_SOURCE
36gMACRO['SHELL_INF'] = gSHELL_INF
37gMACRO['CAPSULE_INF'] = ''
38
39gNOT_FOUND_FILES = []
40gSOURCE_FILES = []
41gINF_FILES = {}
42gDEC_FILES = []
43
44# Log file for unmatched variables
45gUN_MATCHED_LOG = 'Log_UnMatched.log'
46gOP_UN_MATCHED = open(gUN_MATCHED_LOG, 'w+')
47
48# Log file for all INF files
49gINF_FILES = 'Log_Inf_File.log'
50gOP_INF = open(gINF_FILES, 'w+')
51
52# Log file for not dispatched PEIM/DRIVER
53gUN_DISPATCHED_LOG = 'Log_UnDispatched.log'
54gOP_UN_DISPATCHED = open(gUN_DISPATCHED_LOG, 'w+')
55
56# Log file for unmatched variables in function calling
57gUN_MATCHED_IN_LIBRARY_CALLING_LOG = 'Log_UnMatchedInLibraryCalling.log'
58gOP_UN_MATCHED_IN_LIBRARY_CALLING = open(gUN_MATCHED_IN_LIBRARY_CALLING_LOG, 'w+')
59
60# Log file for order of dispatched PEIM/DRIVER
61gDISPATCH_ORDER_LOG = 'Log_DispatchOrder.log'
62gOP_DISPATCH_ORDER = open(gDISPATCH_ORDER_LOG, 'w+')
63
64# Log file for source files not found
65gUN_FOUND_FILES = 'Log_UnFoundSourceFiles.log'
66gOP_UN_FOUND_FILES = open(gUN_FOUND_FILES, 'w+')
67
68# Log file for found source files
69gSOURCE_FILES = 'Log_SourceFiles.log'
70gOP_SOURCE_FILES = open(gSOURCE_FILES, 'w+')
71
72# Dict for GUID found in DEC files
73gGuidDict = sdict()
74
75# Dict for hard coded GUID Macros
76# {GuidName : [GuidMacro : GuidValue]}
77gGuidMacroDict = sdict()
78
79# Dict for PPI
80gPpiList = {}
81
82# Dict for PROTOCOL
83gProtocolList = {}
84
85# Dict for consumed PPI function calling
86gConsumedPpiLibrary = sdict()
87gConsumedPpiLibrary['EfiCommonLocateInterface'] = 0
88gConsumedPpiLibrary['PeiServicesLocatePpi'] = 0
89
90# Dict for produced PROTOCOL function calling
91gProducedProtocolLibrary = sdict()
92gProducedProtocolLibrary['RegisterEsalClass'] = 0
93gProducedProtocolLibrary['CoreInstallProtocolInterface'] = 1
94gProducedProtocolLibrary['CoreInstallMultipleProtocolInterfaces'] = -1
95gProducedProtocolLibrary['EfiInstallProtocolInterface'] = 1
96gProducedProtocolLibrary['EfiReinstallProtocolInterface'] = 1
97gProducedProtocolLibrary['EfiLibNamedEventSignal'] = 0
98gProducedProtocolLibrary['LibInstallProtocolInterfaces'] = 1
99gProducedProtocolLibrary['LibReinstallProtocolInterfaces'] = 1
100
101# Dict for consumed PROTOCOL function calling
102gConsumedProtocolLibrary = sdict()
103gConsumedProtocolLibrary['EfiHandleProtocol'] = 0
104gConsumedProtocolLibrary['EfiLocateProtocolHandleBuffers'] = 0
105gConsumedProtocolLibrary['EfiLocateProtocolInterface'] = 0
106gConsumedProtocolLibrary['EfiHandleProtocol'] = 1
107
108# Dict for callback PROTOCOL function callling
109gCallbackProtocolLibrary = sdict()
110gCallbackProtocolLibrary['EfiRegisterProtocolCallback'] = 2
111
112# Dict for ARCH PROTOCOL
113gArchProtocols = ['gEfiBdsArchProtocolGuid',
114                  'gEfiCapsuleArchProtocolGuid',
115                  'gEfiCpuArchProtocolGuid',  #5053697e-2cbc-4819-90d9-0580deee5754
116                  'gEfiMetronomeArchProtocolGuid',
117                  'gEfiMonotonicCounterArchProtocolGuid',
118                  'gEfiRealTimeClockArchProtocolGuid',
119                  'gEfiResetArchProtocolGuid',
120                  'gEfiRuntimeArchProtocolGuid',
121                  'gEfiSecurityArchProtocolGuid',
122                  'gEfiStatusCodeRuntimeProtocolGuid',
123                  'gEfiTimerArchProtocolGuid',
124                  'gEfiVariableArchProtocolGuid',
125                  'gEfiVariableWriteArchProtocolGuid',
126                  'gEfiWatchdogTimerArchProtocolGuid']
127gArchProtocolGuids = ['665e3ff6-46cc-11d4-9a38-0090273fc14d',
128                      '26baccb1-6f42-11d4-bce7-0080c73c8881',
129                      '26baccb2-6f42-11d4-bce7-0080c73c8881',
130                      '1da97072-bddc-4b30-99f1-72a0b56fff2a',
131                      '27cfac87-46cc-11d4-9a38-0090273fc14d',
132                      '27cfac88-46cc-11d4-9a38-0090273fc14d',
133                      'b7dfb4e1-052f-449f-87be-9818fc91b733',
134                      'a46423e3-4617-49f1-b9ff-d1bfa9115839',
135                      'd2b2b828-0826-48a7-b3df-983c006024f0',
136                      '26baccb3-6f42-11d4-bce7-0080c73c8881',
137                      '1e5668e2-8481-11d4-bcf1-0080c73c8881',
138                      '6441f818-6362-4e44-b570-7dba31dd2453',
139                      '665e3ff5-46cc-11d4-9a38-0090273fc14d']
140