Advanced Configuration and Power Interface

From Infogalactic: the planetary knowledge core
(Redirected from Suspend to RAM)
Jump to: navigation, search

In computing, the Advanced Configuration and Power Interface (ACPI) specification provides an open standard that the operating systems can use for computer hardware discovery, configuration, power management, and monitoring. Internally, ACPI exports the available functionalities by providing certain instruction lists as part of the system firmware, which the operating system kernel interprets and executes to perform desired operations, using a form of embedded virtual machine.

First released in December 1996, ACPI defines platform-independent interfaces for hardware discovery, configuration, power management, and monitoring, and is designed to replace Advanced Power Management (APM), the MultiProcessor Specification, and the Plug and Play BIOS (PnP) Specification.[1] ACPI brings the power management under the control of the operating system, as opposed to the previous BIOS-centric system that relied on platform-specific firmware to determine power management and configuration policies.[2] The specification is central to Operating System-directed configuration and Power Management (OSPM), a system implementing ACPI which removes device management responsibilities from legacy firmware interfaces.

Intel, Microsoft and Toshiba originally developed the standard, while HP and Phoenix also participated later. In October 2013, the original developers of the ACPI standard agreed to transfer all assets to the UEFI Forum, in which all future development will take place.[citation needed] The latest version of the standard is "Revision 6.0", which was published by the UEFI Forum in April 2015.[3]

Architecture

The firmware-level ACPI has three main components: the ACPI tables, the ACPI BIOS, and the ACPI registers. Unlike its predecessors, such as the APM or PnP BIOS, the ACPI implements little of its functionality in the ACPI BIOS code, whose main role is to load the ACPI tables in system memory. Instead, most of the firmware ACPI functionality is provided in ACPI Machine Language (AML) bytecode stored in the ACPI tables. To make use of these tables, the operating system must have an interpreter for the AML bytecode. A reference AML interpreter implementation is provided by the ACPI Component Architecture (ACPICA). At the BIOS development time, AML code is compiled from the ASL (ACPI Source Language) code.[4][5]

As ACPI also replaces PnP BIOS, it also provides a hardware enumerator, mostly implemented in the Differentiated System Description Table (DSDT) ACPI table. The advantage of a bytecode approach is that unlike PnP BIOS code (which was 16-bit), the ACPI bytecode may be used in any operating system, even in 64-bit long mode.[5]

Overall design decision was not without criticism. In November 2003, Linus Torvalds—author of the Linux kernel—described ACPI as "a complete design disaster in every way".[6][7] In 2001, other senior Linux software developers like Alan Cox expressed concerns about the requirements that bytecode from an external source must be run by the kernel with full privileges, as well as the overall complexity of the ACPI specification.[8] In 2014, Mark Shuttleworth, founder of the Ubuntu Linux distribution, compared ACPI with Trojan horses.[9]

ACPI Component Architecture (ACPICA)

The ACPI Component Architecture (ACPICA), mainly written by Intel's engineers, provides an open-source platform-independent reference implementation of the operating system–related ACPI code.[10] The ACPICA code is used by Linux, Haiku and FreeBSD,[4] which supplement it with their operating-system specific code.

History

The first revision of the ACPI specification was released in December 1996, supporting 16 and 32-bit addressing spaces. It was not until August 2000 that ACPI received 64-bit address support as well as support for multiprocessor workstations and servers with revision 2.0.

In September 2004, revision 3.0 was released, bringing to the ACPI specification support for SATA controllers, PCI Express bus, multiprocessor support for more than 256 processors, ambient light sensors and user-presence devices, as well as extending the thermal model beyond the previous processor-centric support.

Released in June 2009, revision 4.0 of the ACPI specification added various new features to the design; most notable are the USB 3.0 support, logical processor idling support, and x2APIC support.

Revision 5.0 of the ACPI specification was released in December 2011,[11] followed by the revision 5.1 that was released in July 2014.[12]

The latest specification revision is 6.0, which was released in April 2015.[3]

Operating systems

Microsoft's Windows 98 was the first operating system to implement ACPI,[13][14] but its implementation was somewhat buggy or incomplete,[15][16] although some of the problems associated with it were caused by the first-generation ACPI hardware.[17] Other operating systems, including later versions of Windows, eComStation, FreeBSD, NetBSD, OpenBSD, HP-UX, OpenVMS, Linux, and PC versions of Solaris, have at least some support for ACPI.[18] Some newer operating systems like Windows Vista require ACPI-compliant BIOS to work at all[19]

The 2.4 series of the Linux kernel had only minimal support for ACPI, with better support implemented (and enabled by default) from kernel version 2.6.0 onwards.[20] Old ACPI BIOS implementations tend to be quite buggy, and consequently are not supported by later operating systems. For example, Windows 2000, Windows XP, and Windows Server 2003 only use ACPI if the BIOS date is after January 1, 1999.[21] Similarly, Linux kernel 2.6 blacklisted any ACPI BIOS from before January 1, 2001.[20]

OSPM responsibilities

Once an OSPM-compatible operating system activates ACPI, it takes exclusive control of all aspects of power management and device configuration. The OSPM implementation must expose an ACPI-compatible environment to device drivers, which exposes certain system, device and processor states.

Power states

Global states

The ACPI specification defines the following four global "Gx" states and six sleep "Sx" states for an ACPI-compliant computer-system:[22][23]

  • G0 (S0), Working: "Awaymode" is a subset of S0, where monitor is off but background tasks are running.
  • G1, Sleeping: Divided into four states, S1 through S4:
    • S1, Power on Suspend (POS): Processor caches are flushed, and the CPU(s) stops executing instructions. The power to the CPU(s) and RAM is maintained. Devices that do not indicate they must remain on may be powered off.
    • S2: CPU powered off. Dirty cache is flushed to RAM.
    • S3, commonly referred to as Standby, Sleep, or Suspend to RAM (STR): RAM remains powered.
    • S4, Hibernation or Suspend to Disk: All content of the main memory is saved to non-volatile memory such as a hard drive, and the system is powered down.
  • G2 (S5), Soft Off: G2/S5 is almost the same as G3 Mechanical Off, except that the power supply unit (PSU) still supplies power, at a minimum, to the power button to allow return to S0. A full reboot is required. No previous content is retained. Other components may remain powered so the computer can "wake" on input from the keyboard, clock, modem, LAN, or USB device.
  • G3, Mechanical Off: The computer's power has been totally removed via a mechanical switch (as on the rear of a PSU). The power cord can be removed and the system is safe for disassembly (typically, only the real-time clock continues to run using its own small battery).

The specification also defines a Legacy state: the state on an operating system which does not support ACPI. In this state, the hardware and power are not managed via ACPI, effectively disabling ACPI.

Device states

The device states D0D3 are device dependent:

  • D0 or Fully On is the operating state.
  • D1 and D2 are intermediate power-states whose definition varies by device.
  • D3: The D3 state is further divided into D3 Hot (has aux power), and D3 Cold (no power provided):
    • Hot: A device can assert power management requests to transition to higher power states.
    • Cold or Off has the device powered off and unresponsive to its bus.

Processor states

The CPU power states C0C3 are defined as follows:

  • C0 is the operating state.
  • C1 (often known as Halt) is a state where the processor is not executing instructions, but can return to an executing state essentially instantaneously. All ACPI-conformant processors must support this power state. Some processors, such as the Pentium 4, also support an Enhanced C1 state (C1E or Enhanced Halt State) for lower power consumption.[24]
  • C2 (often known as Stop-Clock) is a state where the processor maintains all software-visible state, but may take longer to wake up. This processor state is optional.
  • C3 (often known as Sleep) is a state where the processor does not need to keep its cache coherent, but maintains other state. Some processors have variations on the C3 state (Deep Sleep, Deeper Sleep, etc.) that differ in how long it takes to wake the processor. This processor state is optional.
  • Additional states are defined by manufacturers for some processors. For example, Intel's Haswell platform has states up to C10, where it distinguishes core states and package states.[25]

Performance states

While a device or processor operates (D0 and C0, respectively), it can be in one of several power-performance states. These states are implementation-dependent. Though, P0 is always the highest-performance state; with P1 to Pn being successively lower-performance states, up to an implementation-specific limit of n no greater than 16.[26]

P-states have become known as SpeedStep in Intel processors, as PowerNow! or Cool'n'Quiet in AMD processors, and as PowerSaver in VIA processors.

  • P0 max power and frequency
  • P1 less than P0, voltage and frequency scaled
  • P2 less than P1, voltage and frequency scaled
  • ...
  • Pn less than P(n-1), voltage and frequency scaled

Hardware interface

ACPI-compliant systems interact with hardware through either a "Function Fixed Hardware (FFH) Interface", or a platform-independent hardware programming model which relies on platform-specific ACPI Machine Language (AML) provided by the original equipment manufacturer (OEM).

Function Fixed Hardware interfaces are platform-specific features, provided by platform manufacturers for the purposes of performance and failure recovery. Standard Intel-based PCs have a fixed function interface defined by Intel,[27] which provides a set of core functionality that reduces an ACPI-compliant system's need for full driver stacks for providing basic functionality during boot time or in the case of major system failure.

ACPI Platform Error Interface (APEI) is a specification for reporting of hardware errors, e.g. from the chipset, to the operating system.

Firmware interface

ACPI defines many tables that provide the interface between an ACPI-compliant operating system, and system firmware. This includes Differentiated System Description Table (DSDT), Secondary System Description Table (SSDT), and Static Resource Affinity Table (SRAT), for example.[28]

The tables allow description of system hardware in a platform-independent manner, and are presented as either fixed-formatted data structures or in AML. The main AML table is the DSDT (differentiated system description table).

The Root System Description Pointer is located in a platform-dependent manner, and describes the rest of the tables.

See also

<templatestyles src="Div col/styles.css"/>

References

  1. ACPI Overview
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. 3.0 3.1 Lua error in package.lua at line 80: module 'strict' not found.
  4. 4.0 4.1 ACPI implementation on FreeBSD - Usenix
  5. 5.0 5.1 ACPI in Linux, 2005
  6. Linux Magazine issue 162, May 2014, page 9
  7. Lua error in package.lua at line 80: module 'strict' not found.
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Linux Format n°184, June 2014, page 7.
  10. ACPICA: ACPI Component Architecture
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.[dead link]
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. Windows 98 Does Not Support ACPI Passive Cooling Mode
  17. http://web.archive.org/web/19991013055230/http://winmag.com/library/1998/1201/cov0066.htm
  18. Lua error in package.lua at line 80: module 'strict' not found.
  19. Lua error in package.lua at line 80: module 'strict' not found.
  20. 20.0 20.1 The State of ACPI in the Linux Kernel
  21. ACPI BIOS
  22. ACPI Spec Rev 5.0 - dated December 6, 2011
  23. Lua error in package.lua at line 80: module 'strict' not found.
  24. Lua error in package.lua at line 80: module 'strict' not found.
  25. Lua error in package.lua at line 80: module 'strict' not found.
  26. Lua error in package.lua at line 80: module 'strict' not found.
  27. Lua error in package.lua at line 80: module 'strict' not found.
  28. Lua error in package.lua at line 80: module 'strict' not found.

External links

This article is based on material taken from the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.