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.

<strong>Advanced</strong> <strong>Configuration</strong> <strong>and</strong> <strong>Power</strong> <strong>Interface</strong> <strong>Specification</strong><br />

are executed. There can be at most one Default statement. The Default statement can appear<br />

anywhere in the body of the Switch statement.<br />

A Case or Default term can only appear inside a Switch statement. Switch statements can be nested.<br />

(Compatibility Note) The Switch, Case, <strong>and</strong> Default terms were first introduced in ACPI 2.0.<br />

However, their implementation is backward compatible with ACPI 1.0 AML interpreters.<br />

Example<br />

Use of the Switch statement usually looks something like this:<br />

Switch (expression)<br />

{<br />

Case (value) {<br />

Statements executed if Lequal (expression, value)<br />

}<br />

Case (Package () {value, value, value}) {<br />

Statements executed if Lequal (expression, any value in package)<br />

}<br />

Default {<br />

Statements executed if expression does not equal<br />

any case constant-expression<br />

}<br />

}<br />

Note: (Compiler Note) The following example demonstrates how the Switch statement should be<br />

translated into ACPI 1.0-compatible AML:<br />

Switch (Add (ABCD( ),1)<br />

{<br />

Case (1) {<br />

…statements1…<br />

}<br />

Case (Package () {4,5,6}) {<br />

…statements2…<br />

}<br />

Default {<br />

…statements3…<br />

}<br />

}<br />

is translated as:<br />

890 April, 2015 Version 6.0

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

Saved successfully!

Ooh no, something went wrong!