All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Devel] Re: Automatic dereference when reading from ArgX
@ 2020-09-23 16:38 Moore, Robert
  0 siblings, 0 replies; 2+ messages in thread
From: Moore, Robert @ 2020-09-23 16:38 UTC (permalink / raw
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]

This seems to make things work (Because taking a DeRefOf on an Arg is the same as taking a DeRefOf on the base object (An integer in this case). Which causes an error.

    Method (DRFA, 1) {
        //printf("Arg0: %o", DeRefOf(Arg0))
        printf("Arg0: %o", Arg0)
        //Store (DeRefOf(Arg0), INTX)
        Store (Arg0, INTX)       // <- line 10
        Debug = INTX
    }

    Method (MAIN, 0)
    {
        DRFA(INT5) //RefOf(INT5))
    }
}

- ev main
Evaluating \MAIN
ACPI Debug:  "Arg0: 0000000000000005"
ACPI Debug:  0x0000000000000005
No object was returned from evaluation of \MAIN


-----Original Message-----
From: dunkaist(a)gmail.com <dunkaist(a)gmail.com> 
Sent: Tuesday, September 22, 2020 3:47 PM
To: devel(a)acpica.org
Subject: [Devel] Automatic dereference when reading from ArgX

Hello,

I've been struggling to find out how acpiexec behavior corresponds to what ACPI spec says.


ACPI 6.3 spec, Chapter 19.3.5.9.1 ArgX Objects, 1. Read from ArgX parameters:
> ObjectReference - Automatic dereference, return the target of the reference. Use of DeRefOf returns the same.

ACPI spec, Table 19-421 Reading from ArgX Objects:
> Parameter: RefOf(Obj)
> MTHD ArgX Type: Reference to object Obj Read operation on ArgX: 
> Store(Arg0, ...) Result of read: Obj


Then, here is a table I've written (argx_deref.asl):

DefinitionBlock ("", "DSDT", 1, "BLAH", "BLAHDSDT", 0x00000001)
{
    Name (INT5, 5)
    Name (INTX, 0)

    Method (DRFA, 1) {
        printf("Arg0: %o", DeRefOf(Arg0))
        printf("Arg0: %o", Arg0)
        Store (DeRefOf(Arg0), INTX)
        Store (Arg0, INTX)       // <- line 10
        Debug = INTX
    }

    Method (MAIN, 0)
    {
        DRFA(RefOf(INT5))
    }
}


Finally, the output of `acpiexec -m -eo argx_deref.aml':

> Intel ACPI Component Architecture
> AML Execution/Debug Utility version 20200717
> ...
>    Nested method call     :     DRFA
> ACPI Debug:  "Arg0: 00000005"
> ACPI Debug:  "Arg0: [Reference Object]"
> ACPI Error: Cannot assign type [Reference] to [Integer] (must be type Int/Str/Buf) (20200717/exstoren-239)
> Failed at AML Offset 00024, Opcode 0070: Store (Arg0, INTX) /* External reference */
> ...


So, it turnes out (or at least seems to me) that Store(Arg0, ...) at line 10 reads a Reference object, not an Integer one as the spec says.
I.e. there is no automatic dereference.

Do I miss something? Could you elaborate on this, please?

Thank you,
Ivan
_______________________________________________
Devel mailing list -- devel(a)acpica.org
To unsubscribe send an email to devel-leave(a)acpica.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Devel] Re: Automatic dereference when reading from ArgX
@ 2020-09-27 18:48 dunkaist
  0 siblings, 0 replies; 2+ messages in thread
From: dunkaist @ 2020-09-27 18:48 UTC (permalink / raw
  To: devel

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

Robert,

It turned out that you answered my question more than 11 years ago [1], amazing.
The issue I faced is a confirmed bug [2].
Perhaps, I should have found this before, sorry.

Well, at least I understood the spec correctly.
ACPICA doesn't handle automatic dereference of RefOf.

Thank you for your time,
Ivan

[1] https://bugs.acpica.org/show_bug.cgi?id=707#c5
[2] https://bugs.acpica.org/show_bug.cgi?id=737

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-27 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-23 16:38 [Devel] Re: Automatic dereference when reading from ArgX Moore, Robert
  -- strict thread matches above, loose matches on Subject: below --
2020-09-27 18:48 dunkaist

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.