27.10.2015 Views

Advanced Configuration and Power Interface Specification

ACPI_6.0

ACPI_6.0

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ACPI Software Programming Model<br />

ReleaseGlobalLock:<br />

mov ecx, GlobalLock ; ecx = Address of Global Lock in FACS<br />

rel10: mov eax, [ecx] ; Get current value of Global Lock<br />

mov edx, eax<br />

<strong>and</strong> edx, not 03h ; Clear owner <strong>and</strong> pending field<br />

lock cmpxchg dword ptr[ecx], edx ; Attempt to set it<br />

jnz short rel10<br />

; If not set, try again<br />

<strong>and</strong> eax, 1<br />

; Was pending set?<br />

; If one is returned (we were pending) the caller must signal that the<br />

; lock has been released using either GBL_RLS or BIOS_RLS as appropriate<br />

ret<br />

Although using the Global Lock allows various hardware resources to be shared, it is important to<br />

notice that its usage when there is ownership contention could entail a significant amount of system<br />

overhead as well as waits of an indeterminate amount of time to acquire ownership of the Global<br />

Lock. For this reason, implementations should try to design the hardware to keep the required usage<br />

of the Global Lock to a minimum.<br />

The Global Lock is required whenever a logical register in the hardware is shared. For example, if<br />

bit 0 is used by ACPI (OSPM) <strong>and</strong> bit 1 of the same register is used by SMI, then access to that<br />

register needs to be protected under the Global Lock, ensuring that the register’s contents do not<br />

change from underneath one environment while the other is making changes to it. Similarly if the<br />

entire register is shared, as the case might be for the embedded controller interface, access to the<br />

register needs to be protected under the Global Lock.<br />

5.2.11 Definition Blocks<br />

A Definition Block consists of data in AML format (see Section 5.4 “Definition Block Encoding”)<br />

<strong>and</strong> contains information about hardware implementation details in the form of AML objects that<br />

contain data, AML code, or other AML objects. The top-level organization of this information after<br />

a definition block is loaded is name-tagged in a hierarchical namespace.<br />

OSPM “loads” or “unloads” an entire definition block as a logical unit. OSPM will load a definition<br />

block either as a result of executing the AML Load() or LoadTable() operator or encountering a<br />

table definition during initialization. During initialization, OSPM loads the Differentiated System<br />

Description Table (DSDT), which contains the Differentiated Definition Block, using the DSDT<br />

pointer retrieved from the FADT. OSPM will load other definition blocks during initialization as a<br />

result of encountering Secondary System Description Table (SSDT) definitions in the RSDT/XSDT.<br />

The DSDT <strong>and</strong> SSDT are described in the following sections.<br />

As mentioned, the AML Load() <strong>and</strong> LoadTable() operators make it possible for a Definition Block<br />

to load other Definition Blocks, either statically or dynamically, where they in turn can either define<br />

new system attributes or, in some cases, build on prior definitions. Although this gives the hardware<br />

the ability to vary widely in implementation, it also confines it to reasonable boundaries. In some<br />

cases, the Definition Block format can describe only specific <strong>and</strong> well-understood variances. In<br />

other cases, it permits implementations to be expressible only by means of a specified set of “built<br />

in” operators. For example, the Definition Block has built in operators for I/O space.<br />

Version 6.0 135

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

Saved successfully!

Ooh no, something went wrong!