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.

346 lines
14 KiB

  1. /*** uasmdata.h - Unassembler Data Definitions
  2. *
  3. * Copyright (c) 1996,1997 Microsoft Corporation
  4. * Author: Michael Tsang (MikeTs)
  5. * Created 09/05/96
  6. *
  7. * MODIFICATION HISTORY
  8. */
  9. #ifndef _UASMDATA_H
  10. #define _UASMDATA_H
  11. // Opcode classes
  12. #define OPCLASS_INVALID 0
  13. #define OPCLASS_DATA_OBJ 1
  14. #define OPCLASS_NAME_OBJ 2
  15. #define OPCLASS_CONST_OBJ 3
  16. #define OPCLASS_CODE_OBJ 4
  17. #define OPCLASS_ARG_OBJ 5
  18. #define OPCLASS_LOCAL_OBJ 6
  19. // Term classes
  20. #define TC_PNP_MACRO 0x00100000
  21. #define TC_REF_OBJECT 0x00200000
  22. #define TC_FIELD_MACRO 0x00400000
  23. #define TC_DATA_OBJECT 0x00800000
  24. #define TC_NAMED_OBJECT 0x01000000
  25. #define TC_NAMESPACE_MODIFIER 0x02000000
  26. #define TC_OPCODE_TYPE1 0x04000000
  27. #define TC_OPCODE_TYPE2 0x08000000
  28. #define TC_CONST_NAME 0x10000000
  29. #define TC_SHORT_NAME 0x20000000
  30. #define TC_COMPILER_DIRECTIVE 0x40000000
  31. #define TC_KEYWORD 0x80000000
  32. #define TC_OPCODE (TC_OPCODE_TYPE1 | TC_OPCODE_TYPE2 | \
  33. TC_SHORT_NAME | TC_CONST_NAME | TC_DATA_OBJECT)
  34. // Term flags
  35. #define TF_ACTION_FLIST 0x00000001
  36. #define TF_ACTION_VLIST 0x00000002
  37. #define TF_PACKAGE_LEN 0x00000004
  38. #define TF_CHANGE_CHILDSCOPE 0x00000008
  39. #define TF_FIELD_MACRO TC_FIELD_MACRO
  40. #define TF_DATA_OBJECT TC_DATA_OBJECT
  41. #define TF_NAMED_OBJECT TC_NAMED_OBJECT
  42. #define TF_NAMESPACE_MODIFIER TC_NAMESPACE_MODIFIER
  43. #define TF_OPCODE_TYPE1 TC_OPCODE_TYPE1
  44. #define TF_OPCODE_TYPE2 TC_OPCODE_TYPE2
  45. #define TF_CONST_NAME TC_CONST_NAME
  46. #define TF_SHORT_NAME TC_SHORT_NAME
  47. #define TF_COMPILER_DIRECTIVE TC_COMPILER_DIRECTIVE
  48. #define TF_KEYWORD TC_KEYWORD
  49. #define TF_PNP_MACRO TC_PNP_MACRO
  50. #define TF_OBJECT_LIST (TC_NAMED_OBJECT | TC_NAMESPACE_MODIFIER)
  51. #define TF_CODE_LIST (TC_OPCODE_TYPE1 | TC_OPCODE_TYPE2)
  52. #define TF_DATA_LIST 0x00010000
  53. #define TF_FIELD_LIST 0x00020000
  54. #define TF_BYTE_LIST 0x00040000
  55. #define TF_DWORD_LIST 0x00080000
  56. #define TF_PACKAGE_LIST (TC_DATA_OBJECT | TC_SHORT_NAME | \
  57. TC_CONST_NAME)
  58. #define TF_ALL_LISTS (TF_DATA_OBJECT | TF_NAMED_OBJECT | \
  59. TF_NAMESPACE_MODIFIER | TF_OPCODE_TYPE1 | \
  60. TF_OPCODE_TYPE2 | TF_SHORT_NAME | \
  61. TF_CONST_NAME | TF_COMPILER_DIRECTIVE | \
  62. TF_DATA_LIST | TF_PACKAGE_LIST | \
  63. TF_FIELD_LIST | TF_PNP_MACRO | TF_BYTE_LIST |\
  64. TF_DWORD_LIST)
  65. // NameSpace object types
  66. #define NSTYPE_UNKNOWN 'U'
  67. #define NSTYPE_SCOPE 'S'
  68. #define NSTYPE_FIELDUNIT 'F'
  69. #define NSTYPE_DEVICE 'D'
  70. #define NSTYPE_EVENT 'E'
  71. #define NSTYPE_METHOD 'M'
  72. #define NSTYPE_MUTEX 'X'
  73. #define NSTYPE_OPREGION 'O'
  74. #define NSTYPE_POWERRES 'P'
  75. #define NSTYPE_PROCESSOR 'C'
  76. #define NSTYPE_THERMALZONE 'T'
  77. #define NSTYPE_OBJALIAS 'A'
  78. #define NSTYPE_BUFFFIELD 'B'
  79. // Object types
  80. #define OBJTYPE_PRIVATE 0xf0
  81. #define OBJTYPE_PNP_RES (OBJTYPE_PRIVATE + 0x00)
  82. #define OBJTYPE_RES_FIELD (OBJTYPE_PRIVATE + 0x01)
  83. #define OBJTYPE_EXTERNAL (OBJTYPE_PRIVATE + 0x02)
  84. // Identifier token values
  85. #define ID_LANG 0
  86. #define ID_DEFBLK (ID_LANG + 0)
  87. #define ID_INCLUDE (ID_LANG + 1)
  88. #define ID_EXTERNAL (ID_LANG + 2)
  89. #define ID_ZERO (ID_LANG + 100)
  90. #define ID_ONE (ID_LANG + 101)
  91. #define ID_ONES (ID_LANG + 102)
  92. #define ID_REVISION (ID_LANG + 103)
  93. #define ID_ARG0 (ID_LANG + 104)
  94. #define ID_ARG1 (ID_LANG + 105)
  95. #define ID_ARG2 (ID_LANG + 106)
  96. #define ID_ARG3 (ID_LANG + 107)
  97. #define ID_ARG4 (ID_LANG + 108)
  98. #define ID_ARG5 (ID_LANG + 109)
  99. #define ID_ARG6 (ID_LANG + 110)
  100. #define ID_LOCAL0 (ID_LANG + 111)
  101. #define ID_LOCAL1 (ID_LANG + 112)
  102. #define ID_LOCAL2 (ID_LANG + 113)
  103. #define ID_LOCAL3 (ID_LANG + 114)
  104. #define ID_LOCAL4 (ID_LANG + 115)
  105. #define ID_LOCAL5 (ID_LANG + 116)
  106. #define ID_LOCAL6 (ID_LANG + 117)
  107. #define ID_LOCAL7 (ID_LANG + 118)
  108. #define ID_DEBUG (ID_LANG + 119)
  109. #define ID_ALIAS (ID_LANG + 200)
  110. #define ID_NAME (ID_LANG + 201)
  111. #define ID_SCOPE (ID_LANG + 202)
  112. #define ID_BUFFER (ID_LANG + 300)
  113. #define ID_PACKAGE (ID_LANG + 301)
  114. #define ID_EISAID (ID_LANG + 302)
  115. #define ID_ANYACC (ID_LANG + 400)
  116. #define ID_BYTEACC (ID_LANG + 401)
  117. #define ID_WORDACC (ID_LANG + 402)
  118. #define ID_DWORDACC (ID_LANG + 403)
  119. #define ID_QWORDACC (ID_LANG + 404)
  120. #define ID_BUFFERACC (ID_LANG + 405)
  121. #define ID_LOCK (ID_LANG + 407)
  122. #define ID_NOLOCK (ID_LANG + 408)
  123. #define ID_PRESERVE (ID_LANG + 409)
  124. #define ID_WRONES (ID_LANG + 410)
  125. #define ID_WRZEROS (ID_LANG + 411)
  126. #define ID_SYSMEM (ID_LANG + 412)
  127. #define ID_SYSIO (ID_LANG + 413)
  128. #define ID_PCICFG (ID_LANG + 414)
  129. #define ID_EMBCTRL (ID_LANG + 415)
  130. #define ID_SMBUS (ID_LANG + 416)
  131. #define ID_SERIALIZED (ID_LANG + 417)
  132. #define ID_NOTSERIALIZED (ID_LANG + 418)
  133. #define ID_MTR (ID_LANG + 419)
  134. #define ID_MEQ (ID_LANG + 420)
  135. #define ID_MLE (ID_LANG + 421)
  136. #define ID_MLT (ID_LANG + 422)
  137. #define ID_MGE (ID_LANG + 423)
  138. #define ID_MGT (ID_LANG + 424)
  139. #define ID_EDGE (ID_LANG + 425)
  140. #define ID_LEVEL (ID_LANG + 426)
  141. #define ID_ACTIVEHI (ID_LANG + 427)
  142. #define ID_ACTIVELO (ID_LANG + 428)
  143. #define ID_SHARED (ID_LANG + 429)
  144. #define ID_EXCLUSIVE (ID_LANG + 430)
  145. #define ID_COMPAT (ID_LANG + 431)
  146. #define ID_TYPEA (ID_LANG + 432)
  147. #define ID_TYPEB (ID_LANG + 433)
  148. #define ID_TYPEF (ID_LANG + 434)
  149. #define ID_BUSMASTER (ID_LANG + 435)
  150. #define ID_NOTBUSMASTER (ID_LANG + 436)
  151. #define ID_TRANSFER8 (ID_LANG + 437)
  152. #define ID_TRANSFER8_16 (ID_LANG + 438)
  153. #define ID_TRANSFER16 (ID_LANG + 439)
  154. #define ID_DECODE16 (ID_LANG + 440)
  155. #define ID_DECODE10 (ID_LANG + 441)
  156. #define ID_READWRITE (ID_LANG + 442)
  157. #define ID_READONLY (ID_LANG + 443)
  158. #define ID_RESCONSUMER (ID_LANG + 444)
  159. #define ID_RESPRODUCER (ID_LANG + 445)
  160. #define ID_SUBDECODE (ID_LANG + 446)
  161. #define ID_POSDECODE (ID_LANG + 447)
  162. #define ID_MINFIXED (ID_LANG + 448)
  163. #define ID_MINNOTFIXED (ID_LANG + 449)
  164. #define ID_MAXFIXED (ID_LANG + 450)
  165. #define ID_MAXNOTFIXED (ID_LANG + 451)
  166. #define ID_CACHEABLE (ID_LANG + 452)
  167. #define ID_WRCOMBINING (ID_LANG + 453)
  168. #define ID_PREFETCHABLE (ID_LANG + 454)
  169. #define ID_NONCACHEABLE (ID_LANG + 455)
  170. #define ID_ISAONLYRNG (ID_LANG + 456)
  171. #define ID_NONISAONLYRNG (ID_LANG + 457)
  172. #define ID_ENTIRERNG (ID_LANG + 458)
  173. #define ID_EXT_EDGE (ID_LANG + 459)
  174. #define ID_EXT_LEVEL (ID_LANG + 460)
  175. #define ID_EXT_ACTIVEHI (ID_LANG + 461)
  176. #define ID_EXT_ACTIVELO (ID_LANG + 462)
  177. #define ID_EXT_SHARED (ID_LANG + 463)
  178. #define ID_EXT_EXCLUSIVE (ID_LANG + 464)
  179. #define ID_UNKNOWN_OBJ (ID_LANG + 465)
  180. #define ID_INT_OBJ (ID_LANG + 466)
  181. #define ID_STR_OBJ (ID_LANG + 467)
  182. #define ID_BUFF_OBJ (ID_LANG + 468)
  183. #define ID_PKG_OBJ (ID_LANG + 469)
  184. #define ID_FIELDUNIT_OBJ (ID_LANG + 470)
  185. #define ID_DEV_OBJ (ID_LANG + 471)
  186. #define ID_EVENT_OBJ (ID_LANG + 472)
  187. #define ID_METHOD_OBJ (ID_LANG + 473)
  188. #define ID_MUTEX_OBJ (ID_LANG + 474)
  189. #define ID_OPREGION_OBJ (ID_LANG + 475)
  190. #define ID_POWERRES_OBJ (ID_LANG + 476)
  191. #define ID_THERMAL_OBJ (ID_LANG + 477)
  192. #define ID_BUFFFIELD_OBJ (ID_LANG + 478)
  193. #define ID_DDBHANDLE_OBJ (ID_LANG + 479)
  194. #define ID_CMOSCFG (ID_LANG + 480)
  195. #define ID_SMBQUICK (ID_LANG + 481)
  196. #define ID_SMBSENDRECEIVE (ID_LANG + 482)
  197. #define ID_SMBBYTE (ID_LANG + 483)
  198. #define ID_SMBWORD (ID_LANG + 484)
  199. #define ID_SMBBLOCK (ID_LANG + 485)
  200. #define ID_SMBPROCESSCALL (ID_LANG + 486)
  201. #define ID_SMBBLOCKPROCESSCALL (ID_LANG + 487)
  202. #define ID_OFFSET (ID_LANG + 500)
  203. #define ID_ACCESSAS (ID_LANG + 501)
  204. #define ID_BANKFIELD (ID_LANG + 600)
  205. #define ID_DEVICE (ID_LANG + 601)
  206. #define ID_EVENT (ID_LANG + 602)
  207. #define ID_FIELD (ID_LANG + 603)
  208. #define ID_IDXFIELD (ID_LANG + 604)
  209. #define ID_METHOD (ID_LANG + 605)
  210. #define ID_MUTEX (ID_LANG + 606)
  211. #define ID_OPREGION (ID_LANG + 607)
  212. #define ID_POWERRES (ID_LANG + 608)
  213. #define ID_PROCESSOR (ID_LANG + 609)
  214. #define ID_THERMALZONE (ID_LANG + 610)
  215. #define ID_BREAK (ID_LANG + 700)
  216. #define ID_BREAKPOINT (ID_LANG + 701)
  217. #define ID_BITFIELD (ID_LANG + 702)
  218. #define ID_BYTEFIELD (ID_LANG + 703)
  219. #define ID_DWORDFIELD (ID_LANG + 704)
  220. #define ID_CREATEFIELD (ID_LANG + 705)
  221. #define ID_WORDFIELD (ID_LANG + 706)
  222. #define ID_ELSE (ID_LANG + 707)
  223. #define ID_FATAL (ID_LANG + 708)
  224. #define ID_IF (ID_LANG + 709)
  225. #define ID_LOAD (ID_LANG + 710)
  226. #define ID_NOP (ID_LANG + 711)
  227. #define ID_NOTIFY (ID_LANG + 712)
  228. #define ID_RELEASE (ID_LANG + 713)
  229. #define ID_RESET (ID_LANG + 714)
  230. #define ID_RETURN (ID_LANG + 715)
  231. #define ID_SIGNAL (ID_LANG + 716)
  232. #define ID_SLEEP (ID_LANG + 717)
  233. #define ID_STALL (ID_LANG + 718)
  234. #define ID_UNLOAD (ID_LANG + 719)
  235. #define ID_WHILE (ID_LANG + 720)
  236. #define ID_ACQUIRE (ID_LANG + 800)
  237. #define ID_ADD (ID_LANG + 801)
  238. #define ID_AND (ID_LANG + 802)
  239. #define ID_CONCAT (ID_LANG + 803)
  240. #define ID_CONDREFOF (ID_LANG + 804)
  241. #define ID_DECREMENT (ID_LANG + 805)
  242. #define ID_DEREFOF (ID_LANG + 806)
  243. #define ID_DIVIDE (ID_LANG + 807)
  244. #define ID_FINDSETLBIT (ID_LANG + 808)
  245. #define ID_FINDSETRBIT (ID_LANG + 809)
  246. #define ID_FROMBCD (ID_LANG + 810)
  247. #define ID_INCREMENT (ID_LANG + 811)
  248. #define ID_INDEX (ID_LANG + 812)
  249. #define ID_LAND (ID_LANG + 813)
  250. #define ID_LEQ (ID_LANG + 814)
  251. #define ID_LG (ID_LANG + 815)
  252. #define ID_LGEQ (ID_LANG + 816)
  253. #define ID_LL (ID_LANG + 817)
  254. #define ID_LLEQ (ID_LANG + 818)
  255. #define ID_LNOT (ID_LANG + 819)
  256. #define ID_LNOTEQ (ID_LANG + 820)
  257. #define ID_LOR (ID_LANG + 821)
  258. #define ID_MATCH (ID_LANG + 822)
  259. #define ID_MULTIPLY (ID_LANG + 823)
  260. #define ID_NAND (ID_LANG + 824)
  261. #define ID_NOR (ID_LANG + 825)
  262. #define ID_NOT (ID_LANG + 826)
  263. #define ID_OBJTYPE (ID_LANG + 827)
  264. #define ID_OR (ID_LANG + 828)
  265. #define ID_REFOF (ID_LANG + 829)
  266. #define ID_SHIFTL (ID_LANG + 830)
  267. #define ID_SHIFTR (ID_LANG + 831)
  268. #define ID_SIZEOF (ID_LANG + 832)
  269. #define ID_STORE (ID_LANG + 833)
  270. #define ID_SUBTRACT (ID_LANG + 834)
  271. #define ID_TOBCD (ID_LANG + 835)
  272. #define ID_WAIT (ID_LANG + 836)
  273. #define ID_XOR (ID_LANG + 837)
  274. #define ID_RESTEMP (ID_LANG + 1000)
  275. #define ID_STARTDEPFNNOPRI (ID_LANG + 1001)
  276. #define ID_STARTDEPFN (ID_LANG + 1002)
  277. #define ID_ENDDEPFN (ID_LANG + 1003)
  278. #define ID_IRQNOFLAGS (ID_LANG + 1004)
  279. #define ID_IRQ (ID_LANG + 1005)
  280. #define ID_DMA (ID_LANG + 1006)
  281. #define ID_IO (ID_LANG + 1007)
  282. #define ID_FIXEDIO (ID_LANG + 1008)
  283. #define ID_VENDORSHORT (ID_LANG + 1009)
  284. #define ID_MEMORY24 (ID_LANG + 1010)
  285. #define ID_VENDORLONG (ID_LANG + 1011)
  286. #define ID_MEMORY32 (ID_LANG + 1012)
  287. #define ID_MEMORY32FIXED (ID_LANG + 1013)
  288. #define ID_DWORDMEMORY (ID_LANG + 1014)
  289. #define ID_DWORDIO (ID_LANG + 1015)
  290. #define ID_WORDIO (ID_LANG + 1016)
  291. #define ID_WORDBUSNUMBER (ID_LANG + 1017)
  292. #define ID_INTERRUPT (ID_LANG + 1018)
  293. #define ID_QWORDMEMORY (ID_LANG + 1019)
  294. #define ID_QWORDIO (ID_LANG + 1020)
  295. //
  296. // Type definitions
  297. //
  298. typedef int (LOCAL *PFNTERM)(PTOKEN, BOOL);
  299. typedef struct _aslterm
  300. {
  301. PSZ pszID;
  302. LONG lID;
  303. DWORD dwfTermClass;
  304. DWORD dwTermData;
  305. DWORD dwOpcode;
  306. PSZ pszUnAsmArgTypes;
  307. PSZ pszArgTypes;
  308. PSZ pszArgActions;
  309. DWORD dwfTerm;
  310. PFNTERM pfnTerm;
  311. } ASLTERM, *PASLTERM;
  312. typedef struct _opmap
  313. {
  314. BYTE bExOp;
  315. BYTE bOpClass;
  316. } OPMAP, *POPMAP;
  317. //
  318. // Imported data
  319. //
  320. extern PBYTE gpbOpTop;
  321. extern PBYTE gpbOpBegin;
  322. extern ASLTERM TermTable[];
  323. extern BYTE OpClassTable[];
  324. extern OPMAP ExOpClassTable[];
  325. #endif //ifndef _UASMDATA_H