Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

591 lines
34 KiB

  1. /*** data.c - Global Data
  2. *
  3. * This module contains global data declaration.
  4. *
  5. * Copyright (c) 1996,1997 Microsoft Corporation
  6. * Author: Michael Tsang (MikeTs)
  7. * Created 09/07/96
  8. *
  9. * MODIFICATION HISTORY
  10. */
  11. #include "aslp.h"
  12. #ifdef TRACING
  13. FILE *gpfileTrace = NULL;
  14. PSZ gpszTraceFile = NULL;
  15. int giTraceLevel = 0;
  16. int giIndent = 0;
  17. #endif //ifdef TRACING
  18. #ifdef DEBUG
  19. DWORD gdwcMemObjs = 0;
  20. #endif
  21. #pragma warning(disable: 4054)
  22. ARGTYPE FAR ArgTypes[] =
  23. {
  24. {"?", AT_ACTION, 0, (VOID *)PrintHelp, 0, NULL},
  25. {"Fo", AT_STRING, PF_SEPARATOR, &gpszAMLFile, 0, NULL},
  26. {"Fa", AT_STRING, PF_SEPARATOR, &gpszASMFile, 0, NULL},
  27. {"Fl", AT_STRING, PF_SEPARATOR, &gpszLSTFile, 0, NULL},
  28. {"Fn", AT_STRING, PF_SEPARATOR, &gpszNSDFile, 0, NULL},
  29. #ifdef __UNASM
  30. {"d", AT_ENABLE, 0, &gdwfASL, ASLF_DUMP_BIN, NULL},
  31. {"u", AT_ENABLE, 0, &gdwfASL, ASLF_UNASM, NULL},
  32. {"c", AT_ENABLE, 0, &gdwfASL, ASLF_CREAT_BIN,NULL},
  33. {"tab", AT_STRING, PF_SEPARATOR, &gpszTabSig, 0, NULL},
  34. #endif
  35. #ifdef TRACING
  36. {"t", AT_NUM, PF_SEPARATOR, &giTraceLevel, 0, NULL},
  37. {"l", AT_STRING, PF_SEPARATOR, &gpszTraceFile, 0, NULL},
  38. #endif
  39. {"nologo",AT_ENABLE, 0, &gdwfASL, ASLF_NOLOGO, NULL},
  40. {"", 0, 0, NULL, 0, NULL}
  41. };
  42. #pragma warning(default: 4054)
  43. PROGINFO ProgInfo = {NULL, NULL, NULL, NULL};
  44. #ifdef __UNASM
  45. HANDLE ghVxD = NULL;
  46. #endif
  47. char gszAMLName[_MAX_FNAME] = {0};
  48. char gszLSTName[_MAX_FNAME] = {0};
  49. PSZ gpszASLFile = NULL;
  50. PSZ gpszAMLFile = NULL;
  51. PSZ gpszASMFile = NULL;
  52. PSZ gpszLSTFile = NULL;
  53. PSZ gpszNSDFile = NULL;
  54. PSZ gpszTabSig = NULL;
  55. int giLevel = 0;
  56. PBYTE gpbOpTop = NULL;
  57. PBYTE gpbOpBegin = NULL;
  58. DWORD gdwfASL = 0;
  59. PCODEOBJ gpcodeRoot = NULL;
  60. PCODEOBJ gpcodeScope = NULL;
  61. PNSOBJ gpnsNameSpaceRoot = NULL;
  62. PNSOBJ gpnsCurrentScope = NULL;
  63. PNSOBJ gpnsCurrentOwner = NULL;
  64. PNSCHK gpnschkHead = NULL;
  65. PNSCHK gpnschkTail = NULL;
  66. DWORD gdwFieldAccSize = 0;
  67. DESCRIPTION_HEADER ghdrDDB = {0};
  68. char SymCharTable[] = "{}(),/*";
  69. char * FAR gapszTokenType[] = {"ASL/User Term", "String", "Character", "Number",
  70. "Symbol", "Space"};
  71. //
  72. // N: NameStr
  73. // O: DataObj (num, string, buffer, package)
  74. // K: Keyword (e.g. NoLock, ByteAcc etc.)
  75. // D: DWord integer
  76. // W: Word integer
  77. // B: Byte integer
  78. // U: Numeric (any size integer)
  79. // S: SuperName (NameStr + Localx + Argx + Ret)
  80. // C: Opcode
  81. // Z: ASCIIZ string
  82. //
  83. #define AF TF_ACTION_FLIST //process after fixed list is parsed
  84. #define AV TF_ACTION_VLIST //process after variable list is parsed
  85. #define LN TF_PACKAGE_LEN //term requires package length
  86. #define CC TF_CHANGE_CHILDSCOPE //change to child scope
  87. #define DL TF_DATA_LIST //term expects buffer data list
  88. #define PL TF_PACKAGE_LIST //term expects package list
  89. #define FL TF_FIELD_LIST //term expects FieldList
  90. #define OL TF_OBJECT_LIST //term expects ObjectList
  91. #define LL TF_COMPILER_DIRECTIVE //term expects compiler directives
  92. #define CL TF_CODE_LIST //term expects CodeList
  93. #define AL TF_ALL_LISTS //term expects anything
  94. #define ML TF_PNP_MACRO //term expects PNPMacro
  95. #define BL TF_BYTE_LIST //term expects ByteList
  96. #define DD TF_DWORD_LIST //term expects DWordList
  97. #define CD TC_COMPILER_DIRECTIVE
  98. #define FM TC_FIELD_MACRO
  99. #define CN TC_CONST_NAME
  100. #define SN TC_SHORT_NAME
  101. #define NS TC_NAMESPACE_MODIFIER
  102. #define DO TC_DATA_OBJECT
  103. #define KW TC_KEYWORD
  104. #define NO TC_NAMED_OBJECT
  105. #define C1 TC_OPCODE_TYPE1
  106. #define C2 TC_OPCODE_TYPE2
  107. #define RO TC_REF_OBJECT
  108. #define PM TC_PNP_MACRO
  109. #define UNK OBJTYPE_UNKNOWN
  110. #define INT OBJTYPE_INTDATA
  111. #define STR OBJTYPE_STRDATA
  112. #define BUF OBJTYPE_BUFFDATA
  113. #define PKG OBJTYPE_PKGDATA
  114. #define FDU OBJTYPE_FIELDUNIT
  115. #define DEV OBJTYPE_DEVICE
  116. #define EVT OBJTYPE_EVENT
  117. #define MET OBJTYPE_METHOD
  118. #define MUT OBJTYPE_MUTEX
  119. #define OPR OBJTYPE_OPREGION
  120. #define PWR OBJTYPE_POWERRES
  121. #define THM OBJTYPE_THERMALZONE
  122. #define BFD OBJTYPE_BUFFFIELD
  123. #define DDB OBJTYPE_DDBHANDLE
  124. /*** Field flags
  125. */
  126. #define AANY (ACCTYPE_ANY | (ACCTYPE_MASK << 8))
  127. #define AB (ACCTYPE_BYTE | (ACCTYPE_MASK << 8))
  128. #define AW (ACCTYPE_WORD | (ACCTYPE_MASK << 8))
  129. #define ADW (ACCTYPE_DWORD | (ACCTYPE_MASK << 8))
  130. #define ABLK (ACCTYPE_BLOCK | (ACCTYPE_MASK << 8))
  131. #define ASSR (ACCTYPE_SMBSENDRECV | (ACCTYPE_MASK << 8))
  132. #define ASQ (ACCTYPE_SMBQUICK | (ACCTYPE_MASK << 8))
  133. #define LK (LOCKRULE_LOCK | (LOCKRULE_MASK << 8))
  134. #define NOLK (LOCKRULE_NOLOCK | (LOCKRULE_MASK << 8))
  135. #define PSRV (UPDATERULE_PRESERVE | (UPDATERULE_MASK << 8))
  136. #define WA1S (UPDATERULE_WRITEASONES | (UPDATERULE_MASK << 8))
  137. #define WA0S (UPDATERULE_WRITEASZEROS | (UPDATERULE_MASK << 8))
  138. /*** Operation region space
  139. */
  140. #define MEM (REGSPACE_MEM | 0xff00)
  141. #define IO (REGSPACE_IO | 0xff00)
  142. #define CFG (REGSPACE_PCICFG | 0xff00)
  143. #define EC (REGSPACE_EC | 0xff00)
  144. #define SMB (REGSPACE_SMB | 0xff00)
  145. /*** Method flags
  146. */
  147. #define SER (METHOD_SERIALIZED | (METHOD_SYNCMASK << 8))
  148. #define NOSER (METHOD_NOTSERIALIZED | (METHOD_SYNCMASK << 8))
  149. /*** Match operation values
  150. */
  151. #define OMTR (MTR | 0xff00)
  152. #define OMEQ (MEQ | 0xff00)
  153. #define OMLE (MLE | 0xff00)
  154. #define OMLT (MLT | 0xff00)
  155. #define OMGE (MGE | 0xff00)
  156. #define OMGT (MGT | 0xff00)
  157. ASLTERM TermTable[] =
  158. {
  159. "DefinitionBlock", ID_DEFBLK, CD, 0, OP_NONE, NULL, "ZZBZZD", NULL, OL|CL|LL|AF|AV, DefinitionBlock,
  160. "Include", ID_INCLUDE, CD, 0, OP_NONE, NULL, "Z", NULL, AF, Include,
  161. "External", ID_EXTERNAL, CD, 0, OP_NONE, NULL, "Nk", "uX", AF, External,
  162. // Short Objects
  163. "Zero", ID_ZERO, CN, 0, OP_ZERO, NULL, NULL, NULL, 0, NULL,
  164. "One", ID_ONE, CN, 0, OP_ONE, NULL, NULL, NULL, 0, NULL,
  165. "Ones", ID_ONES, CN, 0, OP_ONES, NULL, NULL, NULL, 0, NULL,
  166. "Revision", ID_REVISION, CN, 0, OP_REVISION, NULL, NULL, NULL, 0, NULL,
  167. "Arg0", ID_ARG0, SN, 0, OP_ARG0, NULL, NULL, NULL, 0, NULL,
  168. "Arg1", ID_ARG1, SN, 0, OP_ARG1, NULL, NULL, NULL, 0, NULL,
  169. "Arg2", ID_ARG2, SN, 0, OP_ARG2, NULL, NULL, NULL, 0, NULL,
  170. "Arg3", ID_ARG3, SN, 0, OP_ARG3, NULL, NULL, NULL, 0, NULL,
  171. "Arg4", ID_ARG4, SN, 0, OP_ARG4, NULL, NULL, NULL, 0, NULL,
  172. "Arg5", ID_ARG5, SN, 0, OP_ARG5, NULL, NULL, NULL, 0, NULL,
  173. "Arg6", ID_ARG6, SN, 0, OP_ARG6, NULL, NULL, NULL, 0, NULL,
  174. "Local0", ID_LOCAL0, SN, 0, OP_LOCAL0, NULL, NULL, NULL, 0, NULL,
  175. "Local1", ID_LOCAL1, SN, 0, OP_LOCAL1, NULL, NULL, NULL, 0, NULL,
  176. "Local2", ID_LOCAL2, SN, 0, OP_LOCAL2, NULL, NULL, NULL, 0, NULL,
  177. "Local3", ID_LOCAL3, SN, 0, OP_LOCAL3, NULL, NULL, NULL, 0, NULL,
  178. "Local4", ID_LOCAL4, SN, 0, OP_LOCAL4, NULL, NULL, NULL, 0, NULL,
  179. "Local5", ID_LOCAL5, SN, 0, OP_LOCAL5, NULL, NULL, NULL, 0, NULL,
  180. "Local6", ID_LOCAL6, SN, 0, OP_LOCAL6, NULL, NULL, NULL, 0, NULL,
  181. "Local7", ID_LOCAL7, SN, 0, OP_LOCAL7, NULL, NULL, NULL, 0, NULL,
  182. "Debug", ID_DEBUG, SN, 0, OP_DEBUG, NULL, NULL, NULL, 0, NULL,
  183. // Named Terms
  184. "Alias", ID_ALIAS, NS, 0, OP_ALIAS, "NN", "NN", "Ua", 0, NULL,
  185. "Name", ID_NAME, NS, 0, OP_NAME, "NO", "NO", "u", 0, NULL,
  186. "Scope", ID_SCOPE, NS, 0, OP_SCOPE, "N", "N", "S", OL|LN|CC, NULL,
  187. // Data Objects
  188. "Buffer", ID_BUFFER, DO, 0, OP_BUFFER, "C", "c", "U", DL|LN, NULL,
  189. "Package", ID_PACKAGE, DO, 0, OP_PACKAGE, "B", "b", NULL, PL|LN, NULL,
  190. "EISAID", ID_EISAID, DO, 0, OP_DWORD, NULL,"Z", NULL, AF, EISAID,
  191. // Argument Keywords
  192. "AnyAcc", ID_ANYACC, KW, AANY, OP_NONE, NULL, NULL, "A", 0, NULL,
  193. "ByteAcc", ID_BYTEACC, KW, AB, OP_NONE, NULL, NULL, "A", 0, NULL,
  194. "WordAcc", ID_WORDACC, KW, AW, OP_NONE, NULL, NULL, "A", 0, NULL,
  195. "DWordAcc", ID_DWORDACC, KW, ADW, OP_NONE, NULL, NULL, "A", 0, NULL,
  196. "BlockAcc", ID_BLOCKACC, KW, ABLK, OP_NONE, NULL, NULL, "A", 0, NULL,
  197. "SMBSendRecvAcc", ID_SMBSENDRCVACC,KW, ASSR, OP_NONE, NULL, NULL, "A", 0, NULL,
  198. "SMBQuickAcc", ID_SMBQUICKACC, KW, ASQ, OP_NONE, NULL, NULL, "A", 0, NULL,
  199. "Lock", ID_LOCK, KW, LK, OP_NONE, NULL, NULL, "B", 0, NULL,
  200. "NoLock", ID_NOLOCK, KW, NOLK, OP_NONE, NULL, NULL, "B", 0, NULL,
  201. "Preserve", ID_PRESERVE, KW, PSRV, OP_NONE, NULL, NULL, "C", 0, NULL,
  202. "WriteAsOnes", ID_WRONES, KW, WA1S, OP_NONE, NULL, NULL, "C", 0, NULL,
  203. "WriteAsZeros", ID_WRZEROS, KW, WA0S, OP_NONE, NULL, NULL, "C", 0, NULL,
  204. "SystemMemory", ID_SYSMEM, KW, MEM, OP_NONE, NULL, NULL, "D", 0, NULL,
  205. "SystemIO", ID_SYSIO, KW, IO, OP_NONE, NULL, NULL, "D", 0, NULL,
  206. "PCI_Config", ID_PCICFG, KW, CFG, OP_NONE, NULL, NULL, "D", 0, NULL,
  207. "EmbeddedControl", ID_EMBCTRL, KW, EC, OP_NONE, NULL, NULL, "D", 0, NULL,
  208. "SMBus", ID_SMBUS, KW, SMB, OP_NONE, NULL, NULL, "D", 0, NULL,
  209. "Serialized", ID_SERIALIZED, KW, SER, OP_NONE, NULL, NULL, "E", 0, NULL,
  210. "NotSerialized", ID_NOTSERIALIZED,KW, NOSER,OP_NONE, NULL, NULL, "E", 0, NULL,
  211. "MTR", ID_MTR, KW, OMTR, OP_NONE, NULL, NULL, "F", 0, NULL,
  212. "MEQ", ID_MEQ, KW, OMEQ, OP_NONE, NULL, NULL, "F", 0, NULL,
  213. "MLE", ID_MLE, KW, OMLE, OP_NONE, NULL, NULL, "F", 0, NULL,
  214. "MLT", ID_MLT, KW, OMLT, OP_NONE, NULL, NULL, "F", 0, NULL,
  215. "MGE", ID_MGE, KW, OMGE, OP_NONE, NULL, NULL, "F", 0, NULL,
  216. "MGT", ID_MGT, KW, OMGT, OP_NONE, NULL, NULL, "F", 0, NULL,
  217. "Edge", ID_EDGE, KW, _HE, OP_NONE, NULL, NULL, "G", 0, NULL,
  218. "Level", ID_LEVEL, KW, _LL, OP_NONE, NULL, NULL, "G", 0, NULL,
  219. "ActiveHigh", ID_ACTIVEHI, KW, _HE, OP_NONE, NULL, NULL, "H", 0, NULL,
  220. "ActiveLow", ID_ACTIVELO, KW, _LL, OP_NONE, NULL, NULL, "H", 0, NULL,
  221. "Shared", ID_SHARED, KW, _SHR, OP_NONE, NULL, NULL, "I", 0, NULL,
  222. "Exclusive", ID_EXCLUSIVE, KW, _EXC, OP_NONE, NULL, NULL, "I", 0, NULL,
  223. "Compatibility", ID_COMPAT, KW, COMP, OP_NONE, NULL, NULL, "J", 0, NULL,
  224. "TypeA", ID_TYPEA, KW, TYPA, OP_NONE, NULL, NULL, "J", 0, NULL,
  225. "TypeB", ID_TYPEB, KW, TYPB, OP_NONE, NULL, NULL, "J", 0, NULL,
  226. "TypeF", ID_TYPEF, KW, TYPF, OP_NONE, NULL, NULL, "J", 0, NULL,
  227. "BusMaster", ID_BUSMASTER, KW, BM, OP_NONE, NULL, NULL, "K", 0, NULL,
  228. "NotBusMaster", ID_NOTBUSMASTER, KW, NOBM, OP_NONE, NULL, NULL, "K", 0, NULL,
  229. "Transfer8", ID_TRANSFER8, KW, X8, OP_NONE, NULL, NULL, "L", 0, NULL,
  230. "Transfer8_16", ID_TRANSFER8_16, KW, X816, OP_NONE, NULL, NULL, "L", 0, NULL,
  231. "Transfer16", ID_TRANSFER16, KW, X16, OP_NONE, NULL, NULL, "L", 0, NULL,
  232. "Decode16", ID_DECODE16, KW, DC16, OP_NONE, NULL, NULL, "M", 0, NULL,
  233. "Decode10", ID_DECODE10, KW, DC10, OP_NONE, NULL, NULL, "M", 0, NULL,
  234. "ReadWrite", ID_READWRITE, KW, _RW, OP_NONE, NULL, NULL, "N", 0, NULL,
  235. "ReadOnly", ID_READONLY, KW, _ROM, OP_NONE, NULL, NULL, "N", 0, NULL,
  236. "ResourceConsumer", ID_RESCONSUMER, KW, RCS, OP_NONE, NULL, NULL, "O", 0, NULL,
  237. "ResourceProducer", ID_RESPRODUCER, KW, RPD, OP_NONE, NULL, NULL, "O", 0, NULL,
  238. "SubDecode", ID_SUBDECODE, KW, BSD, OP_NONE, NULL, NULL, "P", 0, NULL,
  239. "PosDecode", ID_POSDECODE, KW, BPD, OP_NONE, NULL, NULL, "P", 0, NULL,
  240. "MinFixed", ID_MINFIXED, KW, MIF, OP_NONE, NULL, NULL, "Q", 0, NULL,
  241. "MinNotFixed", ID_MINNOTFIXED, KW, NMIF, OP_NONE, NULL, NULL, "Q", 0, NULL,
  242. "MaxFixed", ID_MAXFIXED, KW, MAF, OP_NONE, NULL, NULL, "R", 0, NULL,
  243. "MaxNotFixed", ID_MAXNOTFIXED, KW, NMAF, OP_NONE, NULL, NULL, "R", 0, NULL,
  244. "Cacheable", ID_CACHEABLE, KW, CACH, OP_NONE, NULL, NULL, "S", 0, NULL,
  245. "WriteCombining", ID_WRCOMBINING, KW, WRCB, OP_NONE, NULL, NULL, "S", 0, NULL,
  246. "Prefetchable", ID_PREFETCHABLE, KW, PREF, OP_NONE, NULL, NULL, "S", 0, NULL,
  247. "NonCacheable", ID_NONCACHEABLE, KW, NCAC, OP_NONE, NULL, NULL, "S", 0, NULL,
  248. "ISAOnlyRanges", ID_ISAONLYRNG, KW, ISA, OP_NONE, NULL, NULL, "T", 0, NULL,
  249. "NonISAOnlyRanges", ID_NONISAONLYRNG,KW, NISA, OP_NONE, NULL, NULL, "T", 0, NULL,
  250. "EntireRange", ID_ENTIRERNG, KW, ERNG, OP_NONE, NULL, NULL, "T", 0, NULL,
  251. "ExtEdge", ID_EXT_EDGE, KW, $EDG, OP_NONE, NULL, NULL, "U", 0, NULL,
  252. "ExtLevel", ID_EXT_LEVEL, KW, $LVL, OP_NONE, NULL, NULL, "U", 0, NULL,
  253. "ExtActiveHigh", ID_EXT_ACTIVEHI, KW, $HGH, OP_NONE, NULL, NULL, "V", 0, NULL,
  254. "ExtActiveLow", ID_EXT_ACTIVELO, KW, $LOW, OP_NONE, NULL, NULL, "V", 0, NULL,
  255. "ExtShared", ID_EXT_SHARED, KW, $SHR, OP_NONE, NULL, NULL, "W", 0, NULL,
  256. "ExtExclusive", ID_EXT_EXCLUSIVE,KW, $EXC, OP_NONE, NULL, NULL, "W", 0, NULL,
  257. "UnknownObj", ID_UNKNOWN_OBJ, KW, UNK, OP_NONE, NULL, NULL, "X", 0, NULL,
  258. "IntObj", ID_INT_OBJ, KW, INT, OP_NONE, NULL, NULL, "X", 0, NULL,
  259. "StrObj", ID_STR_OBJ, KW, STR, OP_NONE, NULL, NULL, "X", 0, NULL,
  260. "BuffObj", ID_BUFF_OBJ, KW, BUF, OP_NONE, NULL, NULL, "X", 0, NULL,
  261. "PkgObj", ID_PKG_OBJ, KW, PKG, OP_NONE, NULL, NULL, "X", 0, NULL,
  262. "FieldUnitObj", ID_FIELDUNIT_OBJ,KW, FDU, OP_NONE, NULL, NULL, "X", 0, NULL,
  263. "DeviceObj", ID_DEV_OBJ, KW, DEV, OP_NONE, NULL, NULL, "X", 0, NULL,
  264. "EventObj", ID_EVENT_OBJ, KW, EVT, OP_NONE, NULL, NULL, "X", 0, NULL,
  265. "MethodObj", ID_METHOD_OBJ, KW, MET, OP_NONE, NULL, NULL, "X", 0, NULL,
  266. "MutexObj", ID_MUTEX_OBJ, KW, MUT, OP_NONE, NULL, NULL, "X", 0, NULL,
  267. "OpRegionObj", ID_OPREGION_OBJ, KW, OPR, OP_NONE, NULL, NULL, "X", 0, NULL,
  268. "PowerResObj", ID_POWERRES_OBJ, KW, PWR, OP_NONE, NULL, NULL, "X", 0, NULL,
  269. "ThermalZoneObj", ID_THERMAL_OBJ, KW, THM, OP_NONE, NULL, NULL, "X", 0, NULL,
  270. "BuffFieldObj", ID_BUFFFIELD_OBJ,KW, BFD, OP_NONE, NULL, NULL, "X", 0, NULL,
  271. "DDBHandleObj", ID_DDBHANDLE_OBJ,KW, DDB, OP_NONE, NULL, NULL, "X", 0, NULL,
  272. // Field Macros
  273. "Offset", ID_OFFSET, FM, 0, OP_NONE, NULL, "B", NULL, 0, NULL,
  274. "AccessAs", ID_ACCESSAS, FM, 0, 0x01, NULL, "Kb", "A", AF, AccessAs,
  275. // Named Object Creators
  276. "BankField", ID_BANKFIELD, NO, 0, OP_BANKFIELD, "NNCKkk","NNCKKK","OFUABC", FL|FM|LN|AF, BankField,
  277. "CreateBitField", ID_BITFIELD, NO, 0, OP_BITFIELD, "CCN", "CPN", "UUb",0, NULL,
  278. "CreateByteField", ID_BYTEFIELD, NO, 0, OP_BYTEFIELD, "CCN", "CMN", "UUb",0, NULL,
  279. "CreateDWordField", ID_DWORDFIELD, NO, 0, OP_DWORDFIELD, "CCN", "CMN", "UUb",0, NULL,
  280. "CreateField", ID_CREATEFIELD, NO, 0, OP_CREATEFIELD,"CCCN","CPCN","UUUb",0,NULL,
  281. "CreateWordField", ID_WORDFIELD, NO, 0, OP_WORDFIELD, "CCN", "CMN", "UUb",0, NULL,
  282. "Device", ID_DEVICE, NO, 0, OP_DEVICE, "N", "N", "d", OL|LN|CC, NULL,
  283. "Event", ID_EVENT, NO, 0, OP_EVENT, "N", "N", "e", 0, NULL,
  284. "Field", ID_FIELD, NO, 0, OP_FIELD, "NKkk", "NKKK", "OABC", FL|FM|LN|AF, Field,
  285. "IndexField", ID_IDXFIELD, NO, 0, OP_IDXFIELD, "NNKkk","NNKKK", "FFABC", FL|FM|LN|AF, IndexField,
  286. "Method", ID_METHOD, NO, 0, OP_METHOD, "NKk", "Nbk", "m!E", CL|OL|LN|AF|CC, Method,
  287. "Mutex", ID_MUTEX, NO, 0, OP_MUTEX, "NB", "NB", "x", 0, NULL,
  288. "OperationRegion", ID_OPREGION, NO, 0x80ff00ff,OP_OPREGION,"NECC","NECC","oDUU", AF, OpRegion,
  289. "PowerResource", ID_POWERRES, NO, 0, OP_POWERRES, "NBW", "NBW", "p", OL|LN|CC, NULL,
  290. "Processor", ID_PROCESSOR, NO, 0, OP_PROCESSOR, "NBDB", "NBDB", "c", OL|LN|CC, NULL,
  291. "ThermalZone", ID_THERMALZONE, NO, 0, OP_THERMALZONE,"N", "N", "t", OL|LN|CC, NULL,
  292. // Type 1 Opcode Terms
  293. "Break", ID_BREAK, C1, 0, OP_BREAK, NULL, NULL, NULL, 0, NULL,
  294. "BreakPoint", ID_BREAKPOINT, C1, 0, OP_BREAKPOINT, NULL, NULL, NULL, 0, NULL,
  295. "Else", ID_ELSE, C1, 0, OP_ELSE, NULL, NULL, NULL, AF|CL|OL|LN, Else,
  296. "Fatal", ID_FATAL, C1, 0, OP_FATAL, "BDC", "BDC", " U",0, NULL,
  297. "If", ID_IF, C1, 0, OP_IF, "C", "C", "U", CL|OL|LN, NULL,
  298. "Load", ID_LOAD, C1, 0, OP_LOAD, "NS", "NS", "UU", 0, NULL,
  299. "Noop", ID_NOP, C1, 0, OP_NOP, NULL, NULL, NULL, 0, NULL,
  300. "Notify", ID_NOTIFY, C1, 0, OP_NOTIFY, "SC", "SC", "UU", 0, NULL,
  301. "Release", ID_RELEASE, C1, 0, OP_RELEASE, "S", "S", "X", 0, NULL,
  302. "Reset", ID_RESET, C1, 0, OP_RESET, "S", "S", "E", 0, NULL,
  303. "Return", ID_RETURN, C1, 0, OP_RETURN, "C", "C", "U", 0, NULL,
  304. "Signal", ID_SIGNAL, C1, 0, OP_SIGNAL, "S", "S", "E", 0, NULL,
  305. "Sleep", ID_SLEEP, C1, 0, OP_SLEEP, "C", "C", "U", 0, NULL,
  306. "Stall", ID_STALL, C1, 0, OP_STALL, "C", "C", "U", 0, NULL,
  307. "Unload", ID_UNLOAD, C1, 0, OP_UNLOAD, "S", "S", "U", 0, NULL,
  308. "While", ID_WHILE, C1, 0, OP_WHILE, "C", "C", "U", CL|OL|LN, NULL,
  309. // Type 2 Opcode Terms
  310. "Acquire", ID_ACQUIRE, C2, 0, OP_ACQUIRE, "SW", "SW", "X", 0, NULL,
  311. "Add", ID_ADD, C2, 0, OP_ADD, "CCS", "CCs", "UUU",0, NULL,
  312. "And", ID_AND, C2, 0, OP_AND, "CCS", "CCs", "UUU",0, NULL,
  313. "Concatenate", ID_CONCAT, C2, 0, OP_CONCAT, "CCS", "CCS", "UUU",0, NULL,
  314. "CondRefOf", ID_CONDREFOF, C2, 0, OP_CONDREFOF, "SS", "SS", "UU", 0, NULL,
  315. "Decrement", ID_DECREMENT, C2, 0, OP_DECREMENT, "S", "S", "U", 0, NULL,
  316. "DerefOf", ID_DEREFOF, C2, 0, OP_DEREFOF, "C", "C", "U", 0, NULL,
  317. "Divide", ID_DIVIDE, C2, 0, OP_DIVIDE, "CCSS", "CCss", "UUUU",0,NULL,
  318. "FindSetLeftBit", ID_FINDSETLBIT, C2, 0, OP_FINDSETLBIT, "CS", "Cs", "UU", 0, NULL,
  319. "FindSetRightBit", ID_FINDSETRBIT, C2, 0, OP_FINDSETRBIT, "CS", "Cs", "UU", 0, NULL,
  320. "FromBCD", ID_FROMBCD, C2, 0, OP_FROMBCD, "CS", "Cs", "UU", 0, NULL,
  321. "Increment", ID_INCREMENT, C2, 0, OP_INCREMENT, "S", "S", "U", 0, NULL,
  322. "Index", ID_INDEX, RO|C2, 0, OP_INDEX, "CCS", "CMs", "UUU",0, NULL,
  323. "LAnd", ID_LAND, C2, 0, OP_LAND, "CC", "CC", "UU", 0, NULL,
  324. "LEqual", ID_LEQ, C2, 0, OP_LEQ, "CC", "CC", "UU", 0, NULL,
  325. "LGreater", ID_LG, C2, 0, OP_LG, "CC", "CC", "UU", 0, NULL,
  326. "LGreaterEqual", ID_LGEQ, C2, 0, OP_LGEQ, "CC", "CC", "UU", 0, NULL,
  327. "LLess", ID_LL, C2, 0, OP_LL, "CC", "CC", "UU", 0, NULL,
  328. "LLessEqual", ID_LLEQ, C2, 0, OP_LLEQ, "CC", "CC", "UU", 0, NULL,
  329. "LNot", ID_LNOT, C2, 0, OP_LNOT, "C", "C", "U", 0, NULL,
  330. "LNotEqual", ID_LNOTEQ, C2, 0, OP_LNOTEQ, "CC", "CC", "UU", 0, NULL,
  331. "LOr", ID_LOR, C2, 0, OP_LOR, "CC", "CC", "UU", 0, NULL,
  332. "Match", ID_MATCH, C2, 0, OP_MATCH, "CKCKCC", "CKCKCC", "UFUFUU",AF,Match,
  333. "Multiply", ID_MULTIPLY, C2, 0, OP_MULTIPLY, "CCS", "CCs", "UUU",0, NULL,
  334. "NAnd", ID_NAND, C2, 0, OP_NAND, "CCS", "CCs", "UUU",0, NULL,
  335. "NOr", ID_NOR, C2, 0, OP_NOR, "CCS", "CCs", "UUU",0, NULL,
  336. "Not", ID_NOT, C2, 0, OP_NOT, "CS", "Cs", "UU", 0, NULL,
  337. "ObjectType", ID_OBJTYPE, C2, 0, OP_OBJTYPE, "S", "S", "U", 0, NULL,
  338. "Or", ID_OR, C2, 0, OP_OR, "CCS", "CCs", "UUU",0, NULL,
  339. "RefOf", ID_REFOF, C2, 0, OP_REFOF, "S", "S", "U", 0, NULL,
  340. "ShiftLeft", ID_SHIFTL, C2, 0, OP_SHIFTL, "CCS", "CCs", "UUU",0, NULL,
  341. "ShiftRight", ID_SHIFTR, C2, 0, OP_SHIFTR, "CCS", "CCs", "UUU",0, NULL,
  342. "SizeOf", ID_SIZEOF, C2, 0, OP_SIZEOF, "S", "S", "U", 0, NULL,
  343. "Store", ID_STORE, C2, 0, OP_STORE, "CS", "CS", "UU", 0, NULL,
  344. "Subtract", ID_SUBTRACT, C2, 0, OP_SUBTRACT, "CCS", "CCs", "UUU",0, NULL,
  345. "ToBCD", ID_TOBCD, C2, 0, OP_TOBCD, "CS", "Cs", "UU", 0, NULL,
  346. "Wait", ID_WAIT, C2, 0, OP_WAIT, "SC", "SC", "E", 0, NULL,
  347. "XOr", ID_XOR, C2, 0, OP_XOR, "CCS", "CCs", "UUU",0, NULL,
  348. // PNP Macros
  349. "ResourceTemplate", ID_RESTEMP, DO, 0, OP_BUFFER, NULL, "", NULL, ML|AF|AV|LN,ResourceTemplate,
  350. "StartDependentFnNoPri",ID_STARTDEPFNNOPRI,PM,0,0x30, NULL, "", NULL, ML|AF, AddSmallOffset,
  351. "StartDependentFn", ID_STARTDEPFN, PM, 0, 0x31, NULL, "BB", NULL, ML|AF, StartDependentFn,
  352. "EndDependentFn", ID_ENDDEPFN, PM, 0, 0x38, NULL, "", NULL, AF, AddSmallOffset,
  353. "IRQNoFlags", ID_IRQNOFLAGS, PM, 0, 0x22, NULL, "r", NULL, BL|AV, IRQDesc,
  354. "IRQ", ID_IRQ, PM, 0, 0x23, NULL, "KKkr", "GHI",BL|AV, IRQDesc,
  355. "DMA", ID_DMA, PM, 0, 0x2a, NULL, "KKKr", "JKL",BL|AV, DMADesc,
  356. "IO", ID_IO, PM, 0, 0x47, NULL, "KWWBBr", "M", AF, IODesc,
  357. "FixedIO", ID_FIXEDIO, PM, 0, 0x4b, NULL, "WBr", NULL, AF, FixedIODesc,
  358. "VendorShort", ID_VENDORSHORT, PM, 0, OP_NONE, NULL, "r", NULL, BL|AV, VendorShort,
  359. "Memory24", ID_MEMORY24, PM, 0, 0x81, NULL, "KWWWWr", "N", AF, Memory24Desc,
  360. "VendorLong", ID_VENDORLONG, PM, 0, 0x84, NULL, "r", NULL, BL|AV, VendorLong,
  361. "Memory32", ID_MEMORY32, PM, 0, 0x85, NULL, "KDDDDr", "N", AF, Memory32Desc,
  362. "Memory32Fixed", ID_MEMORY32FIXED,PM, 0, 0x86, NULL, "KDDr", "N", AF, FixedMemory32Desc,
  363. "DWORDMemory", ID_DWORDMEMORY, PM, 0, 0x87, NULL, "kkkkkKDDDDDbzr","OPQRSN",AF, DWordMemDesc,
  364. "DWORDIO", ID_DWORDIO, PM, 0, 0x87, NULL, "kkkkkDDDDDbzr", "OQRPT", AF, DWordIODesc,
  365. "WORDIO", ID_WORDIO, PM, 0, 0x88, NULL, "kkkkkWWWWWbzr", "OQRPT", AF, WordIODesc,
  366. "WORDBusNumber", ID_WORDBUSNUMBER,PM, 0, 0x88, NULL, "kkkkWWWWWbzr", "OQRP", AF, WordBusNumDesc,
  367. "Interrupt", ID_INTERRUPT, PM, 0, 0x89, NULL, "kKKkbzr", "OGHI",DD|AV, InterruptDesc,
  368. "QWORDMemory", ID_QWORDMEMORY, PM, 0, 0x8a, NULL, "kkkkkKQQQQQbzr","OPQRSN",AF, QWordMemDesc,
  369. "QWORDIO", ID_QWORDIO, PM, 0, 0x8a, NULL, "kkkkkQQQQQbzr", "OQRPT", AF, QWordIODesc,
  370. NULL, 0, 0, 0, OP_NONE, NULL, NULL, NULL, 0, NULL
  371. };
  372. #define INVALID OPCLASS_INVALID
  373. #define DATAOBJ OPCLASS_DATA_OBJ
  374. #define NAMEOBJ OPCLASS_NAME_OBJ
  375. #define CONSTOBJ OPCLASS_CONST_OBJ
  376. #define CODEOBJ OPCLASS_CODE_OBJ
  377. #define ARGOBJ OPCLASS_ARG_OBJ
  378. #define LOCALOBJ OPCLASS_LOCAL_OBJ
  379. BYTE OpClassTable[256] =
  380. { //0x00 0x01 0x02 0x03
  381. CONSTOBJ, CONSTOBJ, INVALID, INVALID,
  382. //0x04 0x05 0x06 0x07
  383. INVALID, INVALID, CODEOBJ, INVALID,
  384. //0x08 0x09 0x0a 0x0b
  385. CODEOBJ, INVALID, DATAOBJ, DATAOBJ,
  386. //0x0c 0x0d 0x0e 0x0f
  387. DATAOBJ, DATAOBJ, INVALID, INVALID,
  388. //0x10 0x11 0x12 0x13
  389. CODEOBJ, CODEOBJ, CODEOBJ, INVALID,
  390. //0x14 0x15 0x16 0x17
  391. CODEOBJ, INVALID, INVALID, INVALID,
  392. //0x18 0x19 0x1a 0x1b
  393. INVALID, INVALID, INVALID, INVALID,
  394. //0x1c 0x1d 0x1e 0x1f
  395. INVALID, INVALID, INVALID, INVALID,
  396. //0x20 0x21 0x22 0x23
  397. INVALID, INVALID, INVALID, INVALID,
  398. //0x24 0x25 0x26 0x27
  399. INVALID, INVALID, INVALID, INVALID,
  400. //0x28 0x29 0x2a 0x2b
  401. INVALID, INVALID, INVALID, INVALID,
  402. //0x2c 0x2d 0x2e 0x2f
  403. INVALID, INVALID, NAMEOBJ, NAMEOBJ,
  404. //0x30 0x31 0x32 0x33
  405. INVALID, INVALID, INVALID, INVALID,
  406. //0x34 0x35 0x36 0x37
  407. INVALID, INVALID, INVALID, INVALID,
  408. //0x38 0x39 0x3a 0x3b
  409. INVALID, INVALID, INVALID, INVALID,
  410. //0x3c 0x3d 0x3e 0x3f
  411. INVALID, INVALID, INVALID, INVALID,
  412. //0x40 0x41 0x42 0x43
  413. INVALID, NAMEOBJ, NAMEOBJ, NAMEOBJ,
  414. //0x44 0x45 0x46 0x47
  415. NAMEOBJ, NAMEOBJ, NAMEOBJ, NAMEOBJ,
  416. //0x48 0x49 0x4a 0x4b
  417. NAMEOBJ, NAMEOBJ, NAMEOBJ, NAMEOBJ,
  418. //0x4c 0x4d 0x4e 0x4f
  419. NAMEOBJ, NAMEOBJ, NAMEOBJ, NAMEOBJ,
  420. //0x50 0x51 0x52 0x53
  421. NAMEOBJ, NAMEOBJ, NAMEOBJ, NAMEOBJ,
  422. //0x54 0x55 0x56 0x57
  423. NAMEOBJ, NAMEOBJ, NAMEOBJ, NAMEOBJ,
  424. //0x58 0x59 0x5a 0x5b
  425. NAMEOBJ, NAMEOBJ, NAMEOBJ, INVALID,
  426. //0x5c 0x5d 0x5e 0x5f
  427. NAMEOBJ, INVALID, NAMEOBJ, NAMEOBJ,
  428. //0x60 0x61 0x62 0x63
  429. LOCALOBJ, LOCALOBJ, LOCALOBJ, LOCALOBJ,
  430. //0x64 0x65 0x66 0x67
  431. LOCALOBJ, LOCALOBJ, LOCALOBJ, LOCALOBJ,
  432. //0x68 0x69 0x6a 0x6b
  433. ARGOBJ, ARGOBJ, ARGOBJ, ARGOBJ,
  434. //0x6c 0x6d 0x6e 0x6f
  435. ARGOBJ, ARGOBJ, ARGOBJ, INVALID,
  436. //0x70 0x71 0x72 0x73
  437. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  438. //0x74 0x75 0x76 0x77
  439. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  440. //0x78 0x79 0x7a 0x7b
  441. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  442. //0x7c 0x7d 0x7e 0x7f
  443. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  444. //0x80 0x81 0x82 0x83
  445. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  446. //0x84 0x85 0x86 0x87
  447. INVALID, INVALID, CODEOBJ, CODEOBJ,
  448. //0x88 0x89 0x8a 0x8b
  449. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  450. //0x8c 0x8d 0x8e 0x8f
  451. CODEOBJ, CODEOBJ, CODEOBJ, INVALID,
  452. //0x90 0x91 0x92 0x93
  453. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  454. //0x94 0x95 0x96 0x97
  455. CODEOBJ, CODEOBJ, INVALID, INVALID,
  456. //0x98 0x99 0x9a 0x9b
  457. INVALID, INVALID, INVALID, INVALID,
  458. //0x9c 0x9d 0x9e 0x9f
  459. INVALID, INVALID, INVALID, INVALID,
  460. //0xa0 0xa1 0xa2 0xa3
  461. CODEOBJ, CODEOBJ, CODEOBJ, CODEOBJ,
  462. //0xa4 0xa5 0xa6 0xa7
  463. CODEOBJ, CODEOBJ, INVALID, INVALID,
  464. //0xa8 0xa9 0xaa 0xab
  465. INVALID, INVALID, INVALID, INVALID,
  466. //0xac 0xad 0xae 0xaf
  467. INVALID, INVALID, INVALID, INVALID,
  468. //0xb0 0xb1 0xb2 0xb3
  469. INVALID, INVALID, INVALID, INVALID,
  470. //0xb4 0xb5 0xb6 0xb7
  471. INVALID, INVALID, INVALID, INVALID,
  472. //0xb8 0xb9 0xba 0xbb
  473. INVALID, INVALID, INVALID, INVALID,
  474. //0xbc 0xbd 0xbe 0xbf
  475. INVALID, INVALID, INVALID, INVALID,
  476. //0xc0 0xc1 0xc2 0xc3
  477. INVALID, INVALID, INVALID, INVALID,
  478. //0xc4 0xc5 0xc6 0xc7
  479. INVALID, INVALID, INVALID, INVALID,
  480. //0xc8 0xc9 0xca 0xcb
  481. INVALID, INVALID, INVALID, INVALID,
  482. //0xcc 0xcd 0xce 0xcf
  483. CODEOBJ, INVALID, INVALID, INVALID,
  484. //0xd0 0xd1 0xd2 0xd3
  485. INVALID, INVALID, INVALID, INVALID,
  486. //0xd4 0xd5 0xd6 0xd7
  487. INVALID, INVALID, INVALID, INVALID,
  488. //0xd8 0xd9 0xda 0xdb
  489. INVALID, INVALID, INVALID, INVALID,
  490. //0xdc 0xdd 0xde 0xdf
  491. INVALID, INVALID, INVALID, INVALID,
  492. //0xe0 0xe1 0xe2 0xe3
  493. INVALID, INVALID, INVALID, INVALID,
  494. //0xe4 0xe5 0xe6 0xe7
  495. INVALID, INVALID, INVALID, INVALID,
  496. //0xe8 0xe9 0xea 0xeb
  497. INVALID, INVALID, INVALID, INVALID,
  498. //0xec 0xed 0xee 0xef
  499. INVALID, INVALID, INVALID, INVALID,
  500. //0xf0 0xf1 0xf2 0xf3
  501. INVALID, INVALID, INVALID, INVALID,
  502. //0xf4 0xf5 0xf6 0xf7
  503. INVALID, INVALID, INVALID, INVALID,
  504. //0xf8 0xf9 0xfa 0xfb
  505. INVALID, INVALID, INVALID, INVALID,
  506. //0xfc 0xfd 0xfe 0xff
  507. INVALID, INVALID, INVALID, CONSTOBJ
  508. };
  509. OPMAP ExOpClassTable[] =
  510. {
  511. EXOP_MUTEX, CODEOBJ,
  512. EXOP_EVENT, CODEOBJ,
  513. EXOP_CONDREFOF, CODEOBJ,
  514. EXOP_CREATEFIELD, CODEOBJ,
  515. EXOP_LOAD, CODEOBJ,
  516. EXOP_STALL, CODEOBJ,
  517. EXOP_SLEEP, CODEOBJ,
  518. EXOP_ACQUIRE, CODEOBJ,
  519. EXOP_SIGNAL, CODEOBJ,
  520. EXOP_WAIT, CODEOBJ,
  521. EXOP_RESET, CODEOBJ,
  522. EXOP_RELEASE, CODEOBJ,
  523. EXOP_FROMBCD, CODEOBJ,
  524. EXOP_TOBCD, CODEOBJ,
  525. EXOP_UNLOAD, CODEOBJ,
  526. EXOP_REVISION, CODEOBJ,
  527. EXOP_DEBUG, CODEOBJ,
  528. EXOP_FATAL, CODEOBJ,
  529. EXOP_OPREGION, CODEOBJ,
  530. EXOP_FIELD, CODEOBJ,
  531. EXOP_DEVICE, CODEOBJ,
  532. EXOP_PROCESSOR, CODEOBJ,
  533. EXOP_POWERRES, CODEOBJ,
  534. EXOP_THERMALZONE, CODEOBJ,
  535. EXOP_IDXFIELD, CODEOBJ,
  536. EXOP_BANKFIELD, CODEOBJ,
  537. 0, 0
  538. };