diff options
| author | Len Brown <len.brown@intel.com> | 2004-10-22 07:33:45 -0400 |
|---|---|---|
| committer | Len Brown <lenb@dhcppc3.> | 2004-10-22 07:33:45 -0400 |
| commit | 8d7b2d682a9740e2edfb4ab6ceb01a7551797c68 (patch) | |
| tree | b557c7817415600f468cb0242a46ed7ec4de91e7 /include/acpi | |
| parent | 66f574304c9093b48c44206038bf0cac50c5dff1 (diff) | |
[ACPI] ACPICA 20040827 update from Bob Moore
Signed-off-by: Len Brown <len.brown@intel.com>
Implemented support for implicit object conversion in
the non-numeric logical operators (LEqual, LGreater,
LGreaterEqual, LLess, LLessEqual, and LNotEqual.) Any
combination of Integers/Strings/Buffers may now be used;
the second operand is implicitly converted on the fly to
match the type of the first operand. For example:
LEqual (Source1, Source2)
Source1 and Source2 must each evaluate to an integer, a
string, or a buffer. The data type of Source1 dictates the
required type of Source2. Source2 is implicitly converted
if necessary to match the type of Source1.
Updated and corrected the behavior of the string
conversion support. The rules concerning conversion of
buffers to strings (according to the ACPI specification)
are as follows:
ToDecimalString - explicit byte-wise conversion of buffer
to string of decimal values (0-255) separated by commas.
ToHexString - explicit byte-wise conversion of buffer to
string of hex values (0-FF) separated by commas.
ToString - explicit byte-wise conversion of buffer to
string. Byte-by-byte copy with no transform except NULL
terminated. Any other implicit buffer-to-string conversion
byte-wise conversion of buffer to string of hex values
(0-FF) separated by spaces.
Fixed a problem in acpi_ns_get_pathname_length where the
returned length was one byte too short in the case of a
node in the root scope. This could cause a fault during
debug output.
Diffstat (limited to 'include/acpi')
| -rw-r--r-- | include/acpi/acconfig.h | 2 | ||||
| -rw-r--r-- | include/acpi/acinterp.h | 32 | ||||
| -rw-r--r-- | include/acpi/acobject.h | 5 | ||||
| -rw-r--r-- | include/acpi/actypes.h | 9 | ||||
| -rw-r--r-- | include/acpi/acutils.h | 4 | ||||
| -rw-r--r-- | include/acpi/amlcode.h | 25 | ||||
| -rw-r--r-- | include/acpi/amlresrc.h | 4 |
7 files changed, 54 insertions, 27 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index e4a0f1e6f814..5911d1b3c589 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20040816 +#define ACPI_CA_VERSION 0x20040827 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index a43e91fb972c..f87445f46b54 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -83,21 +83,27 @@ acpi_status acpi_ex_convert_to_integer ( union acpi_operand_object *obj_desc, union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state); + u16 opcode); acpi_status acpi_ex_convert_to_buffer ( union acpi_operand_object *obj_desc, union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state); + u16 opcode); acpi_status acpi_ex_convert_to_string ( union acpi_operand_object *obj_desc, union acpi_operand_object **result_desc, - u32 base, - u32 max_length, - struct acpi_walk_state *walk_state); + u32 type, + u16 opcode); + +/* Types for String conversion */ + +#define ACPI_EXPLICIT_BYTE_COPY 0x00000000 +#define ACPI_EXPLICIT_CONVERT_HEX 0x00000001 +#define ACPI_IMPLICIT_CONVERT_HEX 0x00000002 +#define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003 acpi_status acpi_ex_convert_to_target_type ( @@ -109,7 +115,7 @@ acpi_ex_convert_to_target_type ( u32 acpi_ex_convert_to_ascii ( acpi_integer integer, - u32 base, + u16 base, u8 *string, u8 max_length); @@ -243,11 +249,19 @@ acpi_ex_do_concatenate ( union acpi_operand_object **actual_return_desc, struct acpi_walk_state *walk_state); -u8 +acpi_status +acpi_ex_do_logical_numeric_op ( + u16 opcode, + acpi_integer integer0, + acpi_integer integer1, + u8 *logical_result); + +acpi_status acpi_ex_do_logical_op ( u16 opcode, - union acpi_operand_object *obj_desc, - union acpi_operand_object *obj_desc2); + union acpi_operand_object *operand0, + union acpi_operand_object *operand1, + u8 *logical_result); acpi_integer acpi_ex_do_math_op ( diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 0d479722f4aa..09d6a5af268c 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -135,7 +135,10 @@ struct acpi_object_integer acpi_integer value; }; - +/* + * Note: The String and Buffer object must be identical through the Pointer + * element. There is code that depends on this. + */ struct acpi_object_string /* Null terminated, ASCII characters only */ { ACPI_OBJECT_COMMON_HEADER diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 8bee457d81d6..c5bd3036c57a 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -303,7 +303,7 @@ struct uint32_struct typedef u32 acpi_integer; #define ACPI_INTEGER_MAX ACPI_UINT32_MAX #define ACPI_INTEGER_BIT_SIZE 32 -#define ACPI_MAX_DECIMAL_DIGITS 10 +#define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ @@ -315,13 +315,18 @@ typedef u32 acpi_integer; typedef u64 acpi_integer; #define ACPI_INTEGER_MAX ACPI_UINT64_MAX #define ACPI_INTEGER_BIT_SIZE 64 -#define ACPI_MAX_DECIMAL_DIGITS 19 +#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ + #if ACPI_MACHINE_WIDTH == 64 #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ #endif #endif +#define ACPI_MAX64_DECIMAL_DIGITS 20 +#define ACPI_MAX32_DECIMAL_DIGITS 10 +#define ACPI_MAX16_DECIMAL_DIGITS 5 +#define ACPI_MAX8_DECIMAL_DIGITS 3 /* * Constants with special meanings diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index d786ae5ec820..ab3784a0cf58 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -577,6 +577,10 @@ union acpi_operand_object * acpi_ut_create_buffer_object ( acpi_size buffer_size); +union acpi_operand_object * +acpi_ut_create_string_object ( + acpi_size string_size); + /* * ut_ref_cnt - Object reference count management diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 0344b94c863d..1d06e16648cc 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h @@ -305,19 +305,20 @@ /* Opcode flags */ -#define AML_HAS_ARGS 0x0800 -#define AML_HAS_TARGET 0x0400 -#define AML_HAS_RETVAL 0x0200 -#define AML_NSOBJECT 0x0100 -#define AML_NSOPCODE 0x0080 -#define AML_NSNODE 0x0040 -#define AML_NAMED 0x0020 -#define AML_DEFER 0x0010 -#define AML_FIELD 0x0008 -#define AML_CREATE 0x0004 -#define AML_MATH 0x0002 #define AML_LOGICAL 0x0001 -#define AML_CONSTANT 0x1000 +#define AML_LOGICAL_NUMERIC 0x0002 +#define AML_MATH 0x0004 +#define AML_CREATE 0x0008 +#define AML_FIELD 0x0010 +#define AML_DEFER 0x0020 +#define AML_NAMED 0x0040 +#define AML_NSNODE 0x0080 +#define AML_NSOPCODE 0x0100 +#define AML_NSOBJECT 0x0200 +#define AML_HAS_RETVAL 0x0400 +#define AML_HAS_TARGET 0x0800 +#define AML_HAS_ARGS 0x1000 +#define AML_CONSTANT 0x2000 /* Convenient flag groupings */ diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index b28b6905b71e..89a52ddae530 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -99,7 +99,7 @@ struct asl_resource_node /* * Resource descriptors defined in the ACPI specification. * - * Alignment must be BYTE because these descriptors + * Packing/alignment must be BYTE because these descriptors * are used to overlay the AML byte stream. */ #pragma pack(1) @@ -297,7 +297,7 @@ struct asl_general_register_desc #pragma pack() -/* Union of all resource descriptors, sow we can allocate the worst case */ +/* Union of all resource descriptors, so we can allocate the worst case */ union asl_resource_desc { |
