All of lore.kernel.org
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: "Moore, Robert" <robert.moore@intel.com>, linux-acpi@vger.kernel.org
Cc: aystarik@gmail.com, "Lin, Ming M" <ming.m.lin@intel.com>
Subject: Re: ISA -> ISA_ (Re: [GIT PATCH] ACPI patches for 2.6.25-rc6)
Date: Thu, 27 Mar 2008 01:28:32 -0400	[thread overview]
Message-ID: <200803270128.33013.lenb@kernel.org> (raw)
In-Reply-To: <B28E9812BAF6E2498B7EC5C427F293A4048009DF@orsmsx415.amr.corp.intel.com>

Bob,
Wouldn't it be less confusing if the dis-assembler
also adding the trailing underscores to match what
is actually done by the interpreter?

thanks,
-Len

On Wednesday 26 March 2008, Moore, Robert wrote:
> References, ACPI specification 3.0b:
> 
> 
> 5.3  ACPI Namespace 
> 
> By convention, when an ASL compiler pads a name shorter than 4
> characters, it is done so with trailing underscores ('_'). See the
> language definition for AML NameSeg in Section 16, "ACPI Source Language
> Reference."
> 
> (Reference should point to section 18, AML reference)
> 
>  
> 
> 18.2.2   Name Objects Encoding
> 
> NameSeg            := <LeadNameChar NameChar NameChar NameChar>
> // Notice that NameSegs shorter than 4 characters are filled with
> // trailing underscores ('_'s).
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Moore, Robert 
> Sent: Wednesday, March 26, 2008 6:59 PM
> To: 'Len Brown'
> Cc: 'aystarik@gmail.com'; Lin, Ming M
> Subject: RE: Re: ISA -> ISA_ (Re: [GIT PATCH] ACPI patches for
> 2.6.25-rc6)
> 
> Whenever an ACPI namepath is parsed (each 4 character name within a
> namepath is called a "nameseg"), each nameseg is padded out with
> underscores if it is shorter than 4 characters. This happens whenever a
> named object is created and whenever a reference to a name is
> encountered.
> 
> Thus, internally, ALL namesegs are exactly 4 characters, no need to add
> code to handle variable-length namesegs.
> 
> Thus, smaller code and fewer bugs. This is also mentioned in the ACPI
> spec somewhere.
> 
> Bob
> 
> 
> Example:
> 
> Name (I, 0x1234)
> 
> Will be entered into the namespace as
> 
> I___
> 
> A reference to I such as
> 
> Store (\DEV0\I, Local0)
> 
> Will convert "I" to "I___" during AML parsing.
> 
> 
> 
> -----Original Message-----
> From: Len Brown [mailto:lenb@kernel.org] 
> Sent: Wednesday, March 26, 2008 11:00 AM
> To: Moore, Robert
> Subject: Fwd: Re: ISA -> ISA_ (Re: [GIT PATCH] ACPI patches for
> 2.6.25-rc6)
> 
> Bob,
> can you comment on this thread?
> 
> thanks,
> -Len
> 
> ----------  Forwarded Message  ----------
> 
> Subject: Re: ISA -> ISA_ (Re: [GIT PATCH] ACPI patches for 2.6.25-rc6)
> Date: Wednesday 26 March 2008
> From: Alexey Starikovskiy < aystarik@gmail.com >
> To: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 
> Bjorn Helgaas wrote:
> > I'm curious about how this works.  I disassembled the DSDT from
> > http://bugzilla.kernel.org/show_bug.cgi?id=4773 (I attached the
> disassembly
> > at http://bugzilla.kernel.org/attachment.cgi?id=15448&action=view),
> and
> > the _PRT contains "_SB" and "ISA" (no trailing underscores):
> >
> >                 Package (0x04)
> >                 {
> >                     0x000DFFFF, 
> >                     0x00, 
> >                     \_SB.PCI0.ISA.LNKA, 
> >                     0x00
> >                 }
> >
> > But by the time we get to acpi_pci_irq_add_entry(), we've added the
> > underscores somewhere (see
> > http://bugzilla.kernel.org/attachment.cgi?id=15423&action=view):
> >
> >   0000:00:0d[A] -> \_SB_.PCI0.ISA_.LNKA
> >
> > I don't know where this happens, but it certainly confused me, and
> > it seems like it could lead to other bugs.
> >   
> ACPI is supposed to add trailing underscore for pad all names to 4
> bytes.
> So ISA will be padded to ISA_.
> 
> Regards,
> Alex.
> 
> -------------------------------------------------------
> 



       reply	other threads:[~2008-03-27  5:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200803261400.22662.lenb@kernel.org>
     [not found] ` <B28E9812BAF6E2498B7EC5C427F293A4048009DF@orsmsx415.amr.corp.intel.com>
2008-03-27  5:28   ` Len Brown [this message]
2008-03-27 16:28     ` ISA -> ISA_ (Re: [GIT PATCH] ACPI patches for 2.6.25-rc6) Moore, Robert
2008-03-18  9:10 [GIT PATCH] ACPI patches for 2.6.25-rc6 Len Brown
2008-03-26  8:16 ` Ingo Molnar
2008-03-26 15:32   ` ISA -> ISA_ (Re: [GIT PATCH] ACPI patches for 2.6.25-rc6) Len Brown
2008-03-26 15:45     ` Corentin CHARY
2008-03-26 15:45     ` Corentin CHARY
2008-03-26 15:45       ` Corentin CHARY
2008-03-26 16:33       ` Henrique de Moraes Holschuh
2008-03-26 16:33         ` Henrique de Moraes Holschuh
2008-03-26 15:56     ` Bjorn Helgaas
2008-03-26 15:56     ` Bjorn Helgaas
2008-03-26 17:24       ` Alexey Starikovskiy
2008-03-26 18:47         ` Bjorn Helgaas
2008-03-26 19:21           ` Alexey Starikovskiy
2008-03-26 19:21           ` Alexey Starikovskiy
2008-03-26 18:47         ` Bjorn Helgaas
2008-03-26 17:24       ` Alexey Starikovskiy
2008-03-26 15:32   ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200803270128.33013.lenb@kernel.org \
    --to=lenb@kernel.org \
    --cc=aystarik@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.