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

length of the request data buffer. Afterwards, this value represents the length of the result<br />

response data buffer.<br />

• Data (bytes 65-2) represents a 64-byte buffer, <strong>and</strong> is the location where actual data is stored.<br />

Before the operation is carried out, this represents the actual request message payload.<br />

Afterwards, this represents the response message payload as returned by the IPMI comm<strong>and</strong>.<br />

For example, the following ASL shows the use of the IPMI data buffer to carry out a comm<strong>and</strong> for a<br />

power function. This code is based on the example ASL presented in Section 5.5.2.4.3.1, “Declaring<br />

IPMI Fields,” which lists the operation region <strong>and</strong> field definitions for relevant IPMI power<br />

metering comm<strong>and</strong>s.<br />

/* Create the IPMI data buffer */<br />

Name(BUFF, Buffer(66){})<br />

// Create IPMI data buffer as BUFF<br />

CreateByteField(BUFF, 0x00, STAT)<br />

// STAT = Status (Byte)<br />

CreateByteField(BUFF, 0x01, LENG)<br />

// LENG = Length (Byte)<br />

CreateByteField(BUFF, 0x02, MODE) // MODE = Mode (Byte)<br />

CreateByteField(BUFF, 0x03, RESV)<br />

// RESV = Reserved (Byte)<br />

Store(0x2, LENG)<br />

// Request message is 2 bytes long<br />

Store(0x1, MODE) // Set Mode to 1<br />

Store(Store(BUFF, GPMM), BUFF)<br />

CreateByteField(BUFF, 0x02, CMPC)<br />

CreateWordField(BUFF, 0x03, APOW)<br />

// Write the request into the GPMM comm<strong>and</strong>,<br />

// then read the results<br />

// CMPC = Completion code (Byte)<br />

// APOW = Average power measurement (Word)<br />

If(LAnd(LEqual(STAT, 0x0), LEqual(CMPC, 0x0)))<br />

{<br />

Return(APOW)<br />

}<br />

Else<br />

{<br />

Return(Ones)<br />

}<br />

// Successful?<br />

// Return the average power measurement<br />

// Return invalid<br />

Notice the use of the CreateField primitives to access the data buffer’s sub-elements (Status,<br />

Length, <strong>and</strong> Data), where Data (bytes 65-2) is ‘typecast’ into different fields (including the result<br />

completion code).<br />

The example above demonstrates the use of the Store() operator <strong>and</strong> the bi-directional data buffer to<br />

invoke the actual IPMI comm<strong>and</strong> represented by the virtual register. The inner Store() writes the<br />

request message data buffer to the IPMI operation region h<strong>and</strong>ler, <strong>and</strong> invokes the comm<strong>and</strong>. The<br />

outer Store() takes the result of that comm<strong>and</strong> <strong>and</strong> writes it back into the data buffer, this time<br />

representing the response message.<br />

5.5.2.4.3.3 IPMI Status Code<br />

Every IPMI comm<strong>and</strong> results in a status code returned as the first byte of the response message,<br />

contained in the bi-directional data buffer. This status code can indicate success, various errors, <strong>and</strong><br />

possibly timeout from the IPMI operation h<strong>and</strong>ler. This is necessary because it is possible for certain<br />

IPMI comm<strong>and</strong>s to take up to 5 seconds to carry out, <strong>and</strong> since an AML Store() operation is<br />

synchronous by nature, it is essential to make sure the IPMI operation returns in a timely fashion so<br />

as not to block the AML interpreter in the OSPM.<br />

226 April, 2015 Version 6.0

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

Saved successfully!

Ooh no, something went wrong!