Bug 5360 - DerefOf doesn't evaluate String to Object
Summary: DerefOf doesn't evaluate String to Object
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: ACPICA-Core (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Valery A Podrezov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-04 08:38 UTC by Valery A Podrezov
Modified: 2006-09-28 13:11 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
ASL code to reproduce bug. (928 bytes, text/plain)
2005-10-04 08:40 UTC, Valery A Podrezov
Details
Proposed patch (2.13 KB, patch)
2006-02-03 03:44 UTC, Valery A Podrezov
Details | Diff
Proposed patch fixes simultaneously 5360 and 5392 (2.93 KB, patch)
2006-02-06 04:54 UTC, Valery A Podrezov
Details | Diff

Description Valery A Podrezov 2005-10-04 08:38:10 UTC
Most recent kernel where this bug did not occur:
Distribution:
Hardware Environment:
Software Environment:
Problem Description:

The Linux kernel ACPI interpreter fails the following
AML test when it is compiled into a simulator. So if an
OEM BIOS includes this code, Linux would fail.

Steps to reproduce:

Run interpreter with the .asl demo code attached below.
Comment 1 Valery A Podrezov 2005-10-04 08:40:07 UTC
Created attachment 6217 [details]
ASL code to reproduce bug.

The name of the Buffer (String) declared in the current
Method is passed to the DerefOf operator. It is expected
that DerefOf evaluate it to the contents of that Buffer
but exception occurs instead.


INTERNAL BUG NUMBER

   12
Comment 2 Valery A Podrezov 2006-02-03 03:44:43 UTC
Created attachment 7223 [details]
Proposed patch

TESTED:

The update was tested by the ASLTS test suite runs
(all the test cases) on the following systems:

- CYGWIN_NT-5.1 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin
- Linux 2.6.5-7.191-smp #1 SMP Tue Jun 28 14:58:56 UTC 2005 i686 i686 i386
GNU/Linux

for the following modes supported by the ASLTS test suite:

- 32-bit norm mode
- 64-bit norm mode
- 64-bit slack mode
# 32-bit slack mode (currently impossible to run tests in this mode due to Bug198)

The tests were run (on the systems described above) before update,
then the tests were run on those systems after update. Then results
of two runs were compared. All is Ok (the relevant error fixed, no
new errors).


SUPPORTED FEATURES (of DerefOf AML operator):


1. 

If parameter passed to DerefOf is String no matter the way it was
delivered to (see examples below) and that String is a valid name
(absolute or relative to the current scope) of some Object in the
NameSpace the value of that object of NameSpace is returned by DerefOf.

Examples:

Store(DerefOf("b000"), Local7)
Store(DerefOf(Arg0), Local7)
Store(DerefOf(Local0), Local7)
Store(DerefOf(s000), Local7)
Store(DerefOf(m000()), Local7)
Store(DerefOf(<other expressions>), Local7)

where:
  "b000" - literal String
  s000	 - Name(s000, "zzzz")
  Arg0	 - contains string
  Local0 - contains string
  m000	 - Method returning String
  <other expressions> - any expression resulting in String

2.

If parameter passed to DerefOf is an IndexReference
to some field (obtained by Index() AML operator) or
an ObjectReference to some object (obtained by RefOf
AML operator) then DerefOf processes those references.

3.

In all other cases -
DerefOf(Integer/String/Buffer/Package/Device/Mutex/Event/... etc.)
exceptions occur.
Comment 3 Valery A Podrezov 2006-02-06 04:54:18 UTC
Created attachment 7259 [details]
Proposed patch fixes simultaneously 5360 and 5392

This patch fixes both 5360 and 5392.
They refer near functionality in exoparg1.c file.
Prefer one patch instead several ones were possible.
Comment 4 Robert Moore 2006-02-10 14:24:17 UTC
Released in ACPICA version 20060210
Comment 5 Len Brown 2006-06-25 21:56:55 UTC
ACPICA 20060608 shipped in Linux-2.6.17-git9, closed. 

Note You need to log in before you can comment on or make changes to this bug.