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.

441 lines
22 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. data.c
  5. Abstract:
  6. Data file for AML
  7. Author:
  8. Michael Tsang
  9. Stephane Plante
  10. Environment:
  11. Any
  12. Revision History:
  13. --*/
  14. #include "pch.h"
  15. //
  16. // Name Space Modifiers
  17. //
  18. UNASM_AMLTERM
  19. atAlias = {
  20. "Alias", OP_ALIAS, "NN", TC_NAMESPACE_MODIFIER, OF_NORMAL_OBJECT, NULL
  21. },
  22. atName = {
  23. "Name", OP_NAME, "NO", TC_NAMESPACE_MODIFIER, OF_NORMAL_OBJECT, NULL
  24. },
  25. atScope = {
  26. "Scope", OP_SCOPE, "N", TC_NAMESPACE_MODIFIER, OF_VARIABLE_LIST, FunctionScope
  27. };
  28. //
  29. // Named Object Creators
  30. //
  31. UNASM_AMLTERM
  32. atBankField = {
  33. "BankField", OP_BANKFIELD, "NNCB", TC_NAMED_OBJECT, OF_VARIABLE_LIST|OF_UNASM_FIELDLIST, FunctionField
  34. },
  35. atDevice = {
  36. "Device", OP_DEVICE, "N", TC_NAMED_OBJECT, OF_VARIABLE_LIST, FunctionScope
  37. },
  38. atEvent = {
  39. "Event", OP_EVENT, "N", TC_NAMED_OBJECT, OF_NORMAL_OBJECT, NULL
  40. },
  41. atField = {
  42. "Field", OP_FIELD, "NB", TC_NAMED_OBJECT, OF_VARIABLE_LIST|OF_UNASM_FIELDLIST, FunctionField
  43. },
  44. atIndexField = {
  45. "IndexField", OP_IDXFIELD, "NNB", TC_NAMED_OBJECT, OF_VARIABLE_LIST|OF_UNASM_FIELDLIST, FunctionField
  46. },
  47. atMethod = {
  48. "Method", OP_METHOD, "NB", TC_NAMED_OBJECT, OF_VARIABLE_LIST, FunctionScope
  49. },
  50. atMutex = {
  51. "Mutex", OP_MUTEX, "NB", TC_NAMED_OBJECT, OF_NORMAL_OBJECT, NULL
  52. },
  53. atOpRegion = {
  54. "OperationRegion", OP_OPREGION, "NBCC", TC_NAMED_OBJECT, OF_NORMAL_OBJECT, NULL
  55. },
  56. atPowerRes = {
  57. "PowerResource", OP_POWERRES, "NBW", TC_NAMED_OBJECT, OF_VARIABLE_LIST, FunctionScope
  58. },
  59. atProcessor = {
  60. "Processor", OP_PROCESSOR, "NBDB", TC_NAMED_OBJECT, OF_VARIABLE_LIST, NULL
  61. },
  62. atThermalZone = {
  63. "ThermalZone", OP_THERMALZONE, "N", TC_NAMED_OBJECT, OF_VARIABLE_LIST, FunctionScope
  64. };
  65. //
  66. // Type 1 Opcodes
  67. //
  68. UNASM_AMLTERM
  69. atBreak = {
  70. "Break", OP_BREAK, NULL, TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  71. },
  72. atBreakPoint = {
  73. "BreakPoint", OP_BREAKPOINT, NULL, TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  74. },
  75. atBitField = {
  76. "CreateBitField", OP_BITFIELD, "CCN", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  77. },
  78. atByteField = {
  79. "CreateByteField", OP_BYTEFIELD, "CCN", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  80. },
  81. atDWordField = {
  82. "CreateDWordField", OP_DWORDFIELD, "CCN", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  83. },
  84. atCreateField = {
  85. "CreateField", OP_CREATEFIELD, "CCCN", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  86. },
  87. atWordField = {
  88. "CreateWordField", OP_WORDFIELD, "CCN", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  89. },
  90. atCondRefOf = {
  91. "CondRefOf", OP_CONDREFOF, "SS", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  92. },
  93. atElse = {
  94. "Else", OP_ELSE, NULL, TC_OPCODE_TYPE1, OF_VARIABLE_LIST|OF_PROCESS_UNASM, FunctionScope
  95. },
  96. atFatal = {
  97. "Fatal", OP_FATAL, "BDC", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  98. },
  99. atIf = {
  100. "If", OP_IF, "C", TC_OPCODE_TYPE1, OF_VARIABLE_LIST|OF_PROCESS_UNASM, FunctionScope
  101. },
  102. atLoad = {
  103. "Load", OP_LOAD, "NS", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  104. },
  105. atNOP = {
  106. "NoOp", OP_NOP, NULL, TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  107. },
  108. atNotify = {
  109. "Notify", OP_NOTIFY, "SC", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  110. },
  111. atRelease = {
  112. "Release", OP_RELEASE, "S", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  113. },
  114. atReset = {
  115. "Reset", OP_RESET, "S", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  116. },
  117. atReturn = {
  118. "Return", OP_RETURN, "C", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  119. },
  120. atSignal = {
  121. "Signal", OP_SIGNAL, "S", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  122. },
  123. atSleep = {
  124. "Sleep", OP_SLEEP, "C", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  125. },
  126. atStall = {
  127. "Stall", OP_STALL, "C", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  128. },
  129. atUnload = {
  130. "Unload", OP_UNLOAD, "N", TC_OPCODE_TYPE1, OF_NORMAL_OBJECT, NULL
  131. },
  132. atWhile = {
  133. "While", OP_WHILE, "C", TC_OPCODE_TYPE1, OF_VARIABLE_LIST, FunctionScope
  134. };
  135. //
  136. // Type 2 Opcodes
  137. //
  138. UNASM_AMLTERM
  139. atAcquire = {
  140. "Acquire", OP_ACQUIRE, "SW", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  141. },
  142. atAdd = {
  143. "Add", OP_ADD, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  144. },
  145. atAnd = {
  146. "And", OP_AND, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  147. },
  148. atConcat = {
  149. "Concatenate", OP_CONCAT, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  150. },
  151. atDecrement = {
  152. "Decrement", OP_DECREMENT, "S", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  153. },
  154. atDerefOf = {
  155. "DerefOf", OP_DEREFOF, "C", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  156. },
  157. atDivide = {
  158. "Divide", OP_DIVIDE, "CCSS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  159. },
  160. atFindSetLBit = {
  161. "FindSetLeftBit", OP_FINDSETLBIT, "CS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  162. },
  163. atFindSetRBit = {
  164. "FindSetRightBit", OP_FINDSETRBIT, "CS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  165. },
  166. atFromBCD = {
  167. "FromBCD", OP_FROMBCD, "CS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  168. },
  169. atIncrement = {
  170. "Increment", OP_INCREMENT, "S", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  171. },
  172. atIndex = {
  173. "Index", OP_INDEX, "CCS", TC_OPCODE_TYPE2, OF_REF_OBJECT, NULL
  174. },
  175. atLAnd = {
  176. "LAnd", OP_LAND, "CC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  177. },
  178. atLEq = {
  179. "LEqual", OP_LEQ, "CC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  180. },
  181. atLG = {
  182. "LGreater", OP_LG, "CC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  183. },
  184. atLL = {
  185. "LLess", OP_LL, "CC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  186. },
  187. atLNot = {
  188. "LNot", OP_LNOT, "C", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  189. },
  190. atLOr = {
  191. "LOr", OP_LOR, "CC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  192. },
  193. atMatch = {
  194. "Match", OP_MATCH, "CCCCCC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  195. },
  196. atMultiply = {
  197. "Multiply", OP_MULTIPLY, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  198. },
  199. atNAnd = {
  200. "NAnd", OP_NAND, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  201. },
  202. atNOr = {
  203. "NOr", OP_NOR, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  204. },
  205. atNot = {
  206. "Not", OP_NOT, "CS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  207. },
  208. atObjType = {
  209. "ObjectType", OP_OBJTYPE, "S", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  210. },
  211. atOr = {
  212. "Or", OP_OR, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  213. },
  214. atRefOf = {
  215. "RefOf", OP_REFOF, "S", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  216. },
  217. atShiftLeft = {
  218. "ShiftLeft", OP_SHIFTL, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  219. },
  220. atShiftRight = {
  221. "ShiftRight", OP_SHIFTR, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  222. },
  223. atSizeOf = {
  224. "SizeOf", OP_SIZEOF, "S", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  225. },
  226. atStore = {
  227. "Store", OP_STORE, "CS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  228. },
  229. atSubtract = {
  230. "Subtract", OP_SUBTRACT, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  231. },
  232. atToBCD = {
  233. "ToBCD", OP_TOBCD, "CS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  234. },
  235. atWait = {
  236. "Wait", OP_WAIT, "SC", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  237. },
  238. atXOr = {
  239. "XOr", OP_XOR, "CCS", TC_OPCODE_TYPE2, OF_NORMAL_OBJECT, NULL
  240. };
  241. //
  242. // Misc. Opcodes
  243. //
  244. UNASM_AMLTERM
  245. atNameObj = {
  246. "NameObj", OP_NONE, NULL, TC_OTHER, OF_NAME_OBJECT, NULL
  247. },
  248. atDataObj = {
  249. "DataObj", OP_NONE, NULL, TC_OTHER, OF_DATA_OBJECT, NULL
  250. },
  251. atConstObj = {
  252. "ConstObj", OP_NONE, NULL, TC_OTHER, OF_CONST_OBJECT, NULL
  253. },
  254. atArgObj = {
  255. "ArgObj", OP_NONE, NULL, TC_OTHER, OF_ARG_OBJECT, NULL
  256. },
  257. atLocalObj = {
  258. "LocalObj", OP_NONE, NULL, TC_OTHER, OF_LOCAL_OBJECT, NULL
  259. },
  260. atDebugObj = {
  261. "Debug", OP_DEBUG, NULL, TC_OTHER, OF_DEBUG_OBJECT, NULL
  262. };
  263. PUNASM_AMLTERM OpcodeTable[256] =
  264. { //0x00 0x01 0x02 0x03
  265. &atConstObj, &atConstObj, NULL, NULL,
  266. //0x04 0x05 0x06 0x07
  267. NULL, NULL, &atAlias, NULL,
  268. //0x08 0x09 0x0a 0x0b
  269. &atName, NULL, &atDataObj, &atDataObj,
  270. //0x0c 0x0d 0x0e 0x0f
  271. &atDataObj, &atDataObj, NULL, NULL,
  272. //0x10 0x11 0x12 0x13
  273. &atScope, &atDataObj, &atDataObj, NULL,
  274. //0x14 0x15 0x16 0x17
  275. &atMethod, NULL, NULL, NULL,
  276. //0x18 0x19 0x1a 0x1b
  277. NULL, NULL, NULL, NULL,
  278. //0x1c 0x1d 0x1e 0x1f
  279. NULL, NULL, NULL, NULL,
  280. //0x20 0x21 0x22 0x23
  281. NULL, NULL, NULL, NULL,
  282. //0x24 0x25 0x26 0x27
  283. NULL, NULL, NULL, NULL,
  284. //0x28 0x29 0x2a 0x2b
  285. NULL, NULL, NULL, NULL,
  286. //0x2c 0x2d 0x2e 0x2f
  287. NULL, NULL, &atNameObj, &atNameObj,
  288. //0x30 0x31 0x32 0x33
  289. NULL, NULL, NULL, NULL,
  290. //0x34 0x35 0x36 0x37
  291. NULL, NULL, NULL, NULL,
  292. //0x38 0x39 0x3a 0x3b
  293. NULL, NULL, NULL, NULL,
  294. //0x3c 0x3d 0x3e 0x3f
  295. NULL, NULL, NULL, NULL,
  296. //0x40 0x41 0x42 0x43
  297. NULL, &atNameObj, &atNameObj, &atNameObj,
  298. //0x44 0x45 0x46 0x47
  299. &atNameObj, &atNameObj, &atNameObj, &atNameObj,
  300. //0x48 0x49 0x4a 0x4b
  301. &atNameObj, &atNameObj, &atNameObj, &atNameObj,
  302. //0x4c 0x4d 0x4e 0x4f
  303. &atNameObj, &atNameObj, &atNameObj, &atNameObj,
  304. //0x50 0x51 0x52 0x53
  305. &atNameObj, &atNameObj, &atNameObj, &atNameObj,
  306. //0x54 0x55 0x56 0x57
  307. &atNameObj, &atNameObj, &atNameObj, &atNameObj,
  308. //0x58 0x59 0x5a 0x5b
  309. &atNameObj, &atNameObj, &atNameObj, NULL,
  310. //0x5c 0x5d 0x5e 0x5f
  311. &atNameObj, NULL, &atNameObj, &atNameObj,
  312. //0x60 0x61 0x62 0x63
  313. &atLocalObj, &atLocalObj, &atLocalObj, &atLocalObj,
  314. //0x64 0x65 0x66 0x67
  315. &atLocalObj, &atLocalObj, &atLocalObj, &atLocalObj,
  316. //0x68 0x69 0x6a 0x6b
  317. &atArgObj, &atArgObj, &atArgObj, &atArgObj,
  318. //0x6c 0x6d 0x6e 0x6f
  319. &atArgObj, &atArgObj, &atArgObj, NULL,
  320. //0x70 0x71 0x72 0x73
  321. &atStore, &atRefOf, &atAdd, &atConcat,
  322. //0x74 0x75 0x76 0x77
  323. &atSubtract, &atIncrement, &atDecrement, &atMultiply,
  324. //0x78 0x79 0x7a 0x7b
  325. &atDivide, &atShiftLeft, &atShiftRight, &atAnd,
  326. //0x7c 0x7d 0x7e 0x7f
  327. &atNAnd, &atOr, &atNOr, &atXOr,
  328. //0x80 0x81 0x82 0x83
  329. &atNot, &atFindSetLBit, &atFindSetRBit, &atDerefOf,
  330. //0x84 0x85 0x86 0x87
  331. NULL, NULL, &atNotify, &atSizeOf,
  332. //0x88 0x89 0x8a 0x8b
  333. &atIndex, &atMatch, &atDWordField, &atWordField,
  334. //0x8c 0x8d 0x8e 0x8f
  335. &atByteField, &atBitField, &atObjType, NULL,
  336. //0x90 0x91 0x92 0x93
  337. &atLAnd, &atLOr, &atLNot, &atLEq,
  338. //0x94 0x95 0x96 0x97
  339. &atLG, &atLL, NULL, NULL,
  340. //0x98 0x99 0x9a 0x9b
  341. NULL, NULL, NULL, NULL,
  342. //0x9c 0x9d 0x9e 0x9f
  343. NULL, NULL, NULL, NULL,
  344. //0xa0 0xa1 0xa2 0xa3
  345. &atIf, &atElse, &atWhile, &atNOP,
  346. //0xa4 0xa5 0xa6 0xa7
  347. &atReturn, &atBreak, NULL, NULL,
  348. //0xa8 0xa9 0xaa 0xab
  349. NULL, NULL, NULL, NULL,
  350. //0xac 0xad 0xae 0xaf
  351. NULL, NULL, NULL, NULL,
  352. //0xb0 0xb1 0xb2 0xb3
  353. NULL, NULL, NULL, NULL,
  354. //0xb4 0xb5 0xb6 0xb7
  355. NULL, NULL, NULL, NULL,
  356. //0xb8 0xb9 0xba 0xbb
  357. NULL, NULL, NULL, NULL,
  358. //0xbc 0xbd 0xbe 0xbf
  359. NULL, NULL, NULL, NULL,
  360. //0xc0 0xc1 0xc2 0xc3
  361. NULL, NULL, NULL, NULL,
  362. //0xc4 0xc5 0xc6 0xc7
  363. NULL, NULL, NULL, NULL,
  364. //0xc8 0xc9 0xca 0xcb
  365. NULL, NULL, NULL, NULL,
  366. //0xcc 0xcd 0xce 0xcf
  367. &atBreakPoint, NULL, NULL, NULL,
  368. //0xd0 0xd1 0xd2 0xd3
  369. NULL, NULL, NULL, NULL,
  370. //0xd4 0xd5 0xd6 0xd7
  371. NULL, NULL, NULL, NULL,
  372. //0xd8 0xd9 0xda 0xdb
  373. NULL, NULL, NULL, NULL,
  374. //0xdc 0xdd 0xde 0xdf
  375. NULL, NULL, NULL, NULL,
  376. //0xe0 0xe1 0xe2 0xe3
  377. NULL, NULL, NULL, NULL,
  378. //0xe4 0xe5 0xe6 0xe7
  379. NULL, NULL, NULL, NULL,
  380. //0xe8 0xe9 0xea 0xeb
  381. NULL, NULL, NULL, NULL,
  382. //0xec 0xed 0xee 0xef
  383. NULL, NULL, NULL, NULL,
  384. //0xf0 0xf1 0xf2 0xf3
  385. NULL, NULL, NULL, NULL,
  386. //0xf4 0xf5 0xf6 0xf7
  387. NULL, NULL, NULL, NULL,
  388. //0xf8 0xf9 0xfa 0xfb
  389. NULL, NULL, NULL, NULL,
  390. //0xfc 0xfd 0xfe 0xff
  391. NULL, NULL, NULL, &atConstObj
  392. };
  393. UNASM_OPCODEMAP ExOpcodeTable[] =
  394. {
  395. EXOP_MUTEX, &atMutex,
  396. EXOP_EVENT, &atEvent,
  397. EXOP_CONDREFOF, &atCondRefOf,
  398. EXOP_CREATEFIELD, &atCreateField,
  399. EXOP_LOAD, &atLoad,
  400. EXOP_STALL, &atStall,
  401. EXOP_SLEEP, &atSleep,
  402. EXOP_ACQUIRE, &atAcquire,
  403. EXOP_SIGNAL, &atSignal,
  404. EXOP_WAIT, &atWait,
  405. EXOP_RESET, &atReset,
  406. EXOP_RELEASE, &atRelease,
  407. EXOP_FROMBCD, &atFromBCD,
  408. EXOP_TOBCD, &atToBCD,
  409. EXOP_UNLOAD, &atUnload,
  410. EXOP_REVISION, &atConstObj,
  411. EXOP_DEBUG, &atDebugObj,
  412. EXOP_FATAL, &atFatal,
  413. EXOP_OPREGION, &atOpRegion,
  414. EXOP_FIELD, &atField,
  415. EXOP_DEVICE, &atDevice,
  416. EXOP_PROCESSOR, &atProcessor,
  417. EXOP_POWERRES, &atPowerRes,
  418. EXOP_THERMALZONE, &atThermalZone,
  419. EXOP_IDXFIELD, &atIndexField,
  420. EXOP_BANKFIELD, &atBankField,
  421. 0, NULL
  422. };