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.

770 lines
31 KiB

  1. //
  2. // Sample ASL code to demonstrate WMI query, set, method and event operations
  3. //
  4. // Insert this code at an appropriate place in the bios ASL source, rebuild
  5. // the DSDT and replace the original DSDT via the registry or reflashing.
  6. // NT should recognize the pnp0c14 device and by the magic of pnp install
  7. // wmiacpi.sys and bind it to this ASL. Note that you can have as many
  8. // devices as needed, however each device must have a unique _UID.
  9. //
  10. Device(AMW0)
  11. {
  12. // pnp0c14 is pnp id assigned to WMI mapper
  13. Name(_HID, "*pnp0c14")
  14. Name(_UID, 0x0)
  15. //
  16. // Description of data, events and methods supported by this ASL device.
  17. Name(_WDG, Buffer() {
  18. //
  19. // Query - Set Guids.
  20. //
  21. // {ABBC0F6a-8EA1-11d1-00A0-C90629100000}
  22. // Query - Set Package Guid
  23. 0x6a, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  24. 65, 65, // Object Id (AA)
  25. 4, // Instance Count
  26. 0x01, // Flags (WMIACPI_REGFLAG_EXPENSIVE)
  27. // {ABBC0F6b-8EA1-11d1-00A0-C90629100000}
  28. // Query - Set String Guid
  29. 0x6b, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  30. 65, 66, // Object Id (AB)
  31. 4, // Instance Count
  32. 0x05, // Flags (WMIACPI_REGFLAG_EXPENSIVE |
  33. // WMIACPI_REGFLAG_STRING)
  34. // Query - Set ULONG Guid
  35. // {ABBC0F6c-8EA1-11d1-00A0-C90629100000}
  36. 0x6c, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  37. 65, 67, // Object Id (AC)
  38. 4, // Instance Count
  39. 0x01, // Flags (WMIACPI_REGFLAG_EXPENSIVE)
  40. //
  41. // Method Guids
  42. // Method Id 1 is get with no input
  43. // Method Id 2 is set with no output
  44. // Method Id 3 is fire event
  45. // Package
  46. // {ABBC0F6d-8EA1-11d1-00A0-C90629100000}
  47. 0x6d, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  48. 66, 65, // Object Id (BA)
  49. 4, // Instance Count
  50. 0x02, // Flags (WMIACPI_REGFLAG_METHOD)
  51. // String
  52. // {ABBC0F6e-8EA1-11d1-00A0-C90629100000}
  53. 0x6e, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  54. 66, 66, // Object Id (BB)
  55. 4, // Instance Count
  56. 0x06, // Flags (WMIACPI_REGFLAG_METHOD)
  57. // WMIACPI_REGFLAG_STRING)
  58. // ULONG
  59. // {ABBC0F6f-8EA1-11d1-00A0-C90629100000}
  60. 0x6f, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  61. 66, 67, // Object Id (BC)
  62. 4, // Instance Count
  63. 0x02, // Flags (WMIACPI_REGFLAG_METHOD)
  64. //
  65. // Event Guids
  66. // Package
  67. // {ABBC0F70-8EA1-11d1-00A0-C90629100000}
  68. 0x70, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  69. 0xd0, 0, // Notification Id
  70. 1, // Instance Count
  71. 0x08, // Flags (WMIACPI_REGFLAG_EVENT)
  72. // String
  73. // {ABBC0F71-8EA1-11d1-00A0-C90629100000}
  74. 0x71, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  75. 0xd1, 0, // Notification Id
  76. 1, // Instance Count
  77. 0x0c, // Flags (WMIACPI_REGFLAG_EVENT)
  78. // WMIACPI_REGFLAG_STRING)
  79. // ULONG
  80. // {ABBC0F72-8EA1-11d1-00A0-C90629100000}
  81. 0x72, 0x0f, 0xBC, 0xAB, 0xa1, 0x8e, 0xd1, 0x11, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0x10, 0, 0,
  82. 0xd2, 0, // Notification Id
  83. 1, // Instance Count
  84. 0x08 // Flags (WMIACPI_REGFLAG_EVENT)
  85. })
  86. // Storage for 4 instances of Package
  87. Name(SAA0, Buffer(0x10)
  88. {
  89. 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
  90. })
  91. Name(SAA1, Buffer(0x10)
  92. {
  93. 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
  94. })
  95. Name(SAA2, Buffer(0x10)
  96. {
  97. 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
  98. })
  99. Name(SAA3, Buffer(0x10)
  100. {
  101. 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0
  102. })
  103. // Storage for 4 instances of string
  104. // Maximum length for string is 80 chars
  105. Name(SAB0, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")
  106. Name(SAB1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")
  107. Name(SAB2, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")
  108. Name(SAB3, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()1234567890-_=+[]{}")
  109. // Storage for 4 instances of ULONG
  110. Name(SAC0, 0)
  111. Name(SAC1, 1)
  112. Name(SAC2, 2)
  113. Name(SAC3, 3)
  114. // Collection Control flags
  115. Name(CCAA, 0)
  116. Name(CCAB, 0)
  117. Name(CCAC, 0)
  118. // Event Control flags
  119. Name(ECD0, 0)
  120. Name(ECD1, 0)
  121. Name(ECD2, 0)
  122. // Collection control for AA
  123. // Arg0 has 0 for disable, non 0 for enable
  124. Method(WCAA, 1) {
  125. if (LEqual(Arg0, Zero))
  126. {
  127. // We are disabling
  128. if (LEqual(CCAA, Zero))
  129. {
  130. // ERROR - Collection Control was already disabled
  131. Name(Foo, "WMIACPI: ASL: WCAA called, but CCAA is 0\n")
  132. Store(Foo, Debug)
  133. Fatal(0xa0, 14, 0)
  134. }
  135. } else {
  136. // We are enabling
  137. if (LNotEqual(CCAA, Zero))
  138. {
  139. // ERROR - Collection Control was already enabled
  140. Name(Foo1, "WMIACPI: ASL: WCAA called, but CCAA is 1\n")
  141. Store(Foo1, Debug)
  142. Fatal(0xa0, 13, 0)
  143. }
  144. }
  145. Store(Arg0, CCAA)
  146. }
  147. // Collection control for AB
  148. // Arg0 has 0 for disable, non 0 for enable
  149. Method(WCAB, 1) {
  150. if (LEqual(Arg0, Zero))
  151. {
  152. // We are disabling
  153. if (LEqual(CCAB, Zero))
  154. {
  155. // ERROR - Collection Control was already disabled
  156. Name(Foo, "WMIACPI: ASL: WCAB called, but CCAB is 0\n")
  157. Store(Foo, Debug)
  158. Fatal(0xa0, 16, 0)
  159. }
  160. } else {
  161. // We are enabling
  162. if (LNotEqual(CCAB, Zero))
  163. {
  164. // ERROR - Collection Control was already enabled
  165. Name(Foo1, "WMIACPI: ASL: WCAB called, but CCAB is 1\n")
  166. Store(Foo1, Debug)
  167. Fatal(0xa0, 15, 0)
  168. }
  169. }
  170. Store(Arg0, CCAB)
  171. }
  172. // Collection control for AC
  173. // Arg0 has 0 for disable, non 0 for enable
  174. Method(WCAC, 1) {
  175. if (LEqual(Arg0, Zero))
  176. {
  177. // We are disabling
  178. if (LEqual(CCAC, Zero))
  179. {
  180. // ERROR - Collection Control was already disabled
  181. Name(Foo, "WMIACPI: ASL: WCAC called, but CCAC is 0\n")
  182. Store(Foo, Debug)
  183. Fatal(0xa0, 18, 0)
  184. }
  185. } else {
  186. // We are enabling
  187. if (LNotEqual(CCAC, Zero))
  188. {
  189. // ERROR - Collection Control was already enabled
  190. Name(Foo1, "WMIACPI: ASL: WCAC called, but CCAC is 1\n")
  191. Store(Foo1, Debug)
  192. Fatal(0xa0, 17, 0)
  193. }
  194. }
  195. Store(Arg0, CCAC)
  196. }
  197. // Event control for D0
  198. // Arg0 has 0 for disable, non 0 for enable
  199. Method(WED0, 1) {
  200. if (LEqual(Arg0, Zero))
  201. {
  202. // We are disabling
  203. if (LEqual(ECD0, Zero))
  204. {
  205. // ERROR - Event Control was already disabled
  206. Name(Foo, "WMIACPI: ASL: WED0 called, but ECD0 is 0\n")
  207. Store(Foo, Debug)
  208. Fatal(0xa0, 20, 0)
  209. }
  210. } else {
  211. // We are enabling
  212. if (LNotEqual(ECD0, Zero))
  213. {
  214. // ERROR - Event Control was already enabled
  215. Name(Foo1, "WMIACPI: ASL: WED0 called, but WED0 is 1\n")
  216. Store(Foo1, Debug)
  217. Fatal(0xa0, 19, 0)
  218. }
  219. }
  220. Store(Arg0, ECD0)
  221. }
  222. // Event control for D1
  223. // Arg0 has 0 for disable, non 0 for enable
  224. Method(WED1, 1) {
  225. if (LEqual(Arg0, Zero))
  226. {
  227. // We are disabling
  228. if (LEqual(ECD1, Zero))
  229. {
  230. // ERROR - Event Control was already disabled
  231. Name(Foo, "WMIACPI: ASL: WED1 called, but ECD1 is 0\n")
  232. Store(Foo, Debug)
  233. Fatal(0xa0, 22, 0)
  234. }
  235. } else {
  236. // We are enabling
  237. if (LNotEqual(ECD1, Zero))
  238. {
  239. // ERROR - Event Control was already enabled
  240. Name(Foo1, "WMIACPI: ASL: WED1 called, but WED1 is 1\n")
  241. Store(Foo1, Debug)
  242. Fatal(0xa0, 21, 0)
  243. }
  244. }
  245. Store(Arg0, ECD1)
  246. }
  247. // Event control for D2
  248. // Arg0 has 0 for disable, non 0 for enable
  249. Method(WED2, 1) {
  250. if (LEqual(Arg0, Zero))
  251. {
  252. // We are disabling
  253. if (LEqual(ECD2, Zero))
  254. {
  255. // ERROR - Event Control was already disabled
  256. Name(Foo, "WMIACPI: ASL: WED2 called, but ECD2 is 0\n")
  257. Store(Foo, Debug)
  258. Fatal(0xa0, 24, 0)
  259. }
  260. } else {
  261. // We are enabling
  262. if (LNotEqual(ECD2, Zero))
  263. {
  264. // ERROR - Event Control was already enabled
  265. Name(Foo1, "WMIACPI: ASL: WED2 called, but WED2 is 1\n")
  266. Store(Foo1, Debug)
  267. Fatal(0xa0, 23, 0)
  268. }
  269. }
  270. Store(Arg0, ECD2)
  271. }
  272. // Get value for package A
  273. Method(GETA, 1)
  274. {
  275. //
  276. // Return data corresponding to instance specified
  277. if (LEqual(Arg0, Zero)) {
  278. Return(SAA0)
  279. }
  280. if (LEqual(Arg0, 1)) {
  281. Return(SAA1)
  282. }
  283. if (LEqual(Arg0, 2)) {
  284. Return(SAA2)
  285. }
  286. if (LEqual(Arg0, 3)) {
  287. Return(SAA3)
  288. }
  289. Name(Foo, "WMIACPI: ASL: GETA called with InstanceIndex = ")
  290. Store(Foo, Debug)
  291. Store(Arg0, Debug)
  292. Fatal(0xa0, 2, 0)
  293. }
  294. // Get value for package A
  295. Method(GETB, 1)
  296. {
  297. //
  298. // Return data corresponding to instance specified
  299. if (LEqual(Arg0, Zero)) {
  300. Return(SAB0)
  301. }
  302. if (LEqual(Arg0, 1)) {
  303. Return(SAB1)
  304. }
  305. if (LEqual(Arg0, 2)) {
  306. Return(SAB2)
  307. }
  308. if (LEqual(Arg0, 3)) {
  309. Return(SAB3)
  310. }
  311. Name(Foo, "WMIACPI: ASL: GETB called with InstanceIndex = ")
  312. Store(Foo, Debug)
  313. Store(Arg0, Debug)
  314. Fatal(0xa0, 4, 0)
  315. }
  316. Method(GETC, 1)
  317. {
  318. //
  319. // Return data corresponding to instance specified
  320. if (LEqual(Arg0, Zero)) {
  321. Return(SAC0)
  322. }
  323. if (LEqual(Arg0, 1)) {
  324. Return(SAC1)
  325. }
  326. if (LEqual(Arg0, 2)) {
  327. Return(SAC2)
  328. }
  329. if (LEqual(Arg0, 3)) {
  330. Return(SAC3)
  331. }
  332. Name(Foo, "WMIACPI: ASL: GETC called with InstanceIndex = ")
  333. Store(Foo, Debug)
  334. Store(Arg0, Debug)
  335. Fatal(0xa0, 6, 0)
  336. }
  337. //
  338. // Package Query data block
  339. // Arg0 has the instance being queried
  340. Method(WQAA, 1) {
  341. if (LEqual(CCAA, Zero))
  342. {
  343. // ERROR - Collection Control was not enabled
  344. Name(Foo, "WMIACPI: ASL: WQAA called, but CCAA is 0\n")
  345. Store(Foo, Debug)
  346. Name(Foo1, "aa")
  347. Store(Debug, Foo1)
  348. Fatal(0xa0, 1, 0)
  349. }
  350. Return(GETA(Arg0))
  351. }
  352. //
  353. // String Query data block
  354. // Arg0 has the instance being queried
  355. Method(WQAB, 1) {
  356. if (LEqual(CCAB, Zero))
  357. {
  358. // ERROR - Collection Control was not enabled
  359. Name(Foo, "WMIACPI: ASL: WQAB called, but CCAB is 0\n")
  360. Store(Foo, Debug)
  361. Fatal(0xa0, 3, 0)
  362. }
  363. Return(GETB(Arg0))
  364. }
  365. //
  366. // ULONG Query data block
  367. // Arg0 has the instance being queried
  368. Method(WQAC, 1) {
  369. if (LEqual(CCAC, Zero))
  370. {
  371. // ERROR - Collection Control was not enabled
  372. Name(Foo, "WMIACPI: ASL: WQAC called, but CCAC is 0\n")
  373. Store(Foo, Debug)
  374. Fatal(0xa0, 5, 0)
  375. }
  376. Return(GETC(Arg0))
  377. }
  378. Method(SETA, 2)
  379. {
  380. //
  381. // Return data corresponding to instance specified
  382. if (LEqual(Arg0, Zero)) {
  383. Store(Arg1, SAA0)
  384. Return(SAA0)
  385. }
  386. if (LEqual(Arg0, 1)) {
  387. Store(Arg1, SAA1)
  388. Return(SAA1)
  389. }
  390. if (LEqual(Arg0, 2)) {
  391. Store(Arg1, SAA2)
  392. Return(SAA2)
  393. }
  394. if (LEqual(Arg0, 3)) {
  395. Store(Arg1, SAA3)
  396. Return(SAA3)
  397. }
  398. Name(Foo, "WMIACPI: ASL: SETA called with InstanceIndex = ")
  399. Store(Foo, Debug)
  400. Store(Arg0, Debug)
  401. Fatal(0xa0, 8, 0)
  402. }
  403. Method(SETB, 2)
  404. {
  405. //
  406. // Return data corresponding to instance specified
  407. if (LEqual(Arg0, Zero)) {
  408. Store(Arg1, SAB0)
  409. Return(SAB0)
  410. }
  411. if (LEqual(Arg0, 1)) {
  412. Store(Arg1, SAB1)
  413. Return(SAB1)
  414. }
  415. if (LEqual(Arg0, 2)) {
  416. Store(Arg1, SAB2)
  417. Return(SAB2)
  418. }
  419. if (LEqual(Arg0, 3)) {
  420. Store(Arg1, SAB3)
  421. Return(SAB3)
  422. }
  423. Name(Foo, "WMIACPI: ASL: SETB called with InstanceIndex = ")
  424. Store(Foo, Debug)
  425. Store(Arg0, Debug)
  426. Fatal(0xa0, 10, 0)
  427. }
  428. Method(SETC, 2)
  429. {
  430. //
  431. // Return data corresponding to instance specified
  432. if (LEqual(Arg0, Zero)) {
  433. Store(Arg1, SAC0)
  434. Return(SAC0)
  435. }
  436. if (LEqual(Arg0, 1)) {
  437. Store(Arg1, SAC1)
  438. Return(SAC1)
  439. }
  440. if (LEqual(Arg0, 2)) {
  441. Store(Arg1, SAC2)
  442. Return(SAC2)
  443. }
  444. if (LEqual(Arg0, 3)) {
  445. Store(Arg1, SAC3)
  446. Return(SAC3)
  447. }
  448. Name(Foo, "WMIACPI: ASL: SETC called with InstanceIndex = ")
  449. Store(Foo, Debug)
  450. Store(Arg0, Debug)
  451. Fatal(0xa0, 12, 0)
  452. }
  453. //
  454. // Set Data Block - Package
  455. // Arg0 has the instance being queried
  456. // Arg1 has the new value for the data block instance
  457. Method(WSAA, 2) {
  458. if (LEqual(CCAA, Zero))
  459. {
  460. // ERROR - Collection Control was not enabled
  461. Name(Foo, "WMIACPI: ASL: WSAA called, but CCAA is 0\n")
  462. Store(Foo, Debug)
  463. Fatal(0xa0, 7, 0)
  464. }
  465. Return(SETA(Arg0, Arg1))
  466. }
  467. //
  468. // Set Data Block - String
  469. // Arg0 has the instance being queried
  470. // Arg1 has the new value for the data block instance
  471. Method(WSAB, 2) {
  472. if (LEqual(CCAB, Zero))
  473. {
  474. // ERROR - Collection Control was not enabled
  475. Name(Foo, "WMIACPI: ASL: WSAB called, but CCAB is 0\n")
  476. Store(Foo, Debug)
  477. Fatal(0xa0, 9, 0)
  478. }
  479. Return(SETB(Arg0, Arg1))
  480. }
  481. //
  482. // Set Data Block - ULONG
  483. // Arg0 has the instance being queried
  484. // Arg1 has the new value for the data block instance
  485. Method(WSAC, 2) {
  486. if (LEqual(CCAC, Zero))
  487. {
  488. // ERROR - Collection Control was not enACled
  489. Name(Foo, "WMIACPI: ASL: WSAC called, but CCAC is 0\n")
  490. Store(Foo, Debug)
  491. Fatal(0xa0, 11, 0)
  492. }
  493. Return(SETC(Arg0, Arg1))
  494. }
  495. //
  496. // Validate that instance index is between 0 and 3
  497. Method(VINS, 1)
  498. {
  499. if (LLess(Arg0, Zero))
  500. {
  501. Name(Foo, "WMIACPI: ASL: VINS called with InstanceIndex = ")
  502. Store(Foo, Debug)
  503. Store(Arg0, Debug)
  504. Fatal(0xa0, 27, 0)
  505. }
  506. if (LGreater(Arg0, 3))
  507. {
  508. Name(Foo1, "WMIACPI: ASL: VINS called with InstanceIndex = ")
  509. Store(Foo1, Debug)
  510. Store(Arg0, Debug)
  511. Fatal(0xa0, 28, 0)
  512. }
  513. }
  514. //
  515. // Package Method data block
  516. // Arg0 has the instance being queried
  517. // Arg1 has the method id
  518. // Arg2 has the data passed
  519. Method(WMBA, 3) {
  520. // MethodId 1 - Get
  521. if (LEqual(Arg1, 1))
  522. {
  523. Return(GETA(Arg0))
  524. }
  525. // MethodId 2 - Set
  526. if (LEqual(Arg1, 2))
  527. {
  528. SETA(Arg0, Arg2)
  529. Return(0)
  530. }
  531. // MethodId 3 - Event Generate
  532. if (LEqual(Arg1, 3))
  533. {
  534. VINS(Arg0)
  535. if (LEqual(ECD0, Zero))
  536. {
  537. // ERROR - Event Control was not enabled
  538. Name(Foo, "WMIACPI: ASL: WMBA called, but ECD0 is 0\n")
  539. Store(Foo, Debug)
  540. Fatal(0xa0, 25, 0)
  541. }
  542. Notify(AMW0, 0xd0)
  543. Return(0)
  544. }
  545. Name(Foo1, "WMIACPI: ASL: WMBA passed method id ")
  546. Store(Foo1, Debug)
  547. Store(Arg1, Debug)
  548. Fatal(0xa0, 26, 0)
  549. }
  550. //
  551. // String Method data block
  552. // Arg0 has the instance being queried
  553. // Arg1 has the method id
  554. // Arg2 has the data passed
  555. Method(WMBB, 3) {
  556. // MethodId 1 - Get
  557. if (LEqual(Arg1, 1))
  558. {
  559. Return(GETB(Arg0))
  560. }
  561. // MethodId 2 - Set
  562. if (LEqual(Arg1, 2))
  563. {
  564. SETB(Arg0, Arg2)
  565. Return(0)
  566. }
  567. // MethodId 3 - Event Generate
  568. if (LEqual(Arg1, 3))
  569. {
  570. VINS(Arg0)
  571. if (LEqual(ECD1, Zero))
  572. {
  573. // ERROR - Event Control was not enabled
  574. Name(Foo, "WMIACPI: ASL: WMBB called, but ECD1 is 0\n")
  575. Store(Foo, Debug)
  576. Fatal(0xa0, 29, 0)
  577. }
  578. Notify(AMW0, 0xd1)
  579. Return(0)
  580. }
  581. Name(Foo1, "WMIACPI: ASL: WMBB passed method id ")
  582. Store(Foo1, Debug)
  583. Store(Arg1, Debug)
  584. Fatal(0xa0, 30, 0)
  585. }
  586. //
  587. // ULONG Method data block
  588. // Arg0 has the instance being queried
  589. // Arg1 has the method id
  590. // Arg2 has the data passed
  591. Method(WMBC, 3) {
  592. // MethodId 1 - Get
  593. if (LEqual(Arg1, 1))
  594. {
  595. Return(GETC(Arg0))
  596. }
  597. // MethodId 2 - Set
  598. if (LEqual(Arg1, 2))
  599. {
  600. SETC(Arg0, Arg2)
  601. Return(0)
  602. }
  603. // MethodId 3 - Event Generate
  604. if (LEqual(Arg1, 3))
  605. {
  606. VINS(Arg0)
  607. if (LEqual(ECD2, Zero))
  608. {
  609. // ERROR - Event Control was not enabled
  610. Name(Foo, "WMIACPI: ASL: WMBC called, but ECD2 is 0\n")
  611. Store(Foo, Debug)
  612. Fatal(0xa0, 31, 0)
  613. }
  614. Notify(AMW0, 0xd2)
  615. Return(0)
  616. }
  617. Name(Foo1, "WMIACPI: ASL: WMBC passed method id ")
  618. Store(Foo1, Debug)
  619. Store(Arg1, Debug)
  620. Fatal(0xa0, 32, 0)
  621. }
  622. //
  623. // More info about an event
  624. // Arg0 is the event id that was fired
  625. Method(_WED, 1)
  626. {
  627. if (LEqual(Arg0, 0xd0))
  628. {
  629. Return(GETA(0))
  630. }
  631. if (LEqual(Arg0, 0xd1))
  632. {
  633. Return(GETB(0))
  634. }
  635. if (LEqual(Arg0, 0xd2))
  636. {
  637. Return(GETC(0))
  638. }
  639. Name(Foo, "WMIACPI: ASL: _WED passed event code ")
  640. Store(Foo, Debug)
  641. Store(Arg0, Debug)
  642. Fatal(0xa0, 33, 0)
  643. }
  644. }