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.

ACPI-Defined Devices <strong>and</strong> Device-Specific Objects<br />

H, 8,<br />

Mi,8,<br />

S, 8,<br />

P, 8,<br />

AccessAs(BufferAcc, AttribWord),<br />

Ms, 8,<br />

Tz, 8,<br />

AccessAs(BufferAcc, AttribByte),<br />

Dl, 8,<br />

P2, 8<br />

}<br />

}<br />

Method (_GCP, 0x0, NotSerialized)<br />

{<br />

Return(0x4)<br />

//Implements Real Time interface, but no alarms<br />

}<br />

Method(_GRT, 0x0, NotSerialized)<br />

{<br />

If(LNotEqual(\_SB.TC1.AVBL, 1)) // Verify that SPB OpRegion is available for this<br />

access<br />

{<br />

Return(0)<br />

}<br />

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

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

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

CreateWordField(BUFF, 0x02, DATA) // DATA = Data (Byte)<br />

Name(BUF2,Buffer(0x10){}) // Create buffer to hold the Real Time structure as BUF2<br />

CreateWordField(BUF2, 0x0,Y) //year<br />

CreateByteField(BUF2,0x2,M)<br />

//Month<br />

...<br />

CreateByteField(BUF2,0xc,Dl) //Dl<br />

CreateByteField(BUF2,0xd,P2) //Pad2<br />

Store(\_SB.I2C1.Y, BUFF) //Get each member from the OpRegion <strong>and</strong> store in the structure<br />

Store(DATA,Y)<br />

Store(\_SB.I2C1.M, BUFF)<br />

Store(DATA,M)<br />

...<br />

Store(\_SB.I2C1.Dl, BUFF)<br />

Store(DATA,Dl)<br />

Store(\_SB.I2C1.P2, BUFF)<br />

Store(DATA,P2)<br />

Return(BUF2)<br />

// Success -> return what was last in buffer<br />

}<br />

Method(_SRT,0x1, NotSerialized)<br />

{<br />

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

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

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

CreateWordField(BUFF, 0x02, DATA) // DATA = Data (Byte)<br />

// Verify that SPB OpRegion is available for this access<br />

If(LNotEqual(\_SB.I2C1.AVBL, 1))<br />

{<br />

Return(0)<br />

}<br />

CreateWordField(Arg0,0x0,Y) //Create Fields to access each member of the input data<br />

...<br />

CreateByteField(Arg0,0xd,P2)<br />

Store(Store(Y, \_SB.I2C1.Y), BUFF)<br />

{<br />

If(LEqual(STAT, 0x00))<br />

//Store each input member into the hardware, <strong>and</strong><br />

//set the transaction status into BUFF<br />

//Transaction was _NOT_successful<br />

Version 6.0 551

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

Saved successfully!

Ooh no, something went wrong!