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 />

ResourceTemplate ()<br />

{<br />

// List of resource macros<br />

}<br />

The following is an example of how these macros can be used to create a resource template that can<br />

be returned from a _PRS control method:<br />

Name (PRS0, ResourceTemplate ()<br />

{<br />

StartDependentFn (1, 1)<br />

{<br />

IRQ (Level, ActiveLow, Shared) {10, 11}<br />

DMA (TypeF, NotBusMaster, Transfer16) {4}<br />

IO (Decode16, 0x1000, 0x2000, 0, 0x100)<br />

IO (Decode16, 0x5000, 0x6000, 0, 0x100, IO1)<br />

}<br />

StartDependentFn (1, 1)<br />

{<br />

IRQ (Level, ActiveLow, Shared) {}<br />

DMA (TypeF, NotBusMaster, Transfer16){5}<br />

IO (Decode16, 0x3000, 0x4000, 0, 0x100)<br />

IO (Decode16, 0x5000, 0x6000, 0, 0x100, IO2)<br />

}<br />

EndDependentFn ()<br />

})<br />

Occasionally, it is necessary to change a parameter of a descriptor in an existing resource template at<br />

run-time (i.e., during a method execution.) To facilitate this, the descriptor macros optionally<br />

include a name declaration that can be used later to refer to the descriptor. When a name is declared<br />

with a descriptor, the ASL compiler will automatically create field names under the given name to<br />

refer to individual fields in the descriptor.<br />

The offset returned by a reference to a resource descriptor field name is either in units of bytes (for<br />

8-, 16-, 32-, <strong>and</strong> 64-bit field widths) or in bits (for all other field widths). In all cases, the returned<br />

offset is the integer offset (in either bytes or bits) of the name from the first byte (offset 0) of the<br />

parent resource template.<br />

For example, given the above resource template, the following code changes the minimum <strong>and</strong><br />

maximum addresses for the I/O descriptor named IO2:<br />

CreateWordField (PRS0, IO2._MIN, IMIN)<br />

Store (0xA000, IMIN)<br />

CreateWordField (PRS0, IO2._MAX, IMAX)<br />

Store (0xB000, IMAX)<br />

The resource template macros for each of the resource descriptors are listed below, after the table<br />

that defines the resource descriptor. The resource template macros are formally defined in<br />

Section 6.4.1, “ASL Macros for Resource Descriptors.”<br />

The reserved names (such as _MIN <strong>and</strong> _MAX) for the fields of each resource descriptor are defined<br />

in the appropriate table entry of the table that defines that resource descriptor.<br />

788 April, 2015 Version 6.0

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

Saved successfully!

Ooh no, something went wrong!