Leaked source code of windows server 2003
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.

586 lines
35 KiB

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