📄 device.asl
字号:
if (LEqual(Arg0, 1)) {
Store(Arg1, SAC1)
Return(SAC1)
}
if (LEqual(Arg0, 2)) {
Store(Arg1, SAC2)
Return(SAC2)
}
if (LEqual(Arg0, 3)) {
Store(Arg1, SAC3)
Return(SAC3)
}
Name(Foo, "WMIACPI: ASL: SETC called with InstanceIndex = ")
Store(Foo, Debug)
Store(Arg0, Debug)
Fatal(0xa0, 12, 0)
}
//
// Set Data Block - Package
// Arg0 has the instance being queried
// Arg1 has the new value for the data block instance
Method(WSAA, 2) {
if (LEqual(CCAA, Zero))
{
// ERROR - Collection Control was not enabled
Name(Foo, "WMIACPI: ASL: WSAA called, but CCAA is 0\n")
Store(Foo, Debug)
Fatal(0xa0, 7, 0)
}
Return(SETA(Arg0, Arg1))
}
//
// Set Data Block - String
// Arg0 has the instance being queried
// Arg1 has the new value for the data block instance
Method(WSAB, 2) {
if (LEqual(CCAB, Zero))
{
// ERROR - Collection Control was not enabled
Name(Foo, "WMIACPI: ASL: WSAB called, but CCAB is 0\n")
Store(Foo, Debug)
Fatal(0xa0, 9, 0)
}
Return(SETB(Arg0, Arg1))
}
//
// Set Data Block - ULONG
// Arg0 has the instance being queried
// Arg1 has the new value for the data block instance
Method(WSAC, 2) {
if (LEqual(CCAC, Zero))
{
// ERROR - Collection Control was not enACled
Name(Foo, "WMIACPI: ASL: WSAC called, but CCAC is 0\n")
Store(Foo, Debug)
Fatal(0xa0, 11, 0)
}
Return(SETC(Arg0, Arg1))
}
//
// Validate that instance index is between 0 and 3
Method(VINS, 1)
{
if (LLess(Arg0, Zero))
{
Name(Foo, "WMIACPI: ASL: VINS called with InstanceIndex = ")
Store(Foo, Debug)
Store(Arg0, Debug)
Fatal(0xa0, 27, 0)
}
if (LGreater(Arg0, 3))
{
Name(Foo1, "WMIACPI: ASL: VINS called with InstanceIndex = ")
Store(Foo1, Debug)
Store(Arg0, Debug)
Fatal(0xa0, 28, 0)
}
}
//
// Package Method data block
// Arg0 has the instance being queried
// Arg1 has the method id
// Arg2 has the data passed
Method(WMBA, 3) {
// MethodId 1 - Get
if (LEqual(Arg1, 1))
{
Return(GETA(Arg0))
}
// MethodId 2 - Set
if (LEqual(Arg1, 2))
{
SETA(Arg0, Arg2)
Return(0)
}
// MethodId 3 - Event Generate
if (LEqual(Arg1, 3))
{
VINS(Arg0)
if (LEqual(ECD0, Zero))
{
// ERROR - Event Control was not enabled
Name(Foo, "WMIACPI: ASL: WMBA called, but ECD0 is 0\n")
Store(Foo, Debug)
Fatal(0xa0, 25, 0)
}
Notify(AMW0, 0xd0)
Return(0)
}
Name(Foo1, "WMIACPI: ASL: WMBA passed method id ")
Store(Foo1, Debug)
Store(Arg1, Debug)
Fatal(0xa0, 26, 0)
}
//
// String Method data block
// Arg0 has the instance being queried
// Arg1 has the method id
// Arg2 has the data passed
Method(WMBB, 3) {
// MethodId 1 - Get
if (LEqual(Arg1, 1))
{
Return(GETB(Arg0))
}
// MethodId 2 - Set
if (LEqual(Arg1, 2))
{
SETB(Arg0, Arg2)
Return(0)
}
// MethodId 3 - Event Generate
if (LEqual(Arg1, 3))
{
VINS(Arg0)
if (LEqual(ECD1, Zero))
{
// ERROR - Event Control was not enabled
Name(Foo, "WMIACPI: ASL: WMBB called, but ECD1 is 0\n")
Store(Foo, Debug)
Fatal(0xa0, 29, 0)
}
Notify(AMW0, 0xd1)
Return(0)
}
Name(Foo1, "WMIACPI: ASL: WMBB passed method id ")
Store(Foo1, Debug)
Store(Arg1, Debug)
Fatal(0xa0, 30, 0)
}
//
// ULONG Method data block
// Arg0 has the instance being queried
// Arg1 has the method id
// Arg2 has the data passed
Method(WMBC, 3) {
// MethodId 1 - Get
if (LEqual(Arg1, 1))
{
Return(GETC(Arg0))
}
// MethodId 2 - Set
if (LEqual(Arg1, 2))
{
SETC(Arg0, Arg2)
Return(0)
}
// MethodId 3 - Event Generate
if (LEqual(Arg1, 3))
{
VINS(Arg0)
if (LEqual(ECD2, Zero))
{
// ERROR - Event Control was not enabled
Name(Foo, "WMIACPI: ASL: WMBC called, but ECD2 is 0\n")
Store(Foo, Debug)
Fatal(0xa0, 31, 0)
}
Notify(AMW0, 0xd2)
Return(0)
}
Name(Foo1, "WMIACPI: ASL: WMBC passed method id ")
Store(Foo1, Debug)
Store(Arg1, Debug)
Fatal(0xa0, 32, 0)
}
//
// More info about an event
// Arg0 is the event id that was fired
Method(_WED, 1)
{
if (LEqual(Arg0, 0xd0))
{
Return(GETA(0))
}
if (LEqual(Arg0, 0xd1))
{
Return(GETB(0))
}
if (LEqual(Arg0, 0xd2))
{
Return(GETC(0))
}
Name(Foo, "WMIACPI: ASL: _WED passed event code ")
Store(Foo, Debug)
Store(Arg0, Debug)
Fatal(0xa0, 33, 0)
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -