diff options
author | Bob Moore <robert.moore@intel.com> | 2012-08-17 01:07:54 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-09-21 00:26:17 -0400 |
commit | be030a576854238250d70135644cde6a0ba34b0d (patch) | |
tree | a7521a65df5e117ef6aec3fcaa8160be7596a495 /include/acpi/actbl.h | |
parent | 4e2f9c278ad84196991fcf6f6646a3e15967fe90 (diff) |
ACPICA: Add support for complex _PLD buffers.
_PLD (Physical Location of Device) returns a bit-packed buffer that
is difficult to parse. This change adds a new interface,
AcpiDecodePldBuffer that parses the buffer into a more usable
local struct. Also adds macros to both get and set individual
fields within the packed _PLD buffer. Adds a new include file,
acbuffer.h - which will be expanded to add structs for other
ACPI names that return buffers. ACPICA BZ 954.
Emit (in comments) the decoded contents of a static _PLD buffer
in order to improve comprehension of this bit-packed buffer.
Add multi-endian support to the _PLD decode routine. Deploy the
multi-endian macros to extract data from the _PLD buffer.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/acpi/actbl.h')
-rw-r--r-- | include/acpi/actbl.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index d54e3580b7d1..4f94b1d812d5 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -79,9 +79,15 @@ | |||
79 | #pragma pack(1) | 79 | #pragma pack(1) |
80 | 80 | ||
81 | /* | 81 | /* |
82 | * Note about bitfields: The u8 type is used for bitfields in ACPI tables. | 82 | * Note: C bitfields are not used for this reason: |
83 | * This is the only type that is even remotely portable. Anything else is not | 83 | * |
84 | * portable, so do not use any other bitfield types. | 84 | * "Bitfields are great and easy to read, but unfortunately the C language |
85 | * does not specify the layout of bitfields in memory, which means they are | ||
86 | * essentially useless for dealing with packed data in on-disk formats or | ||
87 | * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, | ||
88 | * this decision was a design error in C. Ritchie could have picked an order | ||
89 | * and stuck with it." Norman Ramsey. | ||
90 | * See http://stackoverflow.com/a/1053662/41661 | ||
85 | */ | 91 | */ |
86 | 92 | ||
87 | /******************************************************************************* | 93 | /******************************************************************************* |