27.10.2015 Views

Advanced Configuration and Power Interface Specification

ACPI_6.0

ACPI_6.0

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Advanced</strong> <strong>Configuration</strong> <strong>and</strong> <strong>Power</strong> <strong>Interface</strong> <strong>Specification</strong><br />

Generally, the objects passed to a control method via the ArgX terms cannot be directly written or<br />

modified by the called method. In other words, when an ArgX term is used as a target oper<strong>and</strong> in an<br />

ASL statement, the existing ArgX object is not modified. Instead, the new object replaces the<br />

existing object <strong>and</strong> the ArgX term effectively becomes a LocalX term.<br />

The only exception to the read-only argument rule is if an ArgX term contains an Object Reference<br />

created via the RefOf ASL operator. In this case, the use of the ArgX term as a target oper<strong>and</strong> will<br />

cause any existing object stored at the ACPI name referred to by the RefOf operation to be<br />

overwritten.<br />

In some limited cases, a new, writable object may be created that will allow a control method to<br />

change the value of an ArgX object. These cases are limited to Buffer <strong>and</strong> Package objects where the<br />

“value” of the object is represented indirectly. For Buffers, a writable Index or Field can be created<br />

that refers to the original buffer data <strong>and</strong> will allow the called method to read or modify the data. For<br />

Packages, a writable Index can be created to allow the called method to modify the contents of<br />

individual elements of the Package.<br />

5.5.2.3 Local Variables <strong>and</strong> Locally Created Data Objects<br />

Control methods can access up to eight local data objects. Access to the local data objects have<br />

shorth<strong>and</strong> encodings. On initial control method execution, the local data objects are NULL. Access<br />

to local objects is via the ASL LocalTerm language elements.<br />

Upon control method execution completion, one object can be returned that can be used as the result<br />

of the execution of the method. The “caller” must either use the result or save it to a different object<br />

if it wants to preserve it. See the description of the Return ASL operator for additional details<br />

NameSpace objects created within the scope of a method are dynamic. They exist only for the<br />

duration of the method execution. They are created when specified by the code <strong>and</strong> are destroyed on<br />

exit. A method may create dynamic objects outside of the current scope in the NameSpace using the<br />

scope operator or using full path names. These objects will still be destroyed on method exit. Objects<br />

created at load time outside of the scope of the method are static. For example:<br />

Scope (\XYZ) {<br />

Name (BAR, 5)<br />

// Creates \XYZ.BAR<br />

Method (FOO, 1) {<br />

Store (BAR, CREG) // same effect as Store (\XYZ.BAR, CREG)<br />

Name (BAR, 7) // Creates \XYZ.FOO.BAR<br />

Store (BAR, DREG) // same effect as Store (\XYZ.FOO.BAR, DREG<br />

Name (\XYZ.FOOB, 3) // Creates \XYZ.FOOB<br />

} // end method<br />

} // end scope<br />

The object \XYZ.BAR is a static object created when the table that contains the above ASL is<br />

loaded. The object \XYZ.FOO.BAR is a dynamic object that is created when the Name (BAR, 7)<br />

statement in the FOO method is executed. The object \XYZ.FOOB is a dynamic object created by<br />

the \XYZ.FOO method when the Name (\XYZ.FOOB, 3) statement is executed. Notice that the<br />

\XYZ.FOOB object is destroyed after the \XYZ.FOO method exits.<br />

5.5.2.4 Access to Operation Regions<br />

Control Methods read <strong>and</strong> write data to locations in address spaces (for example, System memory<br />

<strong>and</strong> System I/O) by using the Field operator (see Section 19.6.46 Field (Declare Field Objects)”) to<br />

declare a data element within an entity known as an “Operation Region” <strong>and</strong> then performing<br />

220 April, 2015 Version 6.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!