I defined a buffer object and a control method to iterate the buffer object.
DefinitionBlock ("dsdt.asl", "DSDT", 0x02, "", "", 0x0) { Name (BUF0, Buffer() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) Method (IDXA, 1) { local0 = sizeof(Arg0) local1 = 0 // use this as the index value printf ("The size of the buffer is %o, Arg0 is: %o", local0, Arg0) while (local0 > local1) { printf ("inside loop:") printf ("%o", DeRefOf(Arg0[local1])) local1++ } }}
It compiles it with iasl
:
iasl dsdt.asl
Then I run it with acpiexec
:
acpiexec dsdt.aml
In the acpiexec
prompt, I tried to call the IDXA
method with \BUF0
as arg0:
- eval \IDXA \BUF0 Evaluating \IDXAACPI Debug: "The size of the buffer is 0000000000000008, Arg0 is: 0000000000000000"ACPI Debug: "inside loop:"ACPI Error: Needed [Buffer/String/Package], found [Integer] 0x555d39f95770 (20190509/exresop-617)ACPI Error: AE_AML_OPERAND_TYPE, While resolving operands for [Index] (20190509/dswexec-500)Failed at AML Offset 00056, Opcode 0088: Index (Arg0, Local1)Initialized Local Variables for Method [IDXA]: Local0: 0x555d39f95840 <Obj> Integer 0000000000000008 Local1: 0x555d39f956f0 <Obj> Integer 0000000000000000Initialized Arguments for Method [IDXA]: (1 arguments defined for method invocation) Arg0: 0x555d39f95770 <Obj> Integer 0000000000000000ACPI Error: Aborting method \IDXA due to previous error (AE_AML_OPERAND_TYPE) (20190509/psparse-581)ACPI Error: AE_AML_OPERAND_TYPE, while executing \IDXA from AML Debugger (20190509/dbexec-226)Evaluation of \IDXA failed with status AE_AML_OPERAND_TYPE
The error message says "Arg0 is: 0000000000000000".
And it seems it is an integer got passed in instead of a buffer array. So the index operator failed.
I can access the \BUF0
on the acpiexec
prompt. But I cannot pass it to the \IDXA
method.
- eval \BUF0Evaluating \BUF0Evaluation of \BUF0 returned object 0x55b97b465cd0, external buffer length 28 [Buffer] Length 0A = 0000: 01 02 03 04 05 06 07 00 00 08 // ..........
How to pass BUF0
to a ACPI control method in acpiexec
prompt?